UserType nullSafeGet和nullSafeSet迁移

时间:2013-06-10 13:21:06

标签: java hibernate

有没有人知道如何将已弃用的Hibernate 3 nullSafeGetnullSafeSet方法中的代码迁移到采用{{1}的较新Hibernate 4 nullSafeGetnullSafeSet方法参数?

我想我可以简单地从较新的方法调用旧的(已弃用的)方法,忽略SessionImplementor参数。但我不确定这种选择的含义是什么。在书中" Hibernate Recipes"在第90页,作者忽略了SessionImplementor参数。

此更改的相关Hibernate文档
Migration guide detailing that the change is happening in v4.0
Hibernate team JIRA report for this change

2 个答案:

答案 0 :(得分:1)

同样的策略(忽略)也适用于org.hibernate.type.EnumType

答案 1 :(得分:1)

如果你需要,可以使用SessionImplementor。否则忽略它