开发者

Query on hibernate entity with user-type field

开发者 https://www.devze.com 2022-12-14 19:23 出处:网络
working with开发者_JS百科 JPA above hibernate impl. I map my enums by using user-type follow the good practice to store a persistence key to the enum and not the ordinal (which can be changed).

working with开发者_JS百科 JPA above hibernate impl. I map my enums by using user-type follow the good practice to store a persistence key to the enum and not the ordinal (which can be changed).

Now, i have a problem to query on the enum field. it seems that hibernate dont execute the user type convert on the name-query.

Any idea?


I just wrestled with this same issue, and the solution is simple: implement LiteralType as well as UserType.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号