-->
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: Collection mapping unidirectional on a single column?
PostPosted: Wed May 19, 2010 4:02 pm 
Newbie

Joined: Mon Apr 23, 2007 2:07 pm
Posts: 1
Considering the example situation below:

Table structure:
Code:
Person (id, first_name, last_name, ssn)
Person_Address (person_id, address_id)
Address (id, street, city, state, zip, type)


Class structure:
Code:
public class Person (id, firstName, lastName, ssn, streetAddressesOnly)
public class Address(id, street, city, state, zip, type)


I'm not sure if it is possible to from the Person class get a collection (set) or street addresses ONLY. I do not want to bring back then entire Address but only the street column in the collection when I load a Person. Can someone explain how I can do this? I think might have to use the <set> with an <element> but I have no idea how to do this via the Person_Address join table.


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.