我创建了一个项目,在Hibernate中自定义的用户类型。直到我接触到isMutable方法时,它一直比较简单。我试图找出这种方法意味着什么,合同明智。创建一个定制的Hibernate UserType - isMutable()是什么意思?
这是否意味着我创建的用户类型为不可变还是意味着持有这一类绝不会指向不同的实例的实例的引用对象的类?
我在Hibernate Community Wiki中发现了一些例子,它们返回true,因为对象本身是可变的 - http://www.hibernate.org/73.html。
在社区维基其他例子不解决,为什么返回false,尽管他们也是可变的。
我检查的JavaDoc,但无论是不是很清楚。
从JavaDoc中UserType:
public boolean isMutable()
Are objects of this type mutable?
Returns:
boolean
从JavaDoc中Type:
public boolean isMutable()
Are objects of this type mutable. (With respect to the referencing
object ... entities and collections are considered immutable because
they manage their own internal state.)
Returns:
boolean
链接不再有效fyi – Jackie 2014-05-21 17:34:42