-->
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: Question about hibernate mapping
PostPosted: Tue Jan 30, 2007 7:36 pm 
Newbie

Joined: Tue Jan 30, 2007 7:24 pm
Posts: 1
Hi

I have 2 tables Employee and Employee_Group. 1 employee can belong to only one employee_group and an employee_group may have multiple employees.

Both these tables have employee_id as their primary key. Since I am new to hibernate, I wanted suggestions on how I can map these relations to get a set of employees on the employee_group class that belong to the same group while avoiding a circular relation.

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 9:07 am 
Expert
Expert

Joined: Tue Jan 30, 2007 12:45 am
Posts: 283
Location: India
Hi rimjhim,

Try this way

Employ{
private EmployGroup employGroup;

public setEmployGroup
public get EmployGroup
}


EmployGroup{
private List<Employ> employList;

public setEmployList
public get EmployList

}


use Bag in HBM For employList

_________________
Dharmendra Pandey


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.