• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Firing Native Oracle Queries through hibernate

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
reply
    Bookmark Topic Watch Topic
  • New Topic