How to map a MySQL char(n) column to an instance variable using a JPA/Hibernate annotation?

后端 未结 2 1690
一向
一向 2020-12-16 12:53

I encounter a JPA/Hibernate mapping problem on a column \"language\" in a MySQL table whose type is char(7). In my entity, the code generated for the field is:



        
相关标签:
2条回答
  • 2020-12-16 13:28

    Try this:

    @Column(name="language",columnDefinition="char(7)")
    

    see if that works.

    0 讨论(0)
  • 2020-12-16 13:40

    For me*Grails it's works: sqlType: "char" on mapping

    0 讨论(0)
提交回复
热议问题