Search in sources :

Example 1 with EntityActionVetoException

use of org.hibernate.action.internal.EntityActionVetoException in project hibernate-orm by hibernate.

the class ActionQueue method addResolvedEntityInsertAction.

private void addResolvedEntityInsertAction(AbstractEntityInsertAction insert) {
    if (insert.isEarlyInsert()) {
        LOG.trace("Executing insertions before resolved early-insert");
        executeInserts();
        LOG.debug("Executing identity-insert immediately");
        execute(insert);
    } else {
        LOG.trace("Adding resolved non-early insert action.");
        addAction(AbstractEntityInsertAction.class, insert);
    }
    if (!insert.isVeto()) {
        insert.makeEntityManaged();
        if (unresolvedInsertions != null) {
            for (AbstractEntityInsertAction resolvedAction : unresolvedInsertions.resolveDependentActions(insert.getInstance(), session)) {
                addResolvedEntityInsertAction(resolvedAction);
            }
        }
    } else {
        throw new EntityActionVetoException("The EntityInsertAction was vetoed.", insert);
    }
}
Also used : EntityActionVetoException(org.hibernate.action.internal.EntityActionVetoException) AbstractEntityInsertAction(org.hibernate.action.internal.AbstractEntityInsertAction)

Aggregations

AbstractEntityInsertAction (org.hibernate.action.internal.AbstractEntityInsertAction)1 EntityActionVetoException (org.hibernate.action.internal.EntityActionVetoException)1