Package org.apache.cayenne.ashwood
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 SummaryFields Modifier and Type Field Description protected Map<DbEntity,org.apache.cayenne.ashwood.AshwoodEntitySorter.ComponentRecord>componentsprotected Comparator<DbEntity>dbEntityComparatorprotected EntityResolverentityResolverprotected Comparator<ObjEntity>objEntityComparatorprotected Map<DbEntity,List<DbRelationship>>reflexiveDbEntities
- 
Constructor SummaryConstructors Constructor Description AshwoodEntitySorter()
- 
Method SummaryModifier and Type Method Description protected voiddoIndexSorter()Reindexes internal sorter without synchronization.protected ObjectfindReflexiveMaster(Persistent object, ObjRelationship toOneRel, String targetEntityName)protected Comparator<DbEntity>getDbEntityComparator(boolean dependantFirst)protected Comparator<ObjEntity>getObjEntityComparator(boolean dependantFirst)protected voidindexSorter()Reindexes internal sorter in a thread-safe manner.protected booleanisReflexive(DbEntity metadata)voidsetEntityResolver(EntityResolver entityResolver)Sets EntityResolver for this sorter.voidsortDbEntities(List<DbEntity> dbEntities, boolean deleteOrder)Sorts a list of DbEntities.voidsortObjectsForEntity(ObjEntity objEntity, List<?> objects, boolean deleteOrder)Sorts a list of objects belonging to the ObjEntity.voidsortObjEntities(List<ObjEntity> objEntities, boolean deleteOrder)Sorts a list of ObjEntities.
- 
Field Details- 
entityResolver
- 
components
- 
reflexiveDbEntities
- 
dbEntityComparator
- 
objEntityComparator
 
- 
- 
Constructor Details- 
AshwoodEntitySorterpublic AshwoodEntitySorter()
 
- 
- 
Method Details- 
indexSorterprotected void indexSorter()Reindexes internal sorter in a thread-safe manner.
- 
doIndexSorterprotected void doIndexSorter()Reindexes internal sorter without synchronization.
- 
setEntityResolverDescription copied from interface:EntitySorterSets EntityResolver for this sorter. All entities present in the resolver will be used to determine sort ordering.- Specified by:
- setEntityResolverin interface- EntitySorter
- Since:
- 3.1
 
- 
sortDbEntitiesDescription copied from interface:EntitySorterSorts a list of DbEntities.- Specified by:
- sortDbEntitiesin interface- EntitySorter
 
- 
sortObjEntitiesDescription copied from interface:EntitySorterSorts a list of ObjEntities.- Specified by:
- sortObjEntitiesin interface- EntitySorter
 
- 
sortObjectsForEntityDescription copied from interface:EntitySorterSorts a list of objects belonging to the ObjEntity.- Specified by:
- sortObjectsForEntityin interface- EntitySorter
 
- 
findReflexiveMasterprotected Object findReflexiveMaster(Persistent object, ObjRelationship toOneRel, String targetEntityName)
- 
getDbEntityComparator
- 
getObjEntityComparator
- 
isReflexive
 
-