This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes org.hibernate.ObjectNot Found Exception: 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 "org.hibernate.ObjectNot Found Exception: " Watch "org.hibernate.ObjectNot Found Exception: " New topic
Author

org.hibernate.ObjectNot Found Exception:

Abhinav Sahai
Greenhorn

Joined: May 21, 2008
Posts: 12
Hi,

I am trying to load data from database, but it is not returning any results(though there is a record and I can see it!), and throwing an exception ...........

org.hibernate.ObjectNotFoundException: No row with the given identifier exists

I am doing simple load..
DMSIndex index = (DMSIndex)session.load(DMSIndex.class, pIndexID);System.out.println("Unique ID = "+index.getUnique_id());

My hibernate mapping file looks like this:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class name="dms2dms.businessobject.DMSIndex" table="index">
<id name="index_id" column="index_id" type="java.lang.Integer">
<generator class="assigned" />
</id>

<property name="index_type" column="index_type" type="string"/>

<property name="overlay_id" column="overlay_id" type="java.lang.Long"/>

<property name="authorisation" column="authorisation" type="string"/>
<property name="authorisation_date" column="authorisation_date" type="java.util.Date"/>

<property name="instruction" column="instruction" type="string"/>

<property name="unique_id" column="unique_id" type="string"/>
<property name="ra_notes" column="ra_notes" type="string"/>

<property name="ra_status" column="ra_status" type="string"/>
<property name="completion_status" column="completion_status" type="string"/>

</class>
</hibernate-mapping>

Please help it is urgent... :-((
Abhinav Sahai
Greenhorn

Joined: May 21, 2008
Posts: 12
Don't know what the problem was, but it got fixed when I restarted the PC.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: org.hibernate.ObjectNot Found Exception:
 
Similar Threads
1-to-M mapping confusion
Hibernate
persisting a collection - one-to-many mapping
Illegal attempt to associate a collection with two open sessions
Batch Delete Problem