Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.openjpa.persistence
Class PersistenceExceptions

    java.lang.Object
      org.apache.openjpa.util.Exceptions
          org.apache.openjpa.persistence.PersistenceExceptions

    public class PersistenceExceptions

extends Exceptions

Converts from OpenJPA to persistence exception types.

Author:
  Abe White, Marc Prud'hommeaux

Field Summary
`static RuntimeExceptionTranslator` | `TRANSLATOR`

Fields inherited from class org.apache.openjpa.util.Exceptions
`EMPTY_THROWABLES`

Constructor Summary
`PersistenceExceptions()`

Method Summary
`(package private) static Throwable` | `getCause(Throwable[] nested)` Helper method to extract a nested exception from an internal nested array in a safe way.
`static RuntimeExceptionTranslator` | `getRollbackTranslator(OpenJPAEntityManager em)` Returns a `RuntimeExceptionTranslator` that will perform the correct exception translation as well as roll back the current transaction when for all but `NoResultException` and `NonUniqueResultException` in accordance with section 3.7 of the EJB 3.0 specification.
`static RuntimeException` | `toPersistenceException(Throwable t)` Convert the given throwable to the proper persistence exception.

Methods inherited from class org.apache.openjpa.util.Exceptions
`printNestedThrowables, printNestedThrowables, replaceFailedObject, replaceNestedThrowables, toClassName, toClassNames, toString, toString, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TRANSLATOR

    public static final RuntimeExceptionTranslator TRANSLATOR

Constructor Detail

### PersistenceExceptions

    public PersistenceExceptions()

Method Detail

### getRollbackTranslator

    public static RuntimeExceptionTranslator getRollbackTranslator(OpenJPAEntityManager em)

  Returns a `RuntimeExceptionTranslator` that will perform the correct exception translation as well as roll back the current transaction when for all but `NoResultException` and `NonUniqueResultException` in accordance with section 3.7 of the EJB 3.0 specification.

### toPersistenceException

    public static RuntimeException toPersistenceException(Throwable t)

  Convert the given throwable to the proper persistence exception.

### getCause

    static Throwable getCause(Throwable[] nested)

  Helper method to extract a nested exception from an internal nested array in a safe way.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.