-->
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: beginner question: retrieve Object by Collection lookup
PostPosted: Mon Nov 06, 2006 4:25 pm 
Newbie

Joined: Mon Nov 06, 2006 4:14 pm
Posts: 1
This is the code:

@Entity class A{some fields and methods}
@Entity class B extends A{
String _name;
String getName(){...}
}
@Entity class C extends A{
ArrayList<B> _someB;
addB(B b){...}
}


class DaoForC{
List<C> findByB(String name){
//return all C that have a B in _someB
//with B._name=name
Query q = session.createQuery(???);
return q.list();
}
}

Question 1:
Any suggestions how to fill "???"?

Question 2:
What would be different in Answer to Question1, if class B does not extend A?


Thanks!


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.