Discussion:
[Middlegen-user] Hibernate organize hbm.xml per schema
Ivan Hernández Serrano
2004-08-27 17:01:06 UTC
Permalink
Hi, I'm using middlegen-2.0-vo and the
middlegen-hibernate-plugin-2.0-vo.jar, to generate my hbm.xml mappings
from my db... now, I have several schemas in my database, is there any
way to tell either the middlegen or plugin how to organize the hbm.xml
files. If I have the schemas A, B and C, I would like to get three
directories A, B and C and the corresponding hbm.xml files in them.

thanks in advance
ivan
Eivind Waaler
2004-08-29 12:57:09 UTC
Permalink
I think the easiest way to accomplish this would be to call Middlegen
three times, once for each schema. Each of these would have its own
Hibernate subtask, that can generate to different packages or even
different directories.

Something like this:

<target name=3D"middlegen"...
<taskdef name=3D"middlegen"...
<middlegen
...
schema=3D"A">
<hibernate destination=3D"A" package=3D"a".../>
</middlegen>
<middlegen
...
schema=3D"B">
<hibernate destination=3D"B" package=3D"b".../>
</middlegen>
<middlegen
...
schema=3D"C">
<hibernate destination=3D"C" package=3D"c".../>
</middlegen>
</target>

Cheers
=2Eeivind
Post by Ivan Hernández Serrano
Hi, I'm using middlegen-2.0-vo and the
middlegen-hibernate-plugin-2.0-vo.jar, to generate my hbm.xml mappings
from my db... now, I have several schemas in my database, is there any
way to tell either the middlegen or plugin how to organize the hbm.xml
files. If I have the schemas A, B and C, I would like to get three
directories A, B and C and the corresponding hbm.xml files in them.
thanks in advance
ivan
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=3D5047&alloc_id=3D10808&op=3Dclick
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Loading...