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:
Expected: class java.lang.Long, got class java.lang.Integer
how to map MySQL BINGINT datatype in hibernate ?
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.
Does it help if you add a columnDefinition like columnDefinition = “bigint(20)″ to your mapping parameters?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With