Object stampField = entity.get(ModelEntity.STAMP_FIELD);
if ((stampField != null) && (!stampField.equals(entityCopy.get(ModelEntity.STAMP_FIELD)))) {
String lockedTime = entityCopy.getTimestamp(ModelEntity.STAMP_FIELD).toString();
throw new EntityLockedException("You tried to update an old version of this data. Version locked: (" + lockedTime + ")");
}
}
// if we have a STAMP_TX_FIELD then set it with NOW, always do this before the STAMP_FIELD
// NOTE: these fairly complicated if statements have a few objectives: