Package org.hibernate
Class ObjectNotFoundException
-
- All Implemented Interfaces:
Serializable
public class ObjectNotFoundException extends UnresolvableObjectException
Thrown whenSession.load()
fails to select a row with the given primary key (identifier value). This exception might not be thrown whenload()
is called, even if there was no row on the database, becauseload()
returns a proxy if possible. Applications should useSession.get()
to test if a row exists in the database.Like all Hibernate exceptions, this exception is considered unrecoverable.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ObjectNotFoundException(Object identifier, String entityName)
Constructs a ObjectNotFoundException using the given information.ObjectNotFoundException(String entityName, Object identifier)
-
Method Summary
-
Methods inherited from class org.hibernate.UnresolvableObjectException
getEntityName, getIdentifier, getMessage, throwIfNull
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-