On 14/07/2008, at 7:17 PM, Paul Hoadley wrote:
Assume that I _can't_ re-write the old models against ERPrototypes (I probably could, but that's a bridge I'd rather cross later). Is it possible to (perhaps programmatically) declare prototypes model-by-model? That is, can I tell EOF to use ERPrototypes for the model in the Wonder application, and my own prototypes for the models in the older, non-Wonder framework?
I discovered the er.extensions.ERXModelGroup.prototypeModelNames property. So it seems this is _sufficient_ to solve the problem I described:
er.extensions.ERXModelGroup.prototypeModelNames=Prototypes,erprototypes
I still see basically the same error logged (though now the models are loading in the order specified above, so in reverse to my first attempt):
Jul 14 20:57:47 RM[54321] (ERXModelGroup.java:109) WARN er.extensions.ERXModelGroup - Clearing previous class descriptions
Jul 14 20:57:48 RM[54321] (ERXModelGroup.java:778) WARN er.extensions.ERXModelGroup - The EOModel 'Prototypes' does not have a connection dictionary, providing an empty one
Jul 14 20:57:48 RM[54321] (ERXEntityClassDescription.java:564) WARN er.extensions.ERXEntityClassDescription - Invalid class name for entity: EOJDBCPrototypes exception: java.lang.ClassNotFoundException: EOJDBCPrototypes using com.webobjects.eocontrol.EOGenericRecord instead
Jul 14 20:57:48 RM[54321] (ERXModelGroup.java:228) WARN er.extensions.ERXModelGroup - The model 'erprototypes' (path: file:/Library/Frameworks/ERPrototypes.framework/Resources/erprototypes.eomodeld) has an entity name conflict with the entities ("EOJDBCPrototypes") already in the model group <EOModelGroup ( ( Prototypes,
file:/Users/paulh/Projects/WebObjects/Eclipse/LSWOPrototypes/build/LSWOPrototypes.framework/Resources/Prototypes.eomodeld ) )>
I'm not sure precisely what's going on, though. Does ERXModelGroup merge the attributes in the two entities and use them all as prototypes now? What if there were attribute name collisions? Is having multiple prototype entities an acceptable approach, and if so, is this the canonical way to do it (in Wonder)? (Finally, if anyone is still reading, is this possible without Wonder?)