-->
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: How to compose objects hierarchy using query
PostPosted: Thu Jan 06, 2011 7:33 pm 
Newbie

Joined: Thu Jan 06, 2011 7:05 pm
Posts: 3
Hi!

Let's say, I have 3 classes: A, B, C which have bidirectional OneToMany associations:
A.java
Code:
public class A{
private List<B> bList;
//... other code
}

B.java
Code:
public class B{
private List<C> cList;
private A aParent;
//... other code
}

C.java
Code:
public class C {
private Long cId;
private String cName;
private B bParent;
//... other code
}

I need to get proper hierarhy of objects, filtering only by some property of the C class.
Another words I need to get List<A> where every A instance contains only those B instances, which have only those C instances, that match specified query - I need something like "filtered in depth" query.
Could anyone explain me how to do this?

Thanks in advance.


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.