PATH Documentation > WebObjects

Table of Contents

EOModelGroup.Delegate


Package:
com.webobjects.eoaccess

Interface Description


An EOModelGroup object should have a delegate which can influence how it finds and loads models. The EOModelGroup instance delegate can implement the methods below:

In addition to the delegates you assign to EOModelGroup instances, the EOModelGroup class itself can have a delegate. The class delegate implements a single method-defaultModelGroup. For more information, see the EOModelGroup.ClassDelegate interface description.



Instance Methods



classForObjectWithGlobalID

public abstract Class classForObjectWithGlobalID( EOEntity entity, com.webobjects.eocontrol.EOGlobalID globalID)

Used to fine-tune inheritance. The delegate can use globalID to determine a subclass to be used in place of the one specified in entity.

entityFailedToLookupClassNamed

public abstract Class entityFailedToLookupClassNamed( EOEntity entity, String className)

Invoked when the class name specified for entity cannot be found at run-time. The delegate can take action (such as loading a bundle) to provide entity with a class corresponding to className. If the delegate cannot provide anything, or if there is no delegate, EOGenericRecord is used.

entityRelationshipForRow

public abstract EORelationship entityRelationshipForRow( EOEntity entity, NSDictionary row, EORelationship relationship)

Invoked when relationships are instantiated for a newly fetched object. The delegate can use the information in row to determine which entity the target enterprise object should be associated with, and replace the relationship appropriately.

modelGroupEntityWithName

public abstract EOModel modelGroupEntityWithName( EOModelGroup group, String name)

If implemented by the delegate, this method should search the group for the entity named name and return the entity's EOModel. Returns null if name is not an entity in group.

relationshipFailedToLookupDestinationWithName

public abstract EOEntity relationshipFailedToLookupDestinationWithName( EORelationship relationship, String entityName)

Invoked when loading relationship and the destination entityName specified in the model file cannot be found in the model group. This most often occurs when a model references entities in another model file that can't be found. If the delegate doesn't implement this method, an exception is raised. If the delegate does implement this method, the method's return value is set as the destination entity. if the delegate returns null, the destination entity is set to null.

subEntityForEntity

public abstract EOEntity subEntityForEntity( EOEntity entity, NSDictionary primaryKey)

Allows the delegate to fine-tune inheritance by indicating from which sub-entity an object should be fetched based on its primaryKey. The entity returned must be a sub-entity of entity.



© 2001 Apple Computer, Inc. (Last Published April 13, 2001)


Table of Contents