-->
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: Defined Association for Get Only
PostPosted: Thu Jan 06, 2011 7:36 pm 
Regular
Regular

Joined: Tue Nov 30, 2004 4:23 pm
Posts: 62
How do I define an association between one object to another where I only want to use that relationship for getting the object graph, but when I do update/inserts, I only want to store the FK and not insert an instance of the associated class.

class Person
Long id;
Set<Phone> phones;

class Phone
Long id;
String number;
String ext;

I want to define the association from Person to Phones, so that I can say getPerson and it retrieves a collection of Phones. However, when I submit a Person with a Collection of updated/inserted Phones, I only want to update the Person table column with the foreign key for Phone, but I don't want to update/insert the Phone.

Thanks...jay


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