-->
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: Return level via sql query using Oracle CONNECt BY
PostPosted: Thu Nov 03, 2005 11:46 am 
Newbie

Joined: Wed Sep 07, 2005 11:37 am
Posts: 3
Location: Bristol
Hi all,

Im using Oracle 9i along with Hibernate in order to generate an organisation hierarchy.

I have created a native sql query using the Oracle CONNECT BY clause and it works fine through hibernate.
However, now I need the level attribute (or column or whatever) that can be called via the CONNECT BY statement to be returned via sqlQuery.list as well

As I have already said I'm accessing the db through a sqlQuery with .addEntity() pointing to an existing class. I can access the columns returned from the sqlQuery.list by name (as per the mapped hbm.xml file), but how do I access the level attribute (it is indeed currently part of the sql query i.e. SELECT level,a.* FROM whatever CONNECT BY...).

In other words (in case I haven't made myself clear yet), is it possible to return a value that's not explicitly part of the database table structure from a native sql query on that table , and if so, how? [some additional mapping perhaps?])

Any help will be greatly appreciated, (and credit given where due of course)

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.