-->
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.  [ 3 posts ] 
Author Message
 Post subject: Can collections be mapped inside a collection in hibernate?
PostPosted: Wed Sep 23, 2009 11:33 am 
Regular
Regular

Joined: Fri May 22, 2009 4:50 am
Posts: 59
Hi,

Is it possible to map collections like map, arrays, list, set etc. inside a map?
Why not? as Java language doesn't restict us to define such objects. for eg.
a class A, having a Map each of whose elements have a list.
class A{
Map<key, Class B>
}

where
Class B{
List Class C;
}

How is one supposed to map such a scenario??

Any help appreciated.

Thanks


Top
 Profile  
 
 Post subject: Re: Can collections be mapped inside a collection in hibernate?
PostPosted: Thu Sep 24, 2009 12:35 pm 
Newbie

Joined: Tue Jan 06, 2009 5:03 am
Posts: 7
class A{
@OneToMany(mapptoclass=B)
Map<key, Class B>
}

where
Class B{
@OneToMany(mapptoclass=C)
List Class C;
}

It will work.


Top
 Profile  
 
 Post subject: Re: Can collections be mapped inside a collection in hibernate?
PostPosted: Fri Sep 25, 2009 5:08 am 
Regular
Regular

Joined: Fri May 22, 2009 4:50 am
Posts: 59
Hi,

Thanks for your reply but I still quite didnt get it.

Can you please show me hibernate mapping of an array or list inside a map?

Thanks


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