Package org.hibernate

Class ObjectNotFoundException

  • All Implemented Interfaces:
    java.io.Serializable

    public class ObjectNotFoundException
    extends UnresolvableObjectException
    Thrown when Session.load() fails to select a row with the given primary key (identifier value). This exception might not be thrown when load() is called, even if there was no row on the database, because load() returns a proxy if possible. Applications should use Session.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​(java.io.Serializable identifier, java.lang.String entityName)
      Constructs a ObjectNotFoundException using the given information.
    • Method Summary

      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ObjectNotFoundException

        public ObjectNotFoundException​(java.io.Serializable identifier,
                                       java.lang.String entityName)
        Constructs a ObjectNotFoundException using the given information.
        Parameters:
        identifier - The identifier of the entity
        entityName - The name of the entity