|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.map.AshwoodEntitySorter
public class AshwoodEntitySorter
Implements dependency sorting algorithms for ObjEntities, DbEntities and DataObjects. Presently it works for acyclic database schemas with possible multi-reflexive tables. The class uses topological sorting from the Ashwood library.
Field Summary | |
---|---|
protected Map |
components
|
protected org.objectstyle.ashwood.graph.Digraph |
contractedReferentialDigraph
|
protected Collection |
dataMaps
|
protected org.apache.cayenne.map.AshwoodEntitySorter.DbEntityComparator |
dbEntityComparator
|
protected Map |
dbEntityToTableMap
|
protected boolean |
dirty
|
protected org.apache.cayenne.map.AshwoodEntitySorter.ObjEntityComparator |
objEntityComparator
|
protected org.objectstyle.ashwood.graph.Digraph |
referentialDigraph
|
protected Map |
reflexiveDbEntities
|
protected org.apache.cayenne.map.AshwoodEntitySorter.TableComparator |
tableComparator
|
Constructor Summary | |
---|---|
AshwoodEntitySorter(Collection dataMaps)
|
Method Summary | |
---|---|
protected void |
_indexSorter()
Reindexes internal sorter. |
protected void |
fillInMetadata(org.objectstyle.ashwood.dbutil.Table table,
DbEntity entity)
|
protected Object |
findReflexiveMaster(Persistent object,
ObjRelationship toOneRel,
String targetEntityName)
|
protected Comparator |
getDbEntityComparator(boolean dependantFirst)
|
protected Comparator |
getObjEntityComparator(boolean dependantFirst)
|
protected org.objectstyle.ashwood.dbutil.Table |
getTable(DbEntity dbEntity)
|
protected org.objectstyle.ashwood.dbutil.Table |
getTable(ObjEntity objEntity)
|
protected boolean |
isReflexive(DbEntity metadata)
|
void |
setDataMaps(Collection dataMaps)
Initializes a list of DataMaps used by the sorter. |
void |
sortDbEntities(List dbEntities,
boolean deleteOrder)
Sorts a list of DbEntities. |
void |
sortObjectsForEntity(ObjEntity objEntity,
List objects,
boolean deleteOrder)
Sorts a list of objects belonging to the ObjEntity. |
void |
sortObjEntities(List objEntities,
boolean deleteOrder)
Sorts a list of ObjEntities. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Collection dataMaps
protected Map dbEntityToTableMap
protected org.objectstyle.ashwood.graph.Digraph referentialDigraph
protected org.objectstyle.ashwood.graph.Digraph contractedReferentialDigraph
protected Map components
protected Map reflexiveDbEntities
protected org.apache.cayenne.map.AshwoodEntitySorter.TableComparator tableComparator
protected org.apache.cayenne.map.AshwoodEntitySorter.DbEntityComparator dbEntityComparator
protected org.apache.cayenne.map.AshwoodEntitySorter.ObjEntityComparator objEntityComparator
protected boolean dirty
Constructor Detail |
---|
public AshwoodEntitySorter(Collection dataMaps)
Method Detail |
---|
protected void _indexSorter()
public void setDataMaps(Collection dataMaps)
EntitySorter
setDataMaps
in interface EntitySorter
public void sortDbEntities(List dbEntities, boolean deleteOrder)
EntitySorter
sortDbEntities
in interface EntitySorter
public void sortObjEntities(List objEntities, boolean deleteOrder)
EntitySorter
sortObjEntities
in interface EntitySorter
public void sortObjectsForEntity(ObjEntity objEntity, List objects, boolean deleteOrder)
EntitySorter
sortObjectsForEntity
in interface EntitySorter
protected void fillInMetadata(org.objectstyle.ashwood.dbutil.Table table, DbEntity entity)
protected Object findReflexiveMaster(Persistent object, ObjRelationship toOneRel, String targetEntityName)
protected Comparator getDbEntityComparator(boolean dependantFirst)
protected Comparator getObjEntityComparator(boolean dependantFirst)
protected org.objectstyle.ashwood.dbutil.Table getTable(DbEntity dbEntity)
protected org.objectstyle.ashwood.dbutil.Table getTable(ObjEntity objEntity)
protected boolean isReflexive(DbEntity metadata)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |