Project Wonder 5.0

er.extensions.eof
Class ERXEntityClassDescription.Factory

java.lang.Object
  extended by er.extensions.eof.ERXEntityClassDescription.Factory
Enclosing class:
ERXEntityClassDescription

public static class ERXEntityClassDescription.Factory
extends java.lang.Object

This factory inner class is registered as the observer for three notifications: modelWasAdded, classDescriptionNeededForEntity and classDescriptionNeededForClass. If you wish to provide your own subclass of ERXEntityClassDescription then you need to create a subclass of Factory and set that class name in the system properties under the key: er.extensions.ERXClassDescription.factoryClass In your Factory subclass override the method: newClassDescriptionForEntity to provide your own ERXEntityClassDescription subclass.


Constructor Summary
ERXEntityClassDescription.Factory()
          Public constructor
 
Method Summary
 void checkForeignKeys(com.webobjects.eoaccess.EOEntity eoentity)
          Checks for foreign keys that are NOT NULL, but whose relationship is marked as non-mandatory and vice-versa.
 void classDescriptionNeededForClass(com.webobjects.foundation.NSNotification n)
          Method called by the NSNotificationCenter when a class description is needed for a given Class.
 void classDescriptionNeededForEntityName(com.webobjects.foundation.NSNotification n)
          Method called by the NSNotificationCenter when a class description is needed for a given entity.
protected  void handleMandatoryRelationshipError(com.webobjects.eoaccess.EOEntity eoentity, com.webobjects.eoaccess.EORelationship relationship, com.webobjects.eoaccess.EOAttribute attribute)
          Handles errors when a mandatory relationship has a source attribute that is set to not allow null values.
protected  void handleOptionalRelationshipError(com.webobjects.eoaccess.EOEntity eoentity, com.webobjects.eoaccess.EORelationship relationship, com.webobjects.eoaccess.EOAttribute attribute)
          Handles errors when an optional relationship has a source attribute that is set to allow null values.
protected  boolean isFixingRelationshipsEnabled()
           
protected  boolean isRapidTurnaroundEnabled()
           
 void modelGroupWasAdded(com.webobjects.foundation.NSNotification n)
          Method called when a model group did load.
 void modelWasAdded(com.webobjects.foundation.NSNotification n)
          Method called by the NSNotificationCenter when an EOModel is loaded.
protected  ERXEntityClassDescription newClassDescriptionForEntity(com.webobjects.eoaccess.EOEntity entity)
          Factory method that is used to create a new class description for a given entity.
protected  void prepareEntityForRegistration(com.webobjects.eoaccess.EOEntity eoentity)
          Allows for entities to be altered before they have a custom class description registered.
protected  void processModelGroup(com.webobjects.eoaccess.EOModelGroup group)
          Called when a model group finished loading.
protected  void registerDescriptionForClass(java.lang.Class class1)
          This method is called when a class description is needed for a particular class.
protected  void registerDescriptionForEntitiesInModel(com.webobjects.eoaccess.EOModel model)
          This method registers custom class descriptions for all of the entities in a given model.
protected  void registerDescriptionForEntity(com.webobjects.eoaccess.EOEntity entity)
          Registers a custom class description for the given entity using the method newClassDescriptionForEntity which can be overridden by subclasses to provide a different class description subclass.
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXEntityClassDescription.Factory

public ERXEntityClassDescription.Factory()
Public constructor

Method Detail

reset

public void reset()

isRapidTurnaroundEnabled

protected boolean isRapidTurnaroundEnabled()

isFixingRelationshipsEnabled

protected boolean isFixingRelationshipsEnabled()

modelGroupWasAdded

public final void modelGroupWasAdded(com.webobjects.foundation.NSNotification n)
Method called when a model group did load.


processModelGroup

protected void processModelGroup(com.webobjects.eoaccess.EOModelGroup group)
Called when a model group finished loading. Checks foreign keys by default. Override to to more...

Parameters:
group -

modelWasAdded

public final void modelWasAdded(com.webobjects.foundation.NSNotification n)
Method called by the NSNotificationCenter when an EOModel is loaded. This method just calls the method registerDescriptionForEntitiesInModel

Parameters:
n - notification that has the EOModel that was loaded.

classDescriptionNeededForEntityName

public void classDescriptionNeededForEntityName(com.webobjects.foundation.NSNotification n)
Method called by the NSNotificationCenter when a class description is needed for a given entity. Usually this method isn't needed seeing as we preempt the on demand loading of class descriptions by loading all of them when the EOModel is loaded. This method just calls the method registerDescriptionForEntity

Parameters:
n - notification that has the name of the entity that needs the class description.

classDescriptionNeededForClass

public void classDescriptionNeededForClass(com.webobjects.foundation.NSNotification n)
Method called by the NSNotificationCenter when a class description is needed for a given Class. Usually this method isn't needed seeing as we preempt the on demand loading of class descriptions by loading all of them when the EOModel is loaded. This method just calls the method registerDescriptionForClass

Parameters:
n - notification that has the Class object that needs a class description.

newClassDescriptionForEntity

protected ERXEntityClassDescription newClassDescriptionForEntity(com.webobjects.eoaccess.EOEntity entity)
Factory method that is used to create a new class description for a given entity. Sub classes that wish to provide a sub class of ERXEntityClassDescription should override this method to create that custom description. By default this method returns a new ERXEntityClassDescription.

Parameters:
entity - to create the class description for
Returns:
new class description for the given entity

prepareEntityForRegistration

protected void prepareEntityForRegistration(com.webobjects.eoaccess.EOEntity eoentity)
Allows for entities to be altered before they have a custom class description registered. Sub classes can override this method to provide any extra alterings before the description is registered. However be sure to call super as this method does convert the class name from EOGenericRecord to ERXGenericRecord, which unfortunately is required for custom validation to work at the moment.

Parameters:
eoentity - to be prepared for registration

handleOptionalRelationshipError

protected void handleOptionalRelationshipError(com.webobjects.eoaccess.EOEntity eoentity,
                                               com.webobjects.eoaccess.EORelationship relationship,
                                               com.webobjects.eoaccess.EOAttribute attribute)
Handles errors when an optional relationship has a source attribute that is set to allow null values. Subclasses can override this to do more specific handling.


handleMandatoryRelationshipError

protected void handleMandatoryRelationshipError(com.webobjects.eoaccess.EOEntity eoentity,
                                                com.webobjects.eoaccess.EORelationship relationship,
                                                com.webobjects.eoaccess.EOAttribute attribute)
Handles errors when a mandatory relationship has a source attribute that is set to not allow null values. Subclasses can override this to do more specific handling.


checkForeignKeys

public void checkForeignKeys(com.webobjects.eoaccess.EOEntity eoentity)
Checks for foreign keys that are NOT NULL, but whose relationship is marked as non-mandatory and vice-versa. This error is not checked by EOModeler, so we do it here.

Parameters:
eoentity - to be check

registerDescriptionForEntitiesInModel

protected void registerDescriptionForEntitiesInModel(com.webobjects.eoaccess.EOModel model)
This method registers custom class descriptions for all of the entities in a given model. This method is called when a model is loaded. The reason for this method is to preempt the usual class description loading mechanism which has a race condition involved for the order in which the notifications are recieved.

Parameters:
model - that contains all of the entities to be registerd

registerDescriptionForEntity

protected void registerDescriptionForEntity(com.webobjects.eoaccess.EOEntity entity)
Registers a custom class description for the given entity using the method newClassDescriptionForEntity which can be overridden by subclasses to provide a different class description subclass.

Parameters:
entity - to register the class description for

registerDescriptionForClass

protected void registerDescriptionForClass(java.lang.Class class1)
This method is called when a class description is needed for a particular class. Here we use the previous cache that we constructed of class to entity map when the models were loaded. In this way we can register all of the custom class descriptions for a given class if need be.

Parameters:
class1 - class object to have a custom class description registered for.

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

Copyright © 2002 – 2007 Project Wonder.