Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在hibernate impl之上使用JPA。我使用用户类型映射我的枚举遵循良好实践将持久性密钥存储到枚举而不是序数(可以更改)。
现在,我有一个问题要查询枚举字段。似乎休眠不会在名称查询上执行用户类型转换。
任何想法?
我刚刚为同样的问题苦苦挣扎,解决方案很简单:实现LiteralType以及UserType.
LiteralType
UserType