Class AshwoodEntitySorter

java.lang.Object
org.apache.cayenne.ashwood.AshwoodEntitySorter
All Implemented Interfaces:
EntitySorter
Direct Known Subclasses:
WeightedAshwoodEntitySorter

public class AshwoodEntitySorter
extends Object
implements EntitySorter
Implements dependency sorting algorithms for ObjEntities, DbEntities and DataObjects. Presently it works for acyclic database schemas with possible multi-reflexive tables.
Since:
3.1
  • Field Details

  • Constructor Details

    • AshwoodEntitySorter

      public AshwoodEntitySorter()
  • Method Details

    • indexSorter

      protected void indexSorter()
      Reindexes internal sorter in a thread-safe manner.
    • doIndexSorter

      protected void doIndexSorter()
      Reindexes internal sorter without synchronization.
    • setEntityResolver

      public void setEntityResolver​(EntityResolver entityResolver)
      Description copied from interface: EntitySorter
      Sets EntityResolver for this sorter. All entities present in the resolver will be used to determine sort ordering.
      Specified by:
      setEntityResolver in interface EntitySorter
      Since:
      3.1
    • sortDbEntities

      public void sortDbEntities​(List<DbEntity> dbEntities, boolean deleteOrder)
      Description copied from interface: EntitySorter
      Sorts a list of DbEntities.
      Specified by:
      sortDbEntities in interface EntitySorter
    • sortObjEntities

      public void sortObjEntities​(List<ObjEntity> objEntities, boolean deleteOrder)
      Description copied from interface: EntitySorter
      Sorts a list of ObjEntities.
      Specified by:
      sortObjEntities in interface EntitySorter
    • sortObjectsForEntity

      public void sortObjectsForEntity​(ObjEntity objEntity, List<?> objects, boolean deleteOrder)
      Description copied from interface: EntitySorter
      Sorts a list of objects belonging to the ObjEntity.
      Specified by:
      sortObjectsForEntity in interface EntitySorter
    • findReflexiveMaster

      protected Object findReflexiveMaster​(Persistent object, ObjRelationship toOneRel, String targetEntityName)
    • getDbEntityComparator

      protected Comparator<DbEntity> getDbEntityComparator​(boolean dependantFirst)
    • getObjEntityComparator

      protected Comparator<ObjEntity> getObjEntityComparator​(boolean dependantFirst)
    • isReflexive

      protected boolean isReflexive​(DbEntity metadata)