Class DefaultChangeSet

java.lang.Object
de.hybris.platform.directpersistence.impl.DefaultChangeSet
All Implemented Interfaces:
ChangeSet, MutableChangeSet

public class DefaultChangeSet extends Object implements MutableChangeSet
Default implementation of direct persistence change set.
  • Field Details

    • LOG

      protected static org.apache.log4j.Logger LOG
  • Constructor Details

    • DefaultChangeSet

      public DefaultChangeSet()
  • Method Details

    • getEntityRecords

      public Collection<EntityRecord> getEntityRecords()
      Description copied from interface: ChangeSet
      Gets immutable collections with entity records.
      Specified by:
      getEntityRecords in interface ChangeSet
      Returns:
      collection of records
    • add

      public void add(EntityRecord... entityRecords)
      Description copied from interface: MutableChangeSet
      Adds new entity records to change set.
      Specified by:
      add in interface MutableChangeSet
    • addAllEntityRecords

      public void addAllEntityRecords(Collection<? extends EntityRecord> entityRecords)
      Description copied from interface: MutableChangeSet
      Adds new entity records to change set.
      Specified by:
      addAllEntityRecords in interface MutableChangeSet
    • getRelationChanges

      public Map<String,RelationChanges> getRelationChanges()
      Description copied from interface: ChangeSet
      Gets immutable map with all relation changesets.
      Specified by:
      getRelationChanges in interface ChangeSet
      Returns:
      map of relation changes where key is the relation name and value RelationChanges object
    • putRelationChanges

      public void putRelationChanges(String relationName, RelationChanges changeSet)
      Description copied from interface: MutableChangeSet
      Adds new relation changes for the given relation type.
      Specified by:
      putRelationChanges in interface MutableChangeSet
      Parameters:
      relationName - Name of relation
      changeSet - Relation changes
    • getRelationChangesForRelation

      public RelationChanges getRelationChangesForRelation(String relationName)
      Description copied from interface: MutableChangeSet
      Gets relation changes for single relation type identified by name.
      Specified by:
      getRelationChangesForRelation in interface MutableChangeSet
      Parameters:
      relationName - Name of relations
    • sortEntityRecords

      public void sortEntityRecords()
      Description copied from interface: MutableChangeSet
      Sorts collection of entity records by PK.
      Specified by:
      sortEntityRecords in interface MutableChangeSet
    • groupOrderInformation

      public void groupOrderInformation()
      Description copied from interface: MutableChangeSet
      Group together information about order (position) where possible.
      Specified by:
      groupOrderInformation in interface MutableChangeSet
    • sortAll

      public void sortAll()
      Description copied from interface: MutableChangeSet
      Sorts collection of entity records and relation records by PK.
      Specified by:
      sortAll in interface MutableChangeSet
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setJaloWayRecommended

      public void setJaloWayRecommended(boolean jaloWayRecommended)
      Description copied from interface: MutableChangeSet
      Sets 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:
      setJaloWayRecommended in interface MutableChangeSet
      Parameters:
      jaloWayRecommended - jaloWayRecommended flag
    • finish

      public void finish()
      Specified by:
      finish in interface MutableChangeSet
    • isJaloWayRecommended

      public boolean isJaloWayRecommended()
      Description copied from interface: ChangeSet
      Provides info, if jalo way is recommended (instead of direct persistence)
      Specified by:
      isJaloWayRecommended in interface ChangeSet
      Returns:
      true, if jalo way is recommended, false by default (direct persistence)
    • withAdded

      public ChangeSet withAdded(ChangeSet otherChangeSet)
      Description copied from interface: ChangeSet
      Creates a new ChangeSet that contains the sum of EntityRecords and RelationChanges from this ChangeSet and otherChangeSet
      Specified by:
      withAdded in interface ChangeSet
      Returns:
      new ChangeSet containing changes from this ChangeSet and otherChangeSet
    • allowEmptyUpdate

      public boolean allowEmptyUpdate()
      Description copied from interface: ChangeSet
      Allows empty updates (by default) or not.
      Specified by:
      allowEmptyUpdate in interface ChangeSet
      Returns:
      true, if empty updates are allowed (by default), false otherwise