-->
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: two lists with same entity
PostPosted: Wed Jul 25, 2007 2:13 am 
Newbie

Joined: Tue May 29, 2007 6:23 pm
Posts: 11
Hi,
Is there a way to load two lists of the same entity using some annotation or attribute of an annotation? The propblem is like this:

class A {
List<B> TypeCBlist;
List<B> TypeDBlist;
}

class B {
Type type;
enum Type {
C,
D;
]
}

both lists are lazily load.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 25, 2007 4:13 am 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
Just map it the usual way. I guess that you have two FK Relationships in your Database as well.

_________________
Please don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 25, 2007 8:21 am 
Newbie

Joined: Tue May 29, 2007 6:23 pm
Posts: 11
Entity B has table TABLE_B and Entity A has table TABLE_A, TABLE_B has a FK to TABLE_A, so parent table has no FKs. Maybe a solution can be to subclass B as C and D and have lists of subclasses but it does not make sense to make subclass just for the sake of loading problem for me, any thoughts ?


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.