Class DefaultEntityHistoryConfig
java.lang.Object
ch.tocco.nice2.persist.history.impl.v2.config.DefaultEntityHistoryConfig
- All Implemented Interfaces:
EntityHistoryConfiguration
@Component
public class DefaultEntityHistoryConfig
extends Object
implements EntityHistoryConfiguration
The default history configuration.
All fields are included except 'auto'-fields, 'password' type fields and explicitly excluded fields.
Only relations to lookup entities are included.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.persist.history.api.v2.EntityHistoryConfiguration
EntityHistoryConfiguration.RelationDefinition -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetIncludedFields(EntityModel entityModel) getIncludedRelations(Entity centerEntity) booleanintpriority()voidvoidsetIgnoreEntityModels(List<HistoryExclusionContribution> contributions) booleansupports(EntityModel entityModel, boolean isRootEntity)
-
Constructor Details
-
DefaultEntityHistoryConfig
public DefaultEntityHistoryConfig()
-
-
Method Details
-
setIgnoreEntityModels
-
setHistoryRelationInclusionConfigs
@Autowired(required=false) public void setHistoryRelationInclusionConfigs(List<HistoryRelationInclusionContribution> contributions) -
supports
- Specified by:
supportsin interfaceEntityHistoryConfiguration- Returns:
- true if
EntityHistoryConfigurationsupports this entity model. `isRootEntity` is used to distinguish between a lookup entity itself is changed and the full xml should be generated or a related entity is changed and only some fields should be in the xml.
-
priority
public int priority()- Specified by:
priorityin interfaceEntityHistoryConfiguration
-
isApplicableForHistory
- Specified by:
isApplicableForHistoryin interfaceEntityHistoryConfiguration- Returns:
- true if the given event should trigger the creation of a history entry
-
getIncludedFields
- Specified by:
getIncludedFieldsin interfaceEntityHistoryConfiguration- Returns:
- which fields should be included in the history snapshot for the given entity model
-
getIncludedRelations
public List<EntityHistoryConfiguration.RelationDefinition> getIncludedRelations(Entity centerEntity) - Specified by:
getIncludedRelationsin interfaceEntityHistoryConfiguration- Returns:
- which relations should be included in the history snapshot for the given entity model
-