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
|