|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.extensions.eof.ERXEntityOrder
public abstract class ERXEntityOrder
Abstract class defining an ordering of EOEntities that also provides NSComparators to sort entities based on this ordering. The ordering is based on groups of entities with entities within each group having no defined order.
This is implemented by creating a dictionary of entity name to group. Group 1 is entities with no dependencies. Group 2 is entities with
dependencies on entities in group 1. Group 3 is entities with dependencies on entities in groups 1 and 2. etc.
The dependencies between entities are determined by the abstract NSDictionary dependenciesByEntity()
.
Nested Class Summary | |
---|---|
static class |
ERXEntityOrder.EntityDeleteOrderComparator
NSComparator to sort on the ascending EOEntity group number from ordering.entityOrdering(). |
static class |
ERXEntityOrder.EntityInsertOrderComparator
NSComparator to sort on the descending EOEntity group number from ordering.entityOrdering(). |
Field Summary | |
---|---|
protected com.webobjects.foundation.NSArray |
allEntities
|
protected com.webobjects.foundation.NSMutableDictionary |
groupedEntities
|
Constructor Summary | |
---|---|
ERXEntityOrder()
Convenience constructor for implementing classes. |
|
ERXEntityOrder(com.webobjects.eoaccess.EOModelGroup modelGroup)
Designated constructor for implementing classes. |
Method Summary | |
---|---|
com.webobjects.foundation.NSArray |
allEntities()
|
void |
createListOfEntities(com.webobjects.eoaccess.EOModelGroup modelGroup)
Creates list of all entities (ecluding prototype entities) in all models in modelGroup . |
protected abstract com.webobjects.foundation.NSDictionary |
dependenciesByEntity()
Processes allEntities() and returns a dictionary keyed on
dependencyKeyFor(EOEntity) . |
protected java.lang.String |
dependencyKeyFor(com.webobjects.eoaccess.EOEntity entity)
This implementation returns entity.name() . |
protected com.webobjects.foundation.NSSet |
dependentEntities(com.webobjects.foundation.NSDictionary dependencies,
com.webobjects.eoaccess.EOEntity entity)
|
protected void |
generateOrdering()
Calls dependenciesByEntity() to determine dependencies and processes entities
in allEntities() to generate the groupedEntities() dictionary. |
com.webobjects.foundation.NSMutableDictionary |
groupedEntities()
Returns dictionary of group numbers ( java.lang.Integer ) to entity names. |
protected boolean |
hasDependenciesForEntity(com.webobjects.foundation.NSDictionary dependencies,
com.webobjects.eoaccess.EOEntity entity)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected com.webobjects.foundation.NSMutableDictionary groupedEntities
protected com.webobjects.foundation.NSArray allEntities
Constructor Detail |
---|
public ERXEntityOrder(com.webobjects.eoaccess.EOModelGroup modelGroup)
modelGroup
- EOModelGroup to get list of all entities frompublic ERXEntityOrder()
EOModelGroup.defaultGroup()
.
Method Detail |
---|
public com.webobjects.foundation.NSMutableDictionary groupedEntities()
java.lang.Integer
) to entity names.
Group 1 is entities with no dependencies. Group 2 is entities with
dependencies on entities in group 1. Group 3 is entities with
dependencies on entities in groups 1 and 2. etc
protected abstract com.webobjects.foundation.NSDictionary dependenciesByEntity()
allEntities()
and returns a dictionary keyed on
dependencyKeyFor(EOEntity)
. The keys are usually entity.name()
but are
not required to be. The value associated with each key is an NSSet of the
entity names that have a dependency on the key. This dictionary is used
to determine the dependency ordering.
protected void generateOrdering()
dependenciesByEntity()
to determine dependencies and processes entities
in allEntities()
to generate the groupedEntities()
dictionary.
protected boolean hasDependenciesForEntity(com.webobjects.foundation.NSDictionary dependencies, com.webobjects.eoaccess.EOEntity entity)
dependencies
- dictionary from dependenciesByEntity()
entity
- entity to check for dependencies
groupedEntities()
has all the entities named in dependentEntities(dependencies, entity)
.protected com.webobjects.foundation.NSSet dependentEntities(com.webobjects.foundation.NSDictionary dependencies, com.webobjects.eoaccess.EOEntity entity)
dependencies
- result from dependenciesByEntity()
entity
- EOEntity to return dependencies set for
protected java.lang.String dependencyKeyFor(com.webobjects.eoaccess.EOEntity entity)
entity.name()
.
entity
- EOEntity to return key into dependency dictionary for
entity
into dependency dictionary returned by dependenciesByEntity()
public void createListOfEntities(com.webobjects.eoaccess.EOModelGroup modelGroup)
modelGroup
.
modelGroup
- EOModelGroup to get list of all entities frompublic com.webobjects.foundation.NSArray allEntities()
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |