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.  [ 4 posts ] 
Author Message
 Post subject: Map of Collections
PostPosted: Fri Mar 18, 2005 4:19 pm 
Regular
Regular

Joined: Wed Sep 10, 2003 2:26 pm
Posts: 56
Location: San Diego, CA
Hi,

I know that Hibernate doesn't handle nested collections. Can anyone recommend, then, how to map this relationship

TABLE payee
- payee_id (PK)

TABLE payment_detail
- detail_id (PK)
- payee_id (FK)
- payment_type


given I'd like to be able to do the following:

{
// ...
Payeee payee = // load payee by id ...
Set paymentsType1 = payee.getPaymentOfType(type1);
Set paymentsType2 = payee.getPaymentsOfType(type2);
}

the set of payment types is open ended.


Thanks
Dmitry


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 5:30 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
use a <map>?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 6:03 pm 
Regular
Regular

Joined: Wed Sep 10, 2003 2:26 pm
Posts: 56
Location: San Diego, CA
max wrote:
use a <map>?


I thought Hibernate did not allow Map<Set> (nested collections)? When I do try to use a map, the map value only contains a single object

<map name="paymentsByDos" table="pmnt_detail" access="field" >
<key column="ucsd_id"/>
<index column="dos_code" type="string"/>
<one-to-many class="edu.ucsd.som.onlinepayments.business.PaymentDetail"/>
</map>


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 20, 2005 6:16 pm 
Regular
Regular

Joined: Wed Sep 10, 2003 2:26 pm
Posts: 56
Location: San Diego, CA
a clarification please? thx


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.