hibernate map java Long to MySQL BIGINT error

后端 未结 2 1065
别跟我提以往
别跟我提以往 2021-01-02 09:30

i have a table with id field type BIGINT in MySQL

in hibernate object, i use java Long type for this field

but when run program, it throw exception: Ex

相关标签:
2条回答
  • 2021-01-02 10:08

    Does it help if you add a columnDefinition like columnDefinition = “bigint(20)″ to your mapping parameters?

    0 讨论(0)
  • 2021-01-02 10:21

    but when run program, it throw exception: Expected: class java.lang.Long, got class java.lang.Integer

    Using a Long for a BIGINT is correct and the above error suggests that you are somehow passing an Integer where a Long is expected somewhere in your code. Double check your code.

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