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
Runtime exception thrown if objects that should exist are not found in the database.
- Author:
- harald
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new database object not found exception without a session and withnullas its detail message.NotFoundException(String message) Constructs a new database object not found exception without a session with the specified detail message.NotFoundException(String message, Throwable cause) Constructs a new database object not found exception without a session with the specified detail message and cause.NotFoundException(Identifiable object) Constructs a new database object not found exception for a given pc object withnullas its detail message.NotFoundException(Identifiable object, String message) Constructs a new database object not found exception for a given session with the specified detail message.NotFoundException(Identifiable object, String message, long persistedSerial) Constructs a new database object not found exception for a given session with the specified detail message.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.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 ofcause).NotFoundException(Session session) Constructs a new database object not found exception for a given session withnullas its detail message.NotFoundException(Session session, String message) Constructs a new database object not found exception for a given session with the specified detail message.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.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 ofcause). -
Method Summary
Modifier and TypeMethodDescriptionlongGets the effective serial of the object persisted in the database.Methods inherited from class org.tentackle.session.PersistenceException
createFromRemoteException, extractPersistenceException, getIdentifiable, getMessage, getSession, updateDbObjectMethods inherited from class org.tentackle.common.TentackleRuntimeException
isTemporary, setTemporaryMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
NotFoundException
Constructs a new database object not found exception for a given session withnullas its detail message. The cause is not initialized, and may subsequently be initialized by a call toThrowable.initCause(java.lang.Throwable).- Parameters:
session- the session
-
NotFoundException
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 toThrowable.initCause(java.lang.Throwable).- Parameters:
session- the sessionmessage- the detail message. The detail message is saved for later retrieval by thePersistenceException.getMessage()method.
-
NotFoundException
Constructs a new database object not found exception for a given session with the specified detail message and cause.- Parameters:
session- the sessionmessage- the detail message (which is saved for later retrieval by thePersistenceException.getMessage()method).cause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (Anullvalue is permitted, and indicates that the cause is nonexistent or unknown.)
-
NotFoundException
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 ofcause). This constructor is useful for runtime exceptions that are little more than wrappers for other throwables.- Parameters:
session- the sessioncause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (Anullvalue is permitted, and indicates that the cause is nonexistent or unknown.)
-
NotFoundException
Constructs a new database object not found exception for a given pc object withnullas its detail message. The cause is not initialized, and may subsequently be initialized by a call toThrowable.initCause(java.lang.Throwable).- Parameters:
object- the persistent object
-
NotFoundException
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 toThrowable.initCause(java.lang.Throwable).- Parameters:
object- the persistent objectmessage- the detail message. The detail message is saved for later retrieval by thePersistenceException.getMessage()method.
-
NotFoundException
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 toThrowable.initCause(java.lang.Throwable).- Parameters:
object- the persistent objectmessage- the detail message. The detail message is saved for later retrieval by thePersistenceException.getMessage()method.persistedSerial- the serial of the object in the database, -1 if no such object, 0 if unknown
-
NotFoundException
Constructs a new database object not found exception for a given session with the specified detail message and cause.- Parameters:
object- the persistent objectmessage- the detail message (which is saved for later retrieval by thePersistenceException.getMessage()method).cause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (Anullvalue is permitted, and indicates that the cause is nonexistent or unknown.)
-
NotFoundException
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 ofcause). This constructor is useful for runtime exceptions that are little more than wrappers for other throwables.- Parameters:
object- the persistent objectcause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (Anullvalue 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 withnullas its detail message. The cause is not initialized, and may subsequently be initialized by a call toThrowable.initCause(java.lang.Throwable). -
NotFoundException
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 toThrowable.initCause(java.lang.Throwable).- Parameters:
message- the detail message. The detail message is saved for later retrieval by thePersistenceException.getMessage()method.
-
NotFoundException
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
causeis not automatically incorporated in this runtime exception's detail message.- Parameters:
message- the detail message (which is saved for later retrieval by thePersistenceException.getMessage()method).cause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (Anullvalue 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
-