Package io.jmix.data.impl
Class BaseAttributeChangesProvider
java.lang.Object
io.jmix.data.impl.BaseAttributeChangesProvider
- All Implemented Interfaces:
- AttributeChangesProvider
- Direct Known Subclasses:
- EclipselinkAttributeChangesProvider
public abstract class BaseAttributeChangesProvider
extends Object
implements AttributeChangesProvider
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected EntityStatesprotected Metadataprotected MetadataTools
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract voidbuildChangesByImplementation(AttributeChanges.Builder builder, Object entity, BiFunction<Object, MetaProperty, Object> transformer) protected voidbuildExtraChanges(AttributeChanges.Builder builder, Object entity) protected voidcheckEntityState(Object entity) protected ObjectconvertValueIfNeeded(Object value, MetaProperty metaProperty) getAttributeChanges(Object entity) Returns an object describing changes in entity attributes.getChangedAttributeNames(Object entity) Returns the set of dirty attributes (changed since the last load from the database).getOldValue(Object entity, String attribute) Returns an old value of an attribute changed in the current transaction.protected abstract ObjectgetOldValueByImplementation(Object entity, String attribute) booleanReturns true if the given entity has dirty attributes (changed since the last load from the database).booleanReturns true if at least one of the given attributes is dirty (i.e.protected abstract booleanprotected Collection<Object>newCollectionForProperty(MetaProperty metaProperty) voidsetEntityStates(EntityStates entityStates) voidsetMetadata(Metadata metadata) voidsetMetadataTools(MetadataTools metadataTools) 
- 
Field Details- 
entityStates
- 
metadata
- 
metadataTools
 
- 
- 
Constructor Details- 
BaseAttributeChangesProviderpublic BaseAttributeChangesProvider()
 
- 
- 
Method Details- 
setEntityStates
- 
setMetadata
- 
setMetadataTools
- 
getAttributeChangesDescription copied from interface:AttributeChangesProviderReturns an object describing changes in entity attributes.- Specified by:
- getAttributeChangesin interface- AttributeChangesProvider
- Parameters:
- entity- entity instance
- Returns:
- dirty attribute names
 
- 
buildChangesByImplementationprotected abstract void buildChangesByImplementation(AttributeChanges.Builder builder, Object entity, BiFunction<Object, MetaProperty, Object> transformer) 
- 
getChangedAttributeNamesDescription copied from interface:AttributeChangesProviderReturns the set of dirty attributes (changed since the last load from the database).If the entity is new, returns all its attributes. If the entity is not persistent or not in the Managed state, returns empty set. - Specified by:
- getChangedAttributeNamesin interface- AttributeChangesProvider
- Parameters:
- entity- entity instance
- Returns:
- dirty attribute names
- See Also:
 
- 
getChangedAttributeNamesByImplementation
- 
isChangedDescription copied from interface:AttributeChangesProviderReturns true if the given entity has dirty attributes (changed since the last load from the database).
 If the entity is new, returns true.
 If the entity is not persistent or not in the Managed state, returns false.- Specified by:
- isChangedin interface- AttributeChangesProvider
- Parameters:
- entity- entity instance
- See Also:
 
- 
isChangedDescription copied from interface:AttributeChangesProviderReturns true if at least one of the given attributes is dirty (i.e. changed since the last load from the database).If the entity is new, always returns true. If the entity is not persistent or not in the Managed state, always returns false. - Specified by:
- isChangedin interface- AttributeChangesProvider
- Parameters:
- entity- entity instance
- attributes- attributes to check
- See Also:
 
- 
getOldValueDescription copied from interface:AttributeChangesProviderReturns an old value of an attribute changed in the current transaction. The entity must be in the Managed state. For enum attributes returns enum value.
 You can check if the value has been changed usingAttributeChangesProvider.isChanged(Object, String...)method.- Specified by:
- getOldValuein interface- AttributeChangesProvider
- Parameters:
- entity- entity instance
- attribute- attribute name
- Returns:
- an old value stored in the database. For a new entity returns null.
- See Also:
 
- 
getOldValueByImplementation
- 
convertValueIfNeeded
- 
isSoftDeletionEnabledprotected abstract boolean isSoftDeletionEnabled()
- 
buildExtraChanges
- 
newCollectionForProperty
- 
checkEntityState
 
-