Top Fields Constructors Methods
org.hibernate.internal

public Class ExceptionConverterImpl

extends Object
implements ExceptionConverter
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.spi.ExceptionConverter
Imports
java.io.Serializable, java.sql.SQLException, org.hibernate.HibernateException, .JDBCException, .LockOptions, .ObjectNotFoundException, .PersistentObjectException, .StaleObjectStateException, .StaleStateException, .TransientObjectException, .UnresolvableObjectException, org.hibernate.dialect.lock.LockingStrategyException, .OptimisticEntityLockException, .PessimisticEntityLockException, org.hibernate.engine.spi.ExceptionConverter, .SharedSessionContractImplementor, org.hibernate.exception.LockAcquisitionException, org.hibernate.loader.MultipleBagFetchException, org.hibernate.query.IllegalQueryOperationException, .SemanticException, .SyntaxException, jakarta.persistence.EntityExistsException, .EntityNotFoundException, .LockTimeoutException, .NoResultException, .NonUniqueResultException, .OptimisticLockException, .PersistenceException, .PessimisticLockException, .QueryTimeoutException, .RollbackException

Author
Andrea Boriero

Field Summary

Modifier and TypeField and Description
private final boolean
private static final EntityManagerMessageLogger
private final SharedSessionContractImplementor

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public RuntimeException
convert(HibernateException
The Hibernate exception.
exception
,
LockOptions
The lock options in effect at the time of exception (can be null)
lockOptions
)

Implements org.hibernate.engine.spi.ExceptionConverter.convert.

Converts a Hibernate-specific exception into a JPA-specified exception; note that the JPA specification makes use of exceptions outside its exception hierarchy, though they are all runtime exceptions.
public RuntimeException
convert(HibernateException
The Hibernate exception.
exception
)

Implements org.hibernate.engine.spi.ExceptionConverter.convert.

Converts a Hibernate-specific exception into a JPA-specified exception; note that the JPA specification makes use of exceptions outside its exception hierarchy, though they are all runtime exceptions.
public RuntimeException
public RuntimeException
public JDBCException
public RuntimeException
convertCommitException(RuntimeException
The exception being handled
exception
)

Implements org.hibernate.engine.spi.ExceptionConverter.convertCommitException.

Converts the exception thrown during the transaction commit phase
private void
private Throwable
protected PersistenceException
protected PersistenceException
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

isJpaBootstrapback to summary
private final boolean isJpaBootstrap
logback to summary
private static final EntityManagerMessageLogger log
sharedSessionContractback to summary
private final SharedSessionContractImplementor sharedSessionContract

Constructor Detail

ExceptionConverterImplback to summary
public ExceptionConverterImpl(SharedSessionContractImplementor sharedSessionContract)

Method Detail

convertback to summary
public RuntimeException convert(HibernateException exception, LockOptions lockOptions)

Implements org.hibernate.engine.spi.ExceptionConverter.convert.

Doc from org.hibernate.engine.spi.ExceptionConverter.convert.

Converts a Hibernate-specific exception into a JPA-specified exception; note that the JPA specification makes use of exceptions outside its exception hierarchy, though they are all runtime exceptions.

Parameters
exception:HibernateException

The Hibernate exception.

lockOptions:LockOptions

The lock options in effect at the time of exception (can be null)

Returns:RuntimeException

The JPA-specified exception

Annotations
@Override
convertback to summary
public RuntimeException convert(HibernateException exception)

Implements org.hibernate.engine.spi.ExceptionConverter.convert.

Doc from org.hibernate.engine.spi.ExceptionConverter.convert.

Converts a Hibernate-specific exception into a JPA-specified exception; note that the JPA specification makes use of exceptions outside its exception hierarchy, though they are all runtime exceptions.

Parameters
exception:HibernateException

The Hibernate exception.

Returns:RuntimeException

The JPA-specified exception

Annotations
@Override
convertback to summary
public RuntimeException convert(RuntimeException exception)

Implements org.hibernate.engine.spi.ExceptionConverter.convert.

Annotations
@Override
convertback to summary
public RuntimeException convert(RuntimeException exception, LockOptions lockOptions)

Implements org.hibernate.engine.spi.ExceptionConverter.convert.

Annotations
@Override
convertback to summary
public JDBCException convert(SQLException e, String message)

Implements org.hibernate.engine.spi.ExceptionConverter.convert.

Annotations
@Override
convertCommitExceptionback to summary
public RuntimeException convertCommitException(RuntimeException exception)

Implements org.hibernate.engine.spi.ExceptionConverter.convertCommitException.

Doc from org.hibernate.engine.spi.ExceptionConverter.convertCommitException.

Converts the exception thrown during the transaction commit phase

Parameters
exception:RuntimeException

The exception being handled

Returns:RuntimeException

The converted exception

Annotations
@Override
rollbackIfNecessaryback to summary
private void rollbackIfNecessary(PersistenceException e)
wrapCommitExceptionback to summary
private Throwable wrapCommitException(RuntimeException exception)
wrapLockExceptionback to summary
protected PersistenceException wrapLockException(HibernateException exception, LockOptions lockOptions)
wrapStaleStateExceptionback to summary
protected PersistenceException wrapStaleStateException(StaleStateException exception)