Search in sources :

Example 1 with MergeEventListener

use of org.hibernate.event.spi.MergeEventListener in project hibernate-orm by hibernate.

the class SessionImpl method fireMerge.

private Object fireMerge(MergeEvent event) {
    try {
        checkTransactionSynchStatus();
        checkNoUnresolvedActionsBeforeOperation();
        for (MergeEventListener listener : listeners(EventType.MERGE)) {
            listener.onMerge(event);
        }
        checkNoUnresolvedActionsAfterOperation();
    } catch (ObjectDeletedException sse) {
        throw exceptionConverter.convert(new IllegalArgumentException(sse));
    } catch (MappingException e) {
        throw exceptionConverter.convert(new IllegalArgumentException(e.getMessage(), e));
    } catch (RuntimeException e) {
        //including HibernateException
        throw exceptionConverter.convert(e);
    }
    return event.getResult();
}
Also used : ObjectDeletedException(org.hibernate.ObjectDeletedException) MergeEventListener(org.hibernate.event.spi.MergeEventListener) UnknownSqlResultSetMappingException(org.hibernate.procedure.UnknownSqlResultSetMappingException) MappingException(org.hibernate.MappingException)

Aggregations

MappingException (org.hibernate.MappingException)1 ObjectDeletedException (org.hibernate.ObjectDeletedException)1 MergeEventListener (org.hibernate.event.spi.MergeEventListener)1 UnknownSqlResultSetMappingException (org.hibernate.procedure.UnknownSqlResultSetMappingException)1