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: List withou index column in one-to-many relation
PostPosted: Thu Feb 08, 2007 2:16 pm 
Newbie

Joined: Wed Feb 07, 2007 7:42 am
Posts: 13
Location: Spain
Hello,

I have got two tables in myDataBase, with a relation one-to-many (Parent/Child).

In my class Parent, I have an attribute, called childrens, which is the type List<Child>.

I want use hibernate, and load all the childrens in the attribute, but I don't have any column index in the table CHILD.

How can I create an artifical index?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 08, 2007 3:00 pm 
Newbie

Joined: Wed Feb 07, 2007 6:05 pm
Posts: 10
You can do that with a Set instead of a List. Since both implement the Collection interface you can iterate through a set just like a list. The default java object that implements the Set interface is HashSet.


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.