Create schema from EOModel programmatically
Stefan Apelt <[email protected]> Sun, 4 May 2003 09:50:28 +0200
| Newsgroups | gmane.comp.web.webobjects.eof |
|---|---|
| Message-ID | <[email protected]> |
We use prototypes in the EOModel to be able to switch our model to different databases at app start. There is, however, a "default" configuration in the model (Openbase), so you can open and edit it. Because the model is under development/reorganisation we quite often have to recreate the database schema for all tables to reflect the changes. (Losing data is not an issue at this point as the database is nearly empty anyway.) To do this you have to close EOModeler, replace the "EOPrototypes.plist" with a saved file for the target database and replace the connection dictionary entry in "index.eomodeld" with the right entry for the target database. Then you start EOModeler again and press the "Generate SQL" button. As we currently support four databases this starts to be a lot of work. During runtime, the replacement is done automatically, no problem. What bothers me is how to do this "Generate SQL" stuff during runtime. Has anyone tried to do this in a small management application? Where should I start? I guess it is possible using plain JDBC SQL commands but I have not done anything in that direction yet. Any pointers are highly appreciated. -- Regards, Stefan