From: Lachlan D. <lac...@gm...> - 2009-03-13 01:14:38
|
Okay - I believe I've got it working. It may well be that the problem was either a) related to ERXModelGroup $Model not being in com.webobjects.eoaccess or b) flattening of the prototypes when patching models is true did something weird. Not sure. Here's my properties: er.extensions.defaultModelGroupClassName=ish.wonder.ISHModelGroup er.extensions.ERXModelGroup.patchModelsOnLoad=false er .extensions .ERXModelGroup.prototypeModelNames=ISHEOPrototypes,erprototypes I've copied these two methods into my EOModel subclass from ERXModelGroup$Model (along with the private methods they refer to): /** * Overridden to use our prototype creation method. */ @Override public EOAttribute prototypeAttributeNamed(String name) { synchronized (_EOGlobalModelLock) { if (_prototypesByName == null) { createPrototypes(); } } return super.prototypeAttributeNamed(name); } /** * Overridden to use our prototype creation method. */ @Override public NSArray availablePrototypeAttributeNames() { synchronized (_EOGlobalModelLock) { if (_prototypesByName == null) { createPrototypes(); } } return super.availablePrototypeAttributeNames(); } and also fixed the code as mentioned before in createPrototypes: private void createPrototypes() { log.info("Creating prototypes for model: " + name() + "->" + connectionDictionary()); synchronized (_EOGlobalModelLock) { <...> addAttributesToPrototypesCache (_group.entityNamed("EOCustomPrototypes")); addAttributesToPrototypesCache(_group.entityNamed("EO" + adaptorName() + "CustomPrototypes")); if (plugin != null) { addAttributesToPrototypesCache(_group.entityNamed("EOJDBC" + plugin + "CustomPrototypes")); } addAttributesToPrototypesCache(_group.entityNamed("EO" + name + "Prototypes")); addAttributesToPrototypesCache(_group.entityNamed("EO" + adaptorName() + name + "Prototypes")); if (plugin != null) { addAttributesToPrototypesCache(_group.entityNamed("EOJDBC" + plugin + name + "Prototypes")); } } } with regards, -- Lachlan Deck |