• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Firing Native Oracle Queries through hibernate

 
Jaydeep Deshmukh
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I wish to fire the native oracle query through hibernate.

SELECT * FROM ASSET START WITH ASSET_ID=66 CONNECT BY ASSET_ID = PRIOR PARENT_ASSET_ID

Assuming you have a heirarchical structure of records in the ASSET table, the above query will get uppermost root of asset_id 66.

How do I run this query using hibernate. I tried to do so and ended up getting the following error:
expected in:START[ SELECT * FROM ASSET START WITH ASSET_ID=66 CONNECT BY ASSET_ID = PRIOR PARENT_ASSET_ID ]


Please help

Thanks in advance
Jaydeep
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've usually given up on figuring out the table aliases of Session#createSQLQuery() method and just asked the Session for a JDBC connection:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic