Re: EO models referring to different prototypes in the same application
Re: EO models referring to different prototypes in the same application
- Subject: Re: EO models referring to different prototypes in the same application
- From: Mike Schrag <email@hidden>
- Date: Mon, 14 Jul 2008 08:57:31 -0400
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
No, this setting just makes sure these models load first, so it moves them up to the front of the model load order. 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 ) )>
If they both define the same entity name, there is nothing you can do. If you can rename the other entity, I believe ERPrototypes does NOT define "EOPrototypes," so you can rename it to that and at least have access to your other prototype attributes. If there are no attribute name collisions, this MIGHT be enough to make things work. If you DO have attribute name collisions, you might be able to use the <ModelName>.EOPrototypesEntity setting to specify the entity name of the prototypes entity for each model. This setting was designed to support, for instance, an Oracle and a FrontBase database in the same application, where all of the attribute names would overlap if you just use normal prototype loading -- it instead flattens the prototypes into the model at load time using the correct prototype entity. Does ERXModelGroup merge the attributes in the two entities and use them all as prototypes now?
EOF does this. What if there were attribute name collisions?
"Random" behavior unless you use the flattening stuff from above (Not actually random ... I forget if it's last or first wins, but ... don't do it). Is having multiple prototype entities an acceptable approach
Only if you use a prototype entity name that doesn't exist. EOF needs a more extensible prototype loading system, really. Wonder "uses up" EOJDBCPrototypes. It would be nice to be able to declare EOJDBCPrototype1,2,3,4, etc and have them all merged. (Finally, if anyone is still reading, is this possible without Wonder?)
Sure, in the sense that anything is possible without Wonder, but you're probably going to have to do something pretty similar to what Wonder is doing. You can always steal code from ERXModelGroup (.flattenPrototypes method).
ms |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden