-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Bug? Middlegen: Same Name in Many2Many and One2Many
PostPosted: Sat Jan 31, 2004 4:12 pm 
Newbie

Joined: Thu Jan 22, 2004 5:52 pm
Posts: 6
Location: Xalapa, Ver, Mexico
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...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 01, 2004 8:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I not not sure you can though you maybe able to get this to work (obviously I have not tried) using the crossref nested tag for the table element. See http://boss.bekk.no/boss/middlegen/ant/table.html.


Top
 Profile  
 
 Post subject: CrossRef does not fixit :'(
PostPosted: Mon Feb 02, 2004 9:23 am 
Newbie

Joined: Thu Jan 22, 2004 5:52 pm
Posts: 6
Location: Xalapa, Ver, Mexico
Hi!
Tried the CrossRef, didn't fixit... any other ideas? :'(


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 02, 2004 8:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The source for Middlegen (including the Hibernate plugin) is found on SourceForge. See what you can do and send me the results. The relationships are Middlegen core where are no hooks (unlike Tables or columns) for the plugins to manipulate them. Extensions in this area would be very helpful (I know since it would make setting cascading options and the like much easier).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.