Package org.hibernate
Class ObjectNotFoundException
- All Implemented Interfaces:
Serializable
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 bySession.getReference(Class, Object) is called, even when there was no row on the database, becausegetReference() returns a proxy if possible. Programs should useSession.find() to test if a row exists in the database.
Like all Hibernate exceptions, this one is considered unrecoverable.
- See Also:
Constructor Summary
ConstructorsConstructorDescriptionObjectNotFoundException(Object identifier,String entityName) Constructs aObjectNotFoundExceptionusing the given information.ObjectNotFoundException(String entityName,Object identifier) Method Summary
Methods inherited from class org.hibernate.UnresolvableObjectException
getEntityName,getIdentifier,getMessage,throwIfNullMethods inherited from class java.lang.Throwable
addSuppressed,fillInStackTrace,getCause,getLocalizedMessage,getStackTrace,getSuppressed,initCause,printStackTrace,printStackTrace,printStackTrace,setStackTrace,toString
Constructor Details
ObjectNotFoundException
Constructs aObjectNotFoundExceptionusing the given information.- Parameters:
identifier- The identifier of the entityentityName- The name of the entity
ObjectNotFoundException