Package org.fryske_akademy.jpa
Class EntityException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- jakarta.persistence.PersistenceException
-
- org.fryske_akademy.jpa.EntityException
-
- All Implemented Interfaces:
Serializable
public class EntityException extends jakarta.persistence.PersistenceExceptionAn Exception that tracks the entity that caused the failure, useful for example the combination of EntityListeners and batch operations.
-
-
Constructor Summary
Constructors Constructor Description EntityException(EntityInterface failed)EntityException(EntityInterface failed, Exception ex)EntityException(EntityInterface failed, String message)EntityException(EntityInterface failed, String message, Exception ex)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Optional<EntityInterface>fromException(Throwable ex)get hold of an entity in the exception chain.EntityInterfacegetFailed()-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
EntityException
public EntityException(EntityInterface failed)
-
EntityException
public EntityException(EntityInterface failed, String message)
-
EntityException
public EntityException(EntityInterface failed, Exception ex)
-
EntityException
public EntityException(EntityInterface failed, String message, Exception ex)
-
-
Method Detail
-
fromException
public static Optional<EntityInterface> fromException(Throwable ex)
get hold of an entity in the exception chain.- Parameters:
ex-- Returns:
-
getFailed
public EntityInterface getFailed()
-
-