Re: Using prototypes with more than one EOModel and different databases
Chuck Hill <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.eof |
|---|---|
| Message-ID | <[email protected]> |
Hi Stefan, At 11:34 AM 02/12/2002 +0100, Stefan Apelt wrote: >Hi, > >I have two EOModels in a project that are used to maintain >user-specific and content-specific data. In one EOModel I have an >'EOPrototypes' entity that contains all prototypes for both models. > >Both models now connect to the same database but in the future, it >should be possible to connect to two different databases (say, mySQL >and FrontBase). Has anyone tried this and can tell how to handle the >prototypes thingy then? Changing the connection dictionary is not a >problem, it is the external types (varchar vs. TEXT) that I worry >about. > >I have a few guesses but wanted to ask first before reinventing the >wheel: > >1. It does not work. Stick with one database server. My idea for now. > Possibly the case. >2. Have one EOPrototype entity per EOModel. Might not work because of > a naming conflict in the EOModelGroup later. > I'm certain this will not work. I've tried it by accident. ;-) >3. Have separate EOModelGroups, each with one model. Might not work > with WO because it loves its defaultModelGroup best. > This should work as long as there are no unfortunate references to defaultModelGroup. I don't know if you can make cross model group relationships thought. >4. Another cool solution I have not seen yet... > Some other ideas off the top of my head: 1. Name the prototypes differently in each model (userLongString, contentLongString). This could be combined with the code to create the EOPrototypes Entity on the fly (from Jonathan Rochkind?) from a config file that was previously posted to the list. 2. Use public void setPrototype(EOAttribute prototype) on EOAttribute to set the prototypes manually. Chuck