Class DefaultChangeSet
- java.lang.Object
-
- de.hybris.platform.directpersistence.impl.DefaultChangeSet
-
- All Implemented Interfaces:
ChangeSet,MutableChangeSet
public class DefaultChangeSet extends java.lang.Object implements MutableChangeSet
Default implementation of direct persistence change set.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.log4j.LoggerLOG
-
Constructor Summary
Constructors Constructor Description DefaultChangeSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(EntityRecord... entityRecords)Adds new entity records to change set.voidaddAllEntityRecords(java.util.Collection<? extends EntityRecord> entityRecords)Adds new entity records to change set.booleanallowEmptyUpdate()Allows empty updates (by default) or not.voidfinish()java.util.Collection<EntityRecord>getEntityRecords()Gets immutable collections with entity records.java.util.Map<java.lang.String,RelationChanges>getRelationChanges()Gets immutable map with all relation changesets.RelationChangesgetRelationChangesForRelation(java.lang.String relationName)Gets relation changes for single relation type identified by name.voidgroupOrderInformation()Group together information about order (position) where possible.booleanisJaloWayRecommended()Provides info, if jalo way is recommended (instead of direct persistence)voidputRelationChanges(java.lang.String relationName, RelationChanges changeSet)Adds new relation changes for the given relation type.voidsetJaloWayRecommended(boolean jaloWayRecommended)Sets the jaloWayRecommended flag.voidsortAll()Sorts collection of entity records and relation records by PK.voidsortEntityRecords()Sorts collection of entity records by PK.java.lang.StringtoString()ChangeSetwithAdded(ChangeSet otherChangeSet)Creates a new ChangeSet that contains the sum of EntityRecords and RelationChanges from this ChangeSet and otherChangeSet
-
-
-
Method Detail
-
getEntityRecords
public java.util.Collection<EntityRecord> getEntityRecords()
Description copied from interface:ChangeSetGets immutable collections with entity records.- Specified by:
getEntityRecordsin interfaceChangeSet- Returns:
- collection of records
-
add
public void add(EntityRecord... entityRecords)
Description copied from interface:MutableChangeSetAdds new entity records to change set.- Specified by:
addin interfaceMutableChangeSet
-
addAllEntityRecords
public void addAllEntityRecords(java.util.Collection<? extends EntityRecord> entityRecords)
Description copied from interface:MutableChangeSetAdds new entity records to change set.- Specified by:
addAllEntityRecordsin interfaceMutableChangeSet
-
getRelationChanges
public java.util.Map<java.lang.String,RelationChanges> getRelationChanges()
Description copied from interface:ChangeSetGets immutable map with all relation changesets.- Specified by:
getRelationChangesin interfaceChangeSet- Returns:
- map of relation changes where key is the relation name and value RelationChanges object
-
putRelationChanges
public void putRelationChanges(java.lang.String relationName, RelationChanges changeSet)Description copied from interface:MutableChangeSetAdds new relation changes for the given relation type.- Specified by:
putRelationChangesin interfaceMutableChangeSet- Parameters:
relationName- Name of relationchangeSet- Relation changes
-
getRelationChangesForRelation
public RelationChanges getRelationChangesForRelation(java.lang.String relationName)
Description copied from interface:MutableChangeSetGets relation changes for single relation type identified by name.- Specified by:
getRelationChangesForRelationin interfaceMutableChangeSet- Parameters:
relationName- Name of relations
-
sortEntityRecords
public void sortEntityRecords()
Description copied from interface:MutableChangeSetSorts collection of entity records by PK.- Specified by:
sortEntityRecordsin interfaceMutableChangeSet
-
groupOrderInformation
public void groupOrderInformation()
Description copied from interface:MutableChangeSetGroup together information about order (position) where possible.- Specified by:
groupOrderInformationin interfaceMutableChangeSet
-
sortAll
public void sortAll()
Description copied from interface:MutableChangeSetSorts collection of entity records and relation records by PK.- Specified by:
sortAllin interfaceMutableChangeSet
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setJaloWayRecommended
public void setJaloWayRecommended(boolean jaloWayRecommended)
Description copied from interface:MutableChangeSetSets the jaloWayRecommended flag. Only in some rare, exceptional cases this flag should be set to true. If it's set, it means - switching to jalo Way (instead of the direct persistence) is strongly recommended- Specified by:
setJaloWayRecommendedin interfaceMutableChangeSet- Parameters:
jaloWayRecommended- jaloWayRecommended flag
-
finish
public void finish()
- Specified by:
finishin interfaceMutableChangeSet
-
isJaloWayRecommended
public boolean isJaloWayRecommended()
Description copied from interface:ChangeSetProvides info, if jalo way is recommended (instead of direct persistence)- Specified by:
isJaloWayRecommendedin interfaceChangeSet- Returns:
true, if jalo way is recommended,falseby default (direct persistence)
-
withAdded
public ChangeSet withAdded(ChangeSet otherChangeSet)
Description copied from interface:ChangeSetCreates a new ChangeSet that contains the sum of EntityRecords and RelationChanges from this ChangeSet and otherChangeSet
-
allowEmptyUpdate
public boolean allowEmptyUpdate()
Description copied from interface:ChangeSetAllows empty updates (by default) or not.- Specified by:
allowEmptyUpdatein interfaceChangeSet- Returns:
true, if empty updates are allowed (by default),falseotherwise
-
-