|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webobjects.eoaccess.EOModelGroup
er.extensions.eof.ERXModelGroup
public class ERXModelGroup
Enhanced model group that supports connection dict switching, definable and predictable model orderings and stackable prototypes. It also fixes some errors when loading prototypes and EOModeler backup files (Foo.emodeld~). The class is the meant to be the default model group and works in conjunction with ERXExtensions to set itself up on load.
You must use EOModelGroup.defaultGroup() and not EOModelGroup.globalModelGroup() because only the former will result in this class getting created.
Properties | |
EOPrototypesFileGLOBAL | EOPrototypesFileGLOBAL |
JNDI.global.authenticationMethod | JNDI.global.authenticationMethod |
JNDI.global.password | JNDI.global.password |
JNDI.global.plugin | JNDI.global.plugin |
JNDI.global.serverUrl | JNDI.global.serverUrl |
JNDI.global.username | JNDI.global.username |
dbConfigNameGLOBAL | dbConfigNameGLOBAL |
[MODEL_NAME].DBConfigName | [MODEL_NAME].DBConfigName |
dbConnectAdaptorGLOBAL | dbConnectAdaptorGLOBAL |
[MODEL_NAME].adaptor | [MODEL_NAME].adaptor |
dbConnectDatabaseGLOBAL | dbConnectDatabaseGLOBAL |
[MODEL_NAME].DBDatabase | [MODEL_NAME].DBDatabase |
dbConnectDriverGLOBAL | dbConnectDriverGLOBAL |
[MODEL_NAME].DBDriver | [MODEL_NAME].DBDriver |
dbConnectHostNameGLOBAL | dbConnectHostNameGLOBAL |
[MODEL_NAME].DBHostName | [MODEL_NAME].DBHostName |
dbConnectJDBCInfoGLOBAL | dbConnectJDBCInfoGLOBAL |
[MODEL_NAME].DBJDBCInfo | [MODEL_NAME].DBJDBCInfo |
dbConnectPasswordGLOBAL | dbConnectPasswordGLOBAL |
[MODEL_NAME].DBPassword | [MODEL_NAME].DBPassword |
[MODEL_NAME].password | [MODEL_NAME].password |
dbConnectPluginGLOBAL | dbConnectPluginGLOBAL |
[MODEL_NAME].DBPlugin | [MODEL_NAME].DBPlugin |
[MODEL_NAME].plugin | [MODEL_NAME].plugin |
dbConnectServerGLOBAL | dbConnectServerGLOBAL |
[MODEL_NAME].DBServer | [MODEL_NAME].DBServer |
dbConnectURLGLOBAL | dbConnectURLGLOBAL |
[MODEL_NAME].URL | [MODEL_NAME].URL |
[MODEL_NAME].serverUrl | [MODEL_NAME].serverUrl |
dbConnectUserGLOBAL | dbConnectUserGLOBAL |
[MODEL_NAME].DBUser | [MODEL_NAME].DBUser |
[MODEL_NAME].username | [MODEL_NAME].username |
dbConnectionRecycleGLOBAL | dbConnectionRecycleGLOBAL |
dbDebugLevelGLOBAL | dbDebugLevelGLOBAL |
dbEOPrototypesEntityGLOBAL | dbEOPrototypesEntityGLOBAL |
dbLogPathGLOBAL | dbLogPathGLOBAL |
dbMaxCheckoutGLOBAL | dbMaxCheckoutGLOBAL |
dbMaxConnectionsGLOBAL | dbMaxConnectionsGLOBAL |
dbMinConnectionsGLOBAL | dbMinConnectionsGLOBAL |
dbRemoveJdbc2InfoGLOBAL | dbRemoveJdbc2InfoGLOBAL |
er.extensions.ERXModelGroup.[ENTITY_NAME].[ATTRIBUTE_NAME].columnName | er.extensions.ERXModelGroup.[ENTITY_NAME].[ATTRIBUTE_NAME].columnName |
er.extensions.ERXModelGroup.[ENTITY_NAME].[ATTRIBUTE_NAME].ignoreTypeMismatch | er.extensions.ERXModelGroup.[ENTITY_NAME].[ATTRIBUTE_NAME].ignoreTypeMismatch |
er.extensions.ERXModelGroup.[ENTITY_NAME].externalName | er.extensions.ERXModelGroup.[ENTITY_NAME].externalName |
er.extensions.ERXModelGroup.flattenPrototypes | er.extensions.ERXModelGroup.flattenPrototypes |
er.extensions.ERXModelGroup.ignoreTypeMismatch | er.extensions.ERXModelGroup.ignoreTypeMismatch |
er.extensions.ERXModelGroup.modelClassName | er.extensions.ERXModelGroup.modelClassName |
er.extensions.ERXModelGroup.modelLoadOrder | NSArray.EmptyArray |
er.extensions.ERXModelGroup.patchModelsOnLoad | er.extensions.ERXModelGroup.patchModelsOnLoad |
er.extensions.ERXModelGroup.patchedModelClassName | er.extensions.ERXModelGroup.patchedModelClassName |
er.extensions.ERXModelGroup.prototypeModelName | er.extensions.ERXModelGroup.prototypeModelName |
er.extensions.ERXModelGroup.prototypeModelNames | er.extensions.ERXModelGroup.prototypeModelNames |
er.extensions.ERXModelGroup.raiseOnUnmatchingConnectionDictionaries, | true |
er.extensions.ERXModelGroup.sqlDumpDirectory | er.extensions.ERXModelGroup.sqlDumpDirectory |
[MODEL_NAME].DBConnectionRecycle | [MODEL_NAME].DBConnectionRecycle |
[MODEL_NAME].DBDebugLevel | [MODEL_NAME].DBDebugLevel |
[MODEL_NAME].DBLogPath | [MODEL_NAME].DBLogPath |
[MODEL_NAME].DBMaxCheckout | [MODEL_NAME].DBMaxCheckout |
[MODEL_NAME].DBMaxConnections | [MODEL_NAME].DBMaxConnections |
[MODEL_NAME].DBMinConnections | [MODEL_NAME].DBMinConnections |
[MODEL_NAME].EOPrototypesEntity | [MODEL_NAME].EOPrototypesEntity |
[MODEL_NAME].EOPrototypesFile | [MODEL_NAME].EOPrototypesFile |
[MODEL_NAME].authenticationMethod | [MODEL_NAME].authenticationMethod |
[MODEL_NAME].removeJdbc2Info | [MODEL_NAME].removeJdbc2Info |
Nested Class Summary | |
---|---|
static class |
ERXModelGroup.LocalizedAttributeProcessor
Processes ERXLanguages attributes. |
static class |
ERXModelGroup.Model
Extends models by model-specific prototypes. |
Nested classes/interfaces inherited from class com.webobjects.eoaccess.EOModelGroup |
---|
com.webobjects.eoaccess.EOModelGroup.ClassDelegate, com.webobjects.eoaccess.EOModelGroup.Delegate |
Field Summary | |
---|---|
protected com.webobjects.foundation.NSArray<java.lang.String> |
_modelLoadOrder
er.extensions.ERXModelGroup.modelLoadOrder defines the load order of the models. |
protected com.webobjects.foundation.NSArray<java.lang.String> |
_prototypeModelNames
er.extensions.ERXModelGroup.prototypeModelNames defines the names of the models that are prototypes. |
protected static boolean |
flattenPrototypes
er.extensions.ERXModelGroup.flattenPrototypes defines if the prototypes should get flattened. |
static java.lang.String |
LANGUAGES_KEY
Key for languages, can be either in properties or in the model object's user info. |
static org.apache.log4j.Logger |
log
logging support |
static java.lang.String |
ModelGroupAddedNotification
Notification that is sent when the model group was created form the bundle loading. |
protected static boolean |
patchModelsOnLoad
er.extensions.ERXModelGroup.patchModelsOnLoad is a boolean that defines is the created should be a ERXModelGroup.Model not a EOModel. |
Fields inherited from class com.webobjects.eoaccess.EOModelGroup |
---|
_delegate, _delegateRespondsTo_classForObjectWithGlobalID, _delegateRespondsTo_failedToLookupClassNamed, _delegateRespondsTo_relationshipFailedToLookupDestinationWithName, _delegateRespondsTo_relationshipForRow, _delegateRespondsTo_subEntityForEntity, _modelsByName, _subEntitiesCache, ModelAddedNotification, ModelInvalidatedNotification |
Constructor Summary | |
---|---|
ERXModelGroup()
Default public constructor |
Method Summary | |
---|---|
static int |
_enumForKey(java.lang.String key)
|
static boolean |
_isKeyEnumOverriden(com.webobjects.eoaccess.EOAttribute att,
int key)
|
static java.lang.Object |
_keyForEnum(int key)
|
static com.webobjects.foundation.NSArray |
_prototypeKeys()
|
void |
addModel(com.webobjects.eoaccess.EOModel eomodel)
This implementation will load models that have entity name conflicts, removing the offending entity. |
com.webobjects.eoaccess.EOModel |
addModelWithPathURL(java.net.URL url)
Overridden to use our model class in the runtime. |
void |
checkForMismatchedJoinTypes()
Looks for foreign key attributes that have a different type from the destination attribute. |
void |
checkInheritanceRelationships()
Corrects a strange EOF inheritance issue where if a model gets loaded and an entity that has children located in a different model that hasn't been loaded yet will not be setup correctly. |
protected static com.webobjects.foundation.NSDictionary |
databaseConfigForModel(com.webobjects.eoaccess.EOModel model)
|
int |
entityCode(com.webobjects.eoaccess.EOEntity entity)
Looks up the userInfo for the Entity with the specified entityName and returns it if the code could be found. |
int |
entityCode(java.lang.String ename)
Looks up the userInfo for the Entity with the specified entityName and returns it if the code could be found. |
protected void |
fixFlatDictionary(com.webobjects.eoaccess.EOModel model)
|
protected void |
fixJDBCDictionary(com.webobjects.eoaccess.EOModel model)
|
protected void |
fixJNDIDictionary(com.webobjects.eoaccess.EOModel model)
Similar to fixJDBCDictionary, but for JNDI EOModels. |
protected void |
fixOpenBaseDictionary(com.webobjects.eoaccess.EOModel model)
|
protected void |
fixOracleDictionary(com.webobjects.eoaccess.EOModel model)
|
static boolean |
isPrototypeEntity(com.webobjects.eoaccess.EOEntity entity)
Returns whether or not the given entity is a prototype. |
static boolean |
isPrototypeEntityName(java.lang.String entityName)
Returns whether or not the given entity name is a prototype entity |
boolean |
isPrototypeModel(com.webobjects.eoaccess.EOModel model)
Returns whether the given model is listed as a prototype model in the properties. |
void |
loadModelsFromLoadedBundles()
The only reason this method is needed is so our model group subclass is used. |
void |
modelAddedHandler(com.webobjects.foundation.NSNotification n)
Called when a model is loaded. |
protected void |
modifyModelsFromProperties()
Modifies various settings of the entities and attributes in this model group based on System properties. |
static boolean |
patchModelsOnLoad()
|
protected void |
preloadERXConstantClassesForModel(com.webobjects.eoaccess.EOModel model)
The classes referenced in the ERXConstantClassName field of an attribute's userInfo needs to be class-loaded before the attribute is used. |
static java.lang.String |
prototypeEntityNameForModel(com.webobjects.eoaccess.EOModel model)
|
void |
resetConnectionDictionaryInModel(com.webobjects.eoaccess.EOModel model)
Resets the connection dictionary to the specified values that are in the defaults. |
static java.lang.String |
sqlDumpDirectory()
|
Methods inherited from class com.webobjects.eoaccess.EOModelGroup |
---|
_addSubEntitiesCache, _childrenForEntityNamed, _registerChildForParent, addModelWithPath, classDelegate, defaultGroup, delegate, entitiesWithSharedObjects, entityForObject, entityNamed, fetchSpecificationNamed, globalModelGroup, loadAllModelObjects, modelGroupForObjectStoreCoordinator, modelNamed, modelNames, models, modelWithPath, modelWithPathURL, removeModel, setClassDelegate, setDefaultGroup, setDelegate, setModelGroupForObjectStoreCoordinator, storedProcedureNamed, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final org.apache.log4j.Logger log
public static final java.lang.String LANGUAGES_KEY
protected static final boolean patchModelsOnLoad
er.extensions.ERXModelGroup.patchModelsOnLoad
is a boolean that defines is the created should be a ERXModelGroup.Model
not a EOModel.
Default is false.
protected static final boolean flattenPrototypes
er.extensions.ERXModelGroup.flattenPrototypes
defines if the prototypes should get flattened. Default is true.
Note: the default of true may be incompatible with ERXModel#isUseExtendedPrototypesEnabled
.
protected com.webobjects.foundation.NSArray<java.lang.String> _prototypeModelNames
er.extensions.ERXModelGroup.prototypeModelNames
defines the names of the models that are prototypes. They
get put in front of the model load order. The default is erprototypes
protected com.webobjects.foundation.NSArray<java.lang.String> _modelLoadOrder
er.extensions.ERXModelGroup.modelLoadOrder
defines the load order of the models. When you use this property
the bundle loading will be disregarded. There is no default value.
public static final java.lang.String ModelGroupAddedNotification
Constructor Detail |
---|
public ERXModelGroup()
Method Detail |
---|
public void loadModelsFromLoadedBundles()
public void addModel(com.webobjects.eoaccess.EOModel eomodel)
addModel
in class com.webobjects.eoaccess.EOModelGroup
eomodel
- model to be addedpublic static java.lang.String sqlDumpDirectory()
public com.webobjects.eoaccess.EOModel addModelWithPathURL(java.net.URL url)
addModelWithPathURL
in class com.webobjects.eoaccess.EOModelGroup
public void checkForMismatchedJoinTypes()
public void checkInheritanceRelationships()
public int entityCode(java.lang.String ename)
ename
- the name from the Entity for which we want to the get entityCode
public int entityCode(com.webobjects.eoaccess.EOEntity entity)
entity
- the Entity for which we want to the get entityCode
public static boolean patchModelsOnLoad()
public static boolean isPrototypeEntity(com.webobjects.eoaccess.EOEntity entity)
entity
- the entity to check
public static boolean isPrototypeEntityName(java.lang.String entityName)
public void modelAddedHandler(com.webobjects.foundation.NSNotification n)
n
- notification posted when a model is loaded. The object is the model.protected void fixOracleDictionary(com.webobjects.eoaccess.EOModel model)
protected void fixFlatDictionary(com.webobjects.eoaccess.EOModel model)
protected void fixOpenBaseDictionary(com.webobjects.eoaccess.EOModel model)
protected void fixJNDIDictionary(com.webobjects.eoaccess.EOModel model)
model
- the JNDI EOModel to fixProperties | |
[modelName].serverUrl | the per-model server URL to set |
[modelName].user | the per-model username to set |
[modelName].password | the per-model password to set |
[modelName].authenticationModel | the per-model authenticationMethod to set |
JNDI.global.serverUrl | the global JNDI serverUrl to use by default |
JNDI.global.username | the global JNDI username to use by default |
JNDI.global.password | the global JNDI password to use by default |
JNDI.global.authenticationMethod | the global JNDI authenticationMethod to use by default |
protected void fixJDBCDictionary(com.webobjects.eoaccess.EOModel model)
public boolean isPrototypeModel(com.webobjects.eoaccess.EOModel model)
public void resetConnectionDictionaryInModel(com.webobjects.eoaccess.EOModel model)
<MODELNAME>.DBServer
<MODELNAME>.DBUser
<MODELNAME>.DBPassword
<MODELNAME>.URL (for JDBC)
if the serverName and username both exists, we overwrite the connection dict (password is optional). Otherwise we
fall back to what's in the model.
Likewise default values can be specified of the form:
dbConnectUserGLOBAL
dbConnectPasswordGLOBAL
dbConnectURLGLOBAL
model
- to be resetpublic static java.lang.String prototypeEntityNameForModel(com.webobjects.eoaccess.EOModel model)
protected static com.webobjects.foundation.NSDictionary databaseConfigForModel(com.webobjects.eoaccess.EOModel model)
protected void preloadERXConstantClassesForModel(com.webobjects.eoaccess.EOModel model)
model
- the model to load constants for
java.lang.IllegalArgumentException
- if the ERXConstantClassName cannot be resolved.protected void modifyModelsFromProperties()
Properties | |
er.extensions.ERXModelGroup.[entityName].externalName | change the table name for the given entityName |
er.extensions.ERXModelGroup.[entityName].[attributeName].columnName | change the column name for the given attribute |
public static com.webobjects.foundation.NSArray _prototypeKeys()
public static java.lang.Object _keyForEnum(int key)
public static int _enumForKey(java.lang.String key)
public static boolean _isKeyEnumOverriden(com.webobjects.eoaccess.EOAttribute att, int key)
|
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 |