Project Wonder 5.0

er.extensions.eof
Class ERXEntityFKConstraintOrder

java.lang.Object
  extended by er.extensions.eof.ERXEntityOrder
      extended by er.extensions.eof.ERXEntityFKConstraintOrder

public class ERXEntityFKConstraintOrder
extends ERXEntityOrder

Creates ordering based on foreign key dependencies.

Author:
chill

Nested Class Summary
 
Nested classes/interfaces inherited from class er.extensions.eof.ERXEntityOrder
ERXEntityOrder.EntityDeleteOrderComparator, ERXEntityOrder.EntityInsertOrderComparator
 
Field Summary
 
Fields inherited from class er.extensions.eof.ERXEntityOrder
allEntities, groupedEntities
 
Constructor Summary
ERXEntityFKConstraintOrder()
          Convenience constructor for implementing classes.
ERXEntityFKConstraintOrder(com.webobjects.eoaccess.EOModelGroup modelGroup)
          Designated constructor for implementing classes.
 
Method Summary
protected  com.webobjects.foundation.NSDictionary dependenciesByEntity()
          Processes the list of entities, creating the ordering dictionary based on foreign key constraints.
protected  java.lang.String dependencyKeyFor(com.webobjects.eoaccess.EOEntity entity)
          This implementation returns entity.externalName() as the dependcy is actually on tables not EOEntities .
protected  com.webobjects.foundation.NSMutableSet entitiesDependentOn(com.webobjects.foundation.NSMutableDictionary dependencies, com.webobjects.eoaccess.EOEntity entity)
          Returns the list of the names of the entities that reference (depend on) this entity.
protected  boolean hasForeignKeyConstraint(com.webobjects.eoaccess.EORelationship relationship)
           
 
Methods inherited from class er.extensions.eof.ERXEntityOrder
allEntities, createListOfEntities, dependentEntities, generateOrdering, groupedEntities, hasDependenciesForEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXEntityFKConstraintOrder

public ERXEntityFKConstraintOrder(com.webobjects.eoaccess.EOModelGroup modelGroup)
Designated constructor for implementing classes.

Parameters:
modelGroup - EOModelGroup to get list of all entities from

ERXEntityFKConstraintOrder

public ERXEntityFKConstraintOrder()
Convenience constructor for implementing classes. Uses EOModelGroup.defaultGroup().

Method Detail

dependenciesByEntity

protected com.webobjects.foundation.NSDictionary dependenciesByEntity()
Processes the list of entities, creating the ordering dictionary based on foreign key constraints.

Specified by:
dependenciesByEntity in class ERXEntityOrder
Returns:
a dictionary keyed on dependencyKeyFor(EOEntity)

hasForeignKeyConstraint

protected boolean hasForeignKeyConstraint(com.webobjects.eoaccess.EORelationship relationship)
Parameters:
relationship - EORelationship to test
Returns:
true if relationship models a relation that will have a foreign key constraint in the database

dependencyKeyFor

protected java.lang.String dependencyKeyFor(com.webobjects.eoaccess.EOEntity entity)
This implementation returns entity.externalName() as the dependcy is actually on tables not EOEntities .

Overrides:
dependencyKeyFor in class ERXEntityOrder
Parameters:
entity - EOEntity to return key into dependency dictionary for
Returns:
key for entity into dependency dictionary returned by dependenciesByEntity()

entitiesDependentOn

protected com.webobjects.foundation.NSMutableSet entitiesDependentOn(com.webobjects.foundation.NSMutableDictionary dependencies,
                                                                     com.webobjects.eoaccess.EOEntity entity)
Returns the list of the names of the entities that reference (depend on) this entity. This list is populated by builddependencyList(). If builddependencyList() has not finished executing, the list returned by this method may not be complete.

Parameters:
dependencies - list of dependencies being built by builddependencyList()
entity - EOEntity to return list of referencing entities for
Returns:
list of names of entities previously recorded as referencing this entity

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.