/** * INTERNAL: * Return the value that should be stored in the identity map. If the value * is stored in the object, then return a null. */ public Object getValueToPutInCache(AbstractRecord row, AbstractSession session) { if (isStoredInCache()) { return session.getDatasourcePlatform().convertObject(row.get(getWriteLockField()), ClassConstants.TIMESTAMP); } else { return null; } }
/** * INTERNAL: * Return the value that should be stored in the identity map. If the value * is stored in the object, then return a null. */ public Object getValueToPutInCache(AbstractRecord row, AbstractSession session) { if (isStoredInCache()) { return session.getDatasourcePlatform().convertObject(row.get(getWriteLockField()), ClassConstants.TIMESTAMP); } else { return null; } }
/** * INTERNAL: * Return the value that should be stored in the identity map. If the value * is stored in the object, then return a null. */ public Object getValueToPutInCache(AbstractRecord row, AbstractSession session) { if (isStoredInCache()) { return session.getDatasourcePlatform().convertObject(row.get(getWriteLockField()), ClassConstants.TIMESTAMP); } else { return null; } }
/** * INTERNAL: * Compares the value from the row and from the object (or cache). * Will return true if the row is newer than the object. */ public boolean isNewerVersion(AbstractRecord databaseRow, Object domainObject, java.util.Vector primaryKey, AbstractSession session) { java.sql.Timestamp writeLockFieldValue; java.sql.Timestamp newWriteLockFieldValue = (java.sql.Timestamp)session.getDatasourcePlatform().convertObject(databaseRow.get(getWriteLockField()), ClassConstants.TIMESTAMP); if (isStoredInCache()) { writeLockFieldValue = (java.sql.Timestamp)session.getIdentityMapAccessorInstance().getWriteLockValue(primaryKey, domainObject.getClass(), getDescriptor()); } else { writeLockFieldValue = (java.sql.Timestamp)lockValueFromObject(domainObject); } return isNewerVersion(newWriteLockFieldValue, writeLockFieldValue); }
/** * INTERNAL: * Compares the value from the row and from the object (or cache). * Will return true if the row is newer than the object. */ @Override public boolean isNewerVersion(AbstractRecord databaseRow, Object domainObject, Object primaryKey, AbstractSession session) { java.sql.Timestamp writeLockFieldValue; java.sql.Timestamp newWriteLockFieldValue = (java.sql.Timestamp)session.getDatasourcePlatform().convertObject(databaseRow.get(getWriteLockField()), ClassConstants.TIMESTAMP); if (isStoredInCache()) { writeLockFieldValue = (java.sql.Timestamp)session.getIdentityMapAccessorInstance().getWriteLockValue(primaryKey, domainObject.getClass(), getDescriptor()); } else { writeLockFieldValue = (java.sql.Timestamp)lockValueFromObject(domainObject); } return isNewerVersion(newWriteLockFieldValue, writeLockFieldValue); }
/** * INTERNAL: * Compares the value from the row and from the object (or cache). * Will return true if the row is newer than the object. */ @Override public boolean isNewerVersion(AbstractRecord databaseRow, Object domainObject, Object primaryKey, AbstractSession session) { java.sql.Timestamp writeLockFieldValue; java.sql.Timestamp newWriteLockFieldValue = (java.sql.Timestamp)session.getDatasourcePlatform().convertObject(databaseRow.get(getWriteLockField()), ClassConstants.TIMESTAMP); if (isStoredInCache()) { writeLockFieldValue = (java.sql.Timestamp)session.getIdentityMapAccessorInstance().getWriteLockValue(primaryKey, domainObject.getClass(), getDescriptor()); } else { writeLockFieldValue = (java.sql.Timestamp)lockValueFromObject(domainObject); } return isNewerVersion(newWriteLockFieldValue, writeLockFieldValue); }