public class PersistenceException
extends org.tentackle.common.TentackleRuntimeException
| Modifier and Type | Field and Description |
|---|---|
static String |
END_INFO
Tag ending extra identifiable/session info in message.
|
static String |
START_INFO
Tag starting extra identifiable/session info in message.
|
| Constructor and Description |
|---|
PersistenceException()
Constructs a new database runtime exception without a db connection and
with
null as its detail message. |
PersistenceException(Identifiable identifiable)
Constructs a new database runtime exception for a given db object
with
null as its detail message. |
PersistenceException(Identifiable object,
String message)
Constructs a new database runtime exception for a given db connection with the specified detail message.
|
PersistenceException(Identifiable object,
String message,
Throwable cause)
Constructs a new database runtime exception for a given db connection with the specified detail message and
cause.
|
PersistenceException(Identifiable object,
Throwable cause)
Constructs a new database runtime exception for a given db connection with the specified cause and a
detail message of (cause==null ? null : cause.toString())
(which typically contains the class and detail message of
cause).
|
PersistenceException(Session session)
Constructs a new database runtime exception for a given db connection
with
null as its detail message. |
PersistenceException(Session session,
String message)
Constructs a new database runtime exception for a given db connection with the specified detail message.
|
PersistenceException(Session session,
String message,
Throwable cause)
Constructs a new database runtime exception for a given db connection with the specified detail message and
cause.
|
PersistenceException(Session session,
Throwable cause)
Constructs a new database runtime exception for a given db connection with the specified cause and a
detail message of (cause==null ? null : cause.toString())
(which typically contains the class and detail message of
cause).
|
PersistenceException(String message)
Constructs a new database runtime exception without a db connection with the specified detail message.
|
PersistenceException(String message,
Throwable cause)
Constructs a new database runtime exception without a db connection with the specified detail message and
cause.
|
PersistenceException(Throwable cause)
Constructs a new database runtime exception without a db connection with the specified cause and a
detail message of (cause==null ? null : cause.toString())
(which typically contains the class and detail message of
cause).
|
| Modifier and Type | Method and Description |
|---|---|
static RuntimeException |
createFromRemoteException(Object relatedObject,
RemoteException remoteException)
Creates a RuntimeException from a
RemoteException.Returns the first RuntimeException in chain. |
static PersistenceException |
extractPersistenceException(Throwable e)
Extracts the
PersistenceException from an exception. |
Identifiable |
getIdentifiable()
Gets the persistent object.
|
String |
getMessage() |
Session |
getSession()
Gets the session.
|
protected void |
setIdentifiable(Identifiable object)
Sets the pdo.
|
protected void |
setSession(Session session)
Sets the db.
|
void |
updateDbObject(Identifiable object)
Updates the pdo if not set so far.
Used to add more info for exceptions thrown in a context where the pdo isn't known. |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic static final String START_INFO
public static final String END_INFO
public PersistenceException(Session session)
null as its detail message.
The cause is not initialized, and may subsequently be
initialized by a call to Throwable.initCause(java.lang.Throwable).session - the sessionpublic PersistenceException(Session session, String message)
Throwable.initCause(java.lang.Throwable).session - the sessionmessage - the detail message. The detail message is saved for
later retrieval by the getMessage() method.public PersistenceException(Session session, String message, Throwable cause)
Note that the detail message associated with
cause is not automatically incorporated in
this runtime exception's detail message.
session - the sessionmessage - the detail message (which is saved for later retrieval
by the 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.)public PersistenceException(Session session, Throwable cause)
session - the sessioncause - 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.)public PersistenceException(Identifiable identifiable)
null as its detail message.
The cause is not initialized, and may subsequently be
initialized by a call to Throwable.initCause(java.lang.Throwable).identifiable - the db objectpublic PersistenceException(Identifiable object, String message)
Throwable.initCause(java.lang.Throwable).object - the objectmessage - the detail message. The detail message is saved for
later retrieval by the getMessage() method.public PersistenceException(Identifiable object, String message, Throwable cause)
Note that the detail message associated with
cause is not automatically incorporated in
this runtime exception's detail message.
object - the objectmessage - the detail message (which is saved for later retrieval
by the 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.)public PersistenceException(Identifiable object, Throwable cause)
object - the objectcause - 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.)public PersistenceException()
null as its detail message.
The cause is not initialized, and may subsequently be
initialized by a call to Throwable.initCause(java.lang.Throwable).public PersistenceException(String message)
Throwable.initCause(java.lang.Throwable).message - the detail message. The detail message is saved for
later retrieval by the getMessage() method.public PersistenceException(String message, Throwable cause)
Note that the detail message associated with
cause is not automatically incorporated in
this runtime exception's detail message.
message - the detail message (which is saved for later retrieval
by the 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.)public PersistenceException(Throwable cause)
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.)public static RuntimeException createFromRemoteException(Object relatedObject, RemoteException remoteException)
RemoteException.relatedObject - the optional related object, only used if remote cause is not a PersistenceExceptionremoteException - the remote exceptionpublic static PersistenceException extractPersistenceException(Throwable e)
PersistenceException from an exception.
Scans the exception chain until it finds an PersistenceException.
e - the exception headpublic Session getSession()
public Identifiable getIdentifiable()
public String getMessage()
getMessage in class Throwablepublic void updateDbObject(Identifiable object)
object - the persistent objectprotected void setIdentifiable(Identifiable object)
object - the persistent objectprotected void setSession(Session session)
session - the sessionTentackle - distributed, domain- and model-driven