Class NotFoundException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.tentackle.common.TentackleRuntimeException
org.tentackle.session.PersistenceException
org.tentackle.session.NotFoundException
All Implemented Interfaces:
Serializable

public class NotFoundException extends PersistenceException
Runtime exception thrown if objects that should exist are not found in the database.
Author:
harald
See Also:
  • Constructor Details

    • NotFoundException

      public NotFoundException(Session session)
      Constructs a new database object not found exception for a given session with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).
      Parameters:
      session - the session
    • NotFoundException

      public NotFoundException(Session session, String message)
      Constructs a new database object not found exception for a given session with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).
      Parameters:
      session - the session
      message - the detail message. The detail message is saved for later retrieval by the PersistenceException.getMessage() method.
    • NotFoundException

      public NotFoundException(Session session, String message, Throwable cause)
      Constructs a new database object not found exception for a given session with the specified detail message and cause.
      Parameters:
      session - the session
      message - the detail message (which is saved for later retrieval by the PersistenceException.getMessage() method).
      cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
    • NotFoundException

      public NotFoundException(Session session, Throwable cause)
      Constructs a new database object not found exception for a given session with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for runtime exceptions that are little more than wrappers for other throwables.
      Parameters:
      session - the session
      cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
    • NotFoundException

      public NotFoundException(Identifiable object)
      Constructs a new database object not found exception for a given pc object with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).
      Parameters:
      object - the persistent object
    • NotFoundException

      public NotFoundException(Identifiable object, String message)
      Constructs a new database object not found exception for a given session with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).
      Parameters:
      object - the persistent object
      message - the detail message. The detail message is saved for later retrieval by the PersistenceException.getMessage() method.
    • NotFoundException

      public NotFoundException(Identifiable object, String message, long persistedSerial)
      Constructs a new database object not found exception for a given session with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).
      Parameters:
      object - the persistent object
      message - the detail message. The detail message is saved for later retrieval by the PersistenceException.getMessage() method.
      persistedSerial - the serial of the object in the database, -1 if no such object, 0 if unknown
    • NotFoundException

      public NotFoundException(Identifiable object, String message, Throwable cause)
      Constructs a new database object not found exception for a given session with the specified detail message and cause.
      Parameters:
      object - the persistent object
      message - the detail message (which is saved for later retrieval by the PersistenceException.getMessage() method).
      cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
    • NotFoundException

      public NotFoundException(Identifiable object, Throwable cause)
      Constructs a new database object not found exception for a given session with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for runtime exceptions that are little more than wrappers for other throwables.
      Parameters:
      object - the persistent object
      cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
    • NotFoundException

      public NotFoundException()
      Constructs a new database object not found exception without a session and with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).
    • NotFoundException

      public NotFoundException(String message)
      Constructs a new database object not found exception without a session with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).
      Parameters:
      message - the detail message. The detail message is saved for later retrieval by the PersistenceException.getMessage() method.
    • NotFoundException

      public NotFoundException(String message, Throwable cause)
      Constructs a new database object not found exception without a session with the specified detail message and cause.

      Note that the detail message associated with cause is not automatically incorporated in this runtime exception's detail message.

      Parameters:
      message - the detail message (which is saved for later retrieval by the PersistenceException.getMessage() method).
      cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
  • Method Details

    • getPersistedSerial

      public long getPersistedSerial()
      Gets the effective serial of the object persisted in the database.
      Returns:
      0 if unknown, -1 if no such object persisted at all, else the persisted serial