• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

How to map returned cursor to a POJO / Bean in Hibernate?

Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a requirement where I need to create an object based on soem big calculation. The result is from 2-3 tables and I am using an Oracle Stored procedure for the same.
The stored procedure will return a cursor.
Now how can I map the cursor directly to some Java class / POJO using EJB3 / hibernate? As I dont have any underlying table for this entity so I am getting error when i try to define NamedNativeQuery for this?

I have following definition

I have my stored procedure in place which returns a cursor with some say 5-6 columns. But as SectorDetail class can not be tied to a table (as no table exists) .
So how can I do this?

Or is the only way to do this is loop through returned cursor and get column values one by one and create a list of SectorDetail object?

    Bookmark Topic Watch Topic
  • New Topic