wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Retrieval without unique identifier from Oracle database View Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Retrieval without unique identifier from Oracle database View" Watch "Retrieval without unique identifier from Oracle database View" New topic
Author

Retrieval without unique identifier from Oracle database View

Sethu Raman
Greenhorn

Joined: Oct 18, 2007
Posts: 14
Hi all

Am very new to hibernate. I am using JSF and Hibernate in my code. I have one "View" in oracle database which collects the exact output from three different table. It is done this way since difficult calculations are there.

Now i want to generate hbm.xml file for that "View".I did that but am getting error since there will not be any unique identifier there. It doesn't allow me to leave <ID> tag inside <CLASS> tag.

This view can be consider as seperate table.
Since there is no unique id am getting problem in retrieving.

Note: I need only retrieval method no need of creating or modifying....


Can anyone help me in this....

Thanks in advance....

Regards.,
Sethu
Ketan Jambhekar
Ranch Hand

Joined: Mar 26, 2007
Posts: 37
Hi,
You need a unique identifier in hibernate without which you cannot retrive the values. Now since you are not creating or updating any rows you can add a new sequence in your view or use a rownum and use it as a unique identifier.

Thanks,
Ketan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Retrieval without unique identifier from Oracle database View
 
Similar Threads
One to one mapping without using id
Does the identifier name have to be the same in all persistent classes ?
Whether It need to be validated
How can this be done better (html:link)
cascading classes and tables (how to update ?)