com.jenkov.mrpersister.itf
Class PersistenceExceptionUnchecked

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by com.jenkov.mrpersister.itf.PersistenceExceptionUnchecked
All Implemented Interfaces:
java.io.Serializable

public class PersistenceExceptionUnchecked
extends java.lang.RuntimeException

An unchecked version of PersistenceException. Used by the unchecked dao command executor. Usually wraps a PersistenceException.

Call getPersistenceException() to obtain it if there is one. The wrapped PersistenceException may have connection rollback and close exceptions attached. You can also use the shortcut methods getConnectionRollbackException() and getConnectionCloseException().

See PersistenceException for more information.

Author:
Jakob Jenkov, Jenkov Development
See Also:
Serialized Form

Constructor Summary
PersistenceExceptionUnchecked()
           
PersistenceExceptionUnchecked(java.lang.String msg)
           
PersistenceExceptionUnchecked(java.lang.String msg, java.lang.Throwable throwable)
           
PersistenceExceptionUnchecked(java.lang.Throwable throwable)
           
 
Method Summary
 java.sql.SQLException getConnectionCloseException()
          If the wrapped exception is a PersistenceException, then this method returns getPersistenceException().getConnectionCloseException(); Else it returns null;
 java.sql.SQLException getConnectionRollbackException()
          If the wrapped exception is a PersistenceException, then this method returns getPersistenceException().getConnectionRollbackException(); Else it returns null;
 PersistenceException getPersistenceException()
          Returns the wrapped PersistenceException if any.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, 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

PersistenceExceptionUnchecked

public PersistenceExceptionUnchecked()

PersistenceExceptionUnchecked

public PersistenceExceptionUnchecked(java.lang.String msg)

PersistenceExceptionUnchecked

public PersistenceExceptionUnchecked(java.lang.String msg,
                                     java.lang.Throwable throwable)

PersistenceExceptionUnchecked

public PersistenceExceptionUnchecked(java.lang.Throwable throwable)
Method Detail

getPersistenceException

public PersistenceException getPersistenceException()
Returns the wrapped PersistenceException if any.

Returns:
The wrapped PersistenceException if any.

getConnectionRollbackException

public java.sql.SQLException getConnectionRollbackException()
If the wrapped exception is a PersistenceException, then this method returns getPersistenceException().getConnectionRollbackException(); Else it returns null;

Returns:
The connection rollback connection of the wrapped PersistenceException or null.

getConnectionCloseException

public java.sql.SQLException getConnectionCloseException()
If the wrapped exception is a PersistenceException, then this method returns getPersistenceException().getConnectionCloseException(); Else it returns null;

Returns:
The connection close connection of the wrapped PersistenceException or null.