File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "org.hibernate.ObjectNot Found Exception: " Watch "org.hibernate.ObjectNot Found Exception: " New topic

org.hibernate.ObjectNot Found Exception:

Abhinav Sahai

Joined: May 21, 2008
Posts: 12

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"

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

<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"/>


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

Joined: May 21, 2008
Posts: 12
Don't know what the problem was, but it got fixed when I restarted the PC.
I agree. Here's the link:
subject: org.hibernate.ObjectNot Found Exception:
It's not a secret anymore!