Hi!
In
http://www.hibernate.org/159.html you can find good examples
of how to build applications using hibernate, and I was looking for an example project using Middlegen to generate hbms from the database, I found one there
and I was happy... but then I started doing experiments:
In that project inside the AntScript normally you have:
<middlegen
appname="Toolset"
prefsdir="${basedir}"
gui="true"
databaseurl="${db.url}"
driver="org.hsqldb.jdbcDriver"
username="SA">
<hibernate
destination="${gensrc.dir}"
package="org.hibernate.workshop.toolset"/>
</middlegen>
And i works great, but now, lets explicitly add the tables:
<table name="USER" singular="User" plural="Users"/>
<table name="ITEM" singular="Item" plural="Items"/>
<table name="BID" singular="Bid" plural="Bids"/>
after that it will continue to work, but if we add a Many2ManyRelationship
<many2many>
<tablea name="USER"/>
<jointable name="BID" generate="true"/>
<tableb name="ITEM"/>
</many2many>
The the User will have 2 relationships to Items, this, could happen for example, if a User sells some items (one to many) and buys others (many to many), but Middlegen seems unable to handle this...