Top Description Constructors Methods
org.hibernate

public Class ObjectNotFoundException

extends UnresolvableObjectException
Class Inheritance

Thrown when Session#find(Class, Object) fails to select a row with the given primary key (identifier value).

On the other hand, this exception might not be thrown immediately by Session#getReference(Class, Object) is called, even when there was no row on the database, because getReference() returns a proxy if possible. Programs should use Session.find() to test if a row exists in the database.

Like all Hibernate exceptions, this one is considered unrecoverable.

Author
Gavin King

Constructor Summary

AccessConstructor and Description
public
ObjectNotFoundException(Object
The identifier of the entity
identifier
,
String
The name of the entity
entityName
)

Constructs a ObjectNotFoundException using the given information.

public
ObjectNotFoundException(String entityName, Object identifier)

Method Summary

Inherited from org.hibernate.UnresolvableObjectException:
getEntityNamegetIdentifiergetMessagethrowIfNull

Constructor Detail

ObjectNotFoundExceptionback to summary
public ObjectNotFoundException(Object identifier, String entityName)

Constructs a ObjectNotFoundException using the given information.

Parameters
identifier:Object

The identifier of the entity

entityName:String

The name of the entity

ObjectNotFoundExceptionback to summary
public ObjectNotFoundException(String entityName, Object identifier)