FileDocCategorySizeDatePackage
PersistenceException.javaAPI DocExample1479Sat Feb 01 07:10:12 GMT 1997imaginary.persist

PersistenceException

public class PersistenceException extends Exception
An exception that gets thrown by failed persistence operations. It allows you to chain exceptions so you can see what really caused the persistence to fail.

Fields Summary
private Exception
cause
Constructors Summary
public PersistenceException()
Constructs an exception without cause or reason.

        this("An exception for no reason whatsoever.", null);
    
public PersistenceException(String reason)
Constructs a new exception for the specified reason.

param
reason the reason the operation failed

        this(reason, null);
    
public PersistenceException(Exception e)
Constructs a new exception caused by the specified exception.

param
e the exception causing the operation to fail

        this("A persisitence exception caused by: " + e.getMessage(), e);
    
public PersistenceException(String reason, Exception e)
Constructs a new exception with both a cause and reason.

param
reason the reason for the exception
param
e the cause

        super(reason);
        cause = e;
    
Methods Summary
public java.lang.ExceptiongetCause()

return
the exception that caused the persistence operation to fail

        return cause;