List of usage examples for org.hibernate.type Type isModified
boolean isModified(Object dbState, Object currentState, boolean[] checkable, SharedSessionContractImplementor session) throws HibernateException;
From source file:org.riotfamily.common.hibernate.AnyIdAnyType.java
License:Apache License
public boolean isModified(Object old, Object current, boolean[] checkable, SessionImplementor session) throws HibernateException { if (current == null) return old != null; if (old == null) return current != null; ObjectTypeCacheEntry holder = (ObjectTypeCacheEntry) old; boolean[] idcheckable = new boolean[checkable.length - 1]; System.arraycopy(checkable, 1, idcheckable, 0, idcheckable.length); if (checkable[0] && !holder.entityName.equals(session.bestGuessEntityName(current))) { return true; }/*from w ww . j ava 2s . c o m*/ Type idType = getIdType(holder.entityName, session); return idType.isModified(holder.id, getIdentifier(current, session), idcheckable, session); }