-->
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 relationship
PostPosted: Wed May 19, 2010 11:25 pm 
Newbie

Joined: Mon Jul 09, 2007 9:32 am
Posts: 17
If I have an object like below, People has many-to-many relationship with Project, I want to achieve these functions:

1. when saving a new People, don't save ProjectList and its relationship.
2. when updating a People, don't update ProjectList and its relationship.
3. when deleting a People, delete People and its relationship, but keep Project object
4. when searching with HQL, like normal class, its inner join should be working.

In conclusion, the key difference is in saving-new and updating. how to achieve this ?

Thanks.

Code:
class People{
    String name;
   List<Project> projectList;
}


Top
 Profile  
 
 Post subject: Re: many-to-many relationship
PostPosted: Thu May 20, 2010 12:59 am 
Regular
Regular

Joined: Wed Apr 25, 2007 11:44 pm
Posts: 59
not sure

but you need to try http://docs.jboss.org/hibernate/core/3. ... nents.html


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.