-->
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.  [ 1 post ] 
Author Message
 Post subject: <many-to-many> reverse engineering
PostPosted: Fri Jun 05, 2009 5:08 am 
Newbie

Joined: Sat May 09, 2009 2:03 am
Posts: 14
I want to create a <many-to-many> relation mapping between 2 classes by using “Hibernate reverse engineering” thru MyEclipse 7.0 but I am not getting what should be the foreign key relationship between 2 database tables??I included Foreign Key in both tables but the generated POJO files are like this and also in mapping files <many-to-many> tag is not used instead <one-to-many>/<many-to-one> tags are used.

Code:
[b]Employee.java[/b]
Long empid;
String empname;
Department department; //According to me this should not be generated
Set departments;
//set()/get() methods


Code:
[b]Department.java[/b]
Long deptid;
String deptname;
Employee employee; //According to me this should not be generated
Set employees;


the database schema are
Employee table
EMPID(pk),EMPNAME,DEPTID(fk)

Department table
DEPTID(pk),DEPTNAME,EMPID(fk)

thanks,
Shivam


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.