-->
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: Hibernate and Hierarchical Queries
PostPosted: Mon Oct 30, 2006 2:28 am 
Newbie

Joined: Sat Oct 28, 2006 1:57 pm
Posts: 6
Hi all


We are facing a problem on retreiving the results on hierarchical queries

We use hierarchical queries in our application . since hibernate does not support any of these queries we are firing native sql queries


This is our query
select pth_pty_party_id, PTH_PTY_PARENT_PARTY_ID, level
from party_hierarchy where PTH_HRC_SUBTREE_ID='H10'
start with pth_pty_party_id='110204'
connect by pth_pty_party_id = prior pth_pty_parent_party_id

Now the level selected is an oracle kyword and not a table column ...
Ths is what this query would return.

PTH_PTY_PARTY_ID PTH_PTY_PARENT_PARTY_ID LEVEL
---------------- ----------------------- ----------------------
110204 110203 1
110203 110202 2
110202 110201 3
110201 4


4 rows selected



How can we retrive the level value in our java code ... Since there is no mapping in our mapping fiile the resulting objects will contain values only for the columns mapped.

basically is there any equivalent for resultset in Hibernate ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 22, 2006 4:54 am 
Beginner
Beginner

Joined: Thu Aug 24, 2006 6:01 am
Posts: 49
Location: sophia-antipolis, France
read this blog for info on how to use ResultTransformers for HQL and SQL:

http://blog.hibernate.org/cgi-bin/blosxom.cgi/2006/03/17/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 12, 2007 10:54 am 
Newbie

Joined: Sat Oct 28, 2006 1:57 pm
Posts: 6
thanks a lot. That was indeed of great ehlp.


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.