aspose file tools
The moose likes Object Relational Mapping and the fly likes How to map returned cursor to a POJO / Bean in Hibernate? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "How to map returned cursor to a POJO / Bean in Hibernate?" Watch "How to map returned cursor to a POJO / Bean in Hibernate?" New topic
Author

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

hildich kilal
Ranch Hand

Joined: Aug 25, 2008
Posts: 44
Hi
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?

Thanks
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to map returned cursor to a POJO / Bean in Hibernate?
 
Similar Threads
How to call stored procedure from Entity Manager if there is out parameter in stored procedure.
Stored procedures JPA and mappings
Executing stored procedures in hibernate
Getting -org.hibernate.cfg.NotYetImplementedException:
Named query for stored procedure