我創建了一個項目,在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