wood burning stoves*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
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://aspose.com/file-tools
 
subject: How to map returned cursor to a POJO / Bean in Hibernate?