|
Project Wonder 5.0.0.8795 | |||||||||
| 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 abd 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.
| 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 |
|---|
EOModelGroup.ClassDelegate, EOModelGroup.Delegate |
| Field Summary | |
|---|---|
protected NSArray<String> |
_modelLoadOrder
er.extensions.ERXModelGroup.modelLoadOrder defines the load order of the models. |
protected NSArray<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 String |
LANGUAGES_KEY
Key for languages, can be either in properties or in the model object's user info. |
static Logger |
log
logging support |
static String |
ModelGroupAddedNotification
Nofitication 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. |
| Constructor Summary | |
|---|---|
ERXModelGroup()
Default public constructor |
|
| Method Summary | |
|---|---|
static int |
_enumForKey(String key)
|
static boolean |
_isKeyEnumOverriden(EOAttribute att,
int key)
|
static Object |
_keyForEnum(int key)
|
static NSArray |
_prototypeKeys()
|
void |
addModel(EOModel eomodel)
This implementation will load models that have entity name conflicts, removing the offending entity. |
EOModel |
addModelWithPathURL(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 NSDictionary |
databaseConfigForModel(EOModel model)
|
int |
entityCode(EOEntity entity)
Looks up the userInfo for the Entity with the specified entityName and returns it if the code could be found. |
int |
entityCode(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(EOModel model)
|
protected void |
fixJDBCDictionary(EOModel model)
|
protected void |
fixJNDIDictionary(EOModel model)
Similar to fixJDBCDictionary, but for JNDI EOModels. |
protected void |
fixOpenBaseDictionary(EOModel model)
|
protected void |
fixOracleDictionary(EOModel model)
|
static boolean |
isPrototypeEntity(EOEntity entity)
Returns whether or not the given entity is a prototype. |
static boolean |
isPrototypeEntityName(String entityName)
Returns whether or not the given entity name is a prototype entity |
boolean |
isPrototypeModel(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(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(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 String |
prototypeEntityNameForModel(EOModel model)
|
void |
resetConnectionDictionaryInModel(EOModel model)
Resets the connection dictionary to the specified values that are in the defaults. |
static String |
sqlDumpDirectory()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static Logger log
public static final String LANGUAGES_KEY
protected static 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 boolean flattenPrototypes
er.extensions.ERXModelGroup.flattenPrototypes defines if the prototypes should get flattened. Default is true.
protected NSArray<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 NSArray<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 String ModelGroupAddedNotification
| Constructor Detail |
|---|
public ERXModelGroup()
| Method Detail |
|---|
public void loadModelsFromLoadedBundles()
public void addModel(EOModel eomodel)
addModel in class EOModelGroupeomodel - model to be addedpublic static String sqlDumpDirectory()
public EOModel addModelWithPathURL(URL url)
addModelWithPathURL in class EOModelGrouppublic void checkForMismatchedJoinTypes()
public void checkInheritanceRelationships()
public int entityCode(String ename)
ename - the name from the Entity for which we want to the get entityCode
public int entityCode(EOEntity entity)
entity - the Entity for which we want to the get entityCode
public static boolean patchModelsOnLoad()
public static boolean isPrototypeEntity(EOEntity entity)
entity - the entity to check
public static boolean isPrototypeEntityName(String entityName)
public void modelAddedHandler(NSNotification n)
n - notification posted when a model is loaded. The object is the model.protected void fixOracleDictionary(EOModel model)
protected void fixFlatDictionary(EOModel model)
protected void fixOpenBaseDictionary(EOModel model)
protected void fixJNDIDictionary(EOModel model)
model - the JNDI EOModel to fixprotected void fixJDBCDictionary(EOModel model)
public boolean isPrototypeModel(EOModel model)
model - public void resetConnectionDictionaryInModel(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 String prototypeEntityNameForModel(EOModel model)
protected static NSDictionary databaseConfigForModel(EOModel model)
protected void preloadERXConstantClassesForModel(EOModel model)
model - the model to load constants for
IllegalArgumentException - if the ERXConstantClassName cannot be resolved.protected void modifyModelsFromProperties()
public static NSArray _prototypeKeys()
public static Object _keyForEnum(int key)
public static int _enumForKey(String key)
public static boolean _isKeyEnumOverriden(EOAttribute att,
int key)
|
Last updated: Fri, Jan 9, 2009 04:35 AM EST | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||