/** * {@inheritDoc} */ @Override public Map<String, Object> getDirtyProperties(IEntity entity) { return getDirtyProperties(entity, true); }
/** * {@inheritDoc} */ @Override public boolean isDirty(IEntity entity, boolean includeComputed) { if (entity == null) { return false; } Map<String, Object> entityDirtyProperties = getDirtyProperties(entity, includeComputed); if (entityDirtyProperties != null) { entityDirtyProperties.remove(IEntity.VERSION); } return entityDirtyProperties != null && !entityDirtyProperties.isEmpty(); }
public void recordAsSynchronized(IEntity flushedEntity) { if (isUnitOfWorkActive()) { Map<String, Object> hasActuallyBeenFlushed = getDirtyProperties(flushedEntity, false); if (hasActuallyBeenFlushed == null) { String message = MessageFormatter.arrayFormat(
/** * Gets whether the entity property is dirty (has changes that need to be * updated to the persistent store). * * @param entity * the entity to test. * @param propertyName * the entity property to test. * @return true if the entity is dirty. */ @Override public boolean isDirty(IEntity entity, String propertyName) { if (entity == null) { return false; } Map<String, Object> entityDirtyProperties = getDirtyProperties(entity); if (entityDirtyProperties != null && entityDirtyProperties.containsKey(propertyName)) { IPropertyDescriptor propertyDescriptor = getEntityFactory().getComponentDescriptor(getComponentContract(entity)) .getPropertyDescriptor(propertyName); return propertyDescriptor != null && !propertyDescriptor.isComputed(); } return false; }
sessionUnitOfWork.register(registeredEntity, getDirtyProperties(entity)); } else { sessionUnitOfWork.register(registeredEntity, null); return registeredEntity; } else if (mergeMode == EMergeMode.MERGE_EAGER) { sessionUnitOfWork.register(registeredEntity, getDirtyProperties(entity));