-->
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: Criteria for recursive relation
PostPosted: Mon Aug 06, 2007 2:58 am 
Newbie

Joined: Fri Aug 03, 2007 9:35 am
Posts: 8
Hi,
is it possilble to build a criteria for recursive query?

For example I have a Person class and its property Boss (As Person, IdBoss column in the Person table). I need to find all my bosses in the tree structure or all people "under" me.

Is it possible to do this with criteria and hibernate???

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 06, 2007 4:55 am 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
I don't think this can be done in a single SQL statement unless you use a system where you keep a list of all parents in each entity. Normally people do it in a stored procedure.

Symon.


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.