-->
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.  [ 2 posts ] 
Author Message
 Post subject: Many to Many in MiddleGen
PostPosted: Thu Dec 23, 2004 12:08 pm 
Beginner
Beginner

Joined: Thu Jul 29, 2004 7:14 pm
Posts: 41
Hibernate version: 2.17

I have 2 tables : LOCATION and DEPARTMENT and they have many to many relationship with a table: LOCATION_DEPARTMENT.
I am trying to use MiddleGen to generate my mappings. When I use like this :

<table name="LOCATION"/>
<table name="DEPARTMENT"/>
<table name="LOCATION_DEPARTMENT"/>

it gives me all the relationships. But when I use like this :

<many2many>
<tablea name="LOCATION"/>
<jointable name="LOCATION_DEPARTMENT" generate="false"/>
<tableb name="DEPARTMENT"/>
</many2many>

it is not picking up the relationships. Any reason?

I tried with both MiddleGen 2.0 and 2.1 but its the same thing.

Thanks


This is my Ant task:

<!-- Teach Ant how to use MiddleGen -->
<taskdef name="middlegen"
classname="middlegen.MiddlegenTask"
classpathref="project.class.path"/>

<middlegen appname="timesystem"
prefsdir="C:\Example"
gui="true"
databaseurl="jdbc:microsoft:sqlserver://CERD1-DBS\CERD_DEV_DBS:1433;DatabaseName=wf_dev_sched_v215b1004"
driver="com.microsoft.jdbc.sqlserver.SQLServerDriver"
username="wf_dbo"
password="webflex"
schema="dbo">

<hibernate destination="build/gen-src"
package="com.pen.model"
javaTypeMapper="middlegen.plugins.hibernate.HibernateJavaTypeMapper">
</hibernate>

<many2many>
<tablea name="LOCATION"/>
<jointable name="LOCATION_DEPARTMENT" generate="false"/>
<tableb name="DEPARTMENT"/>
</many2many>

</middlegen>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 23, 2004 7:52 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
You may need to tell it to generate the tables as shown in the example and sample ant files, eg,

Code:
<many2many>
<tablea generate="true" name="LOCATION"/>
<jointable name="LOCATION_DEPARTMENT" generate="false"/>
<tableb generate="true" name="DEPARTMENT"/>
</many2many>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.