休眠枚举映射

休眠枚举映射,第1张

休眠枚举映射

可以创建一个自定义

UserType
(例如this)并从您的映射中使用它

<property name="type" not-null="true">  <type name="at.molindo.util.hibernate.EnumUserType">    <param name="enumClass">      com.example.MyEnum    </param>  </type></property>

编辑:Hibernate带有它自己的EnumType(因为在hibernate-annotations中为3.2,因为在hibernate-
core中为3.6-在撰写本文时不知道它在hibernate-annotation中,但请参见Diego的回答。



欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5131361.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-17
下一篇2022-11-17

发表评论

登录后才能评论

评论列表(0条)

    保存