如下,在數據庫加載並編輯A后,HashMap 的 B 和 PersistentMap 的 B的值可能不同,請問如何分別取得這兩個值?
entity A
private Map B=new HashMap();
public Map getB()
{
return this.B;
}
如getB()的話,返回的是 HashMap值。
如下,在數據庫加載並編輯A后,HashMap 的 B 和 PersistentMap 的 B的值可能不同,請問如何分別取得這兩個值?
entity A
private Map B=new HashMap();
public Map getB()
{
return this.B;
}
如getB()的話,返回的是 HashMap值。
重写entity A的hashCode方法,增加一个变量,存储第一次调用产生的hashcode,让它始终返回这个值