Search in sources :

Example 1 with EntityInsertAction

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

the class AbstractSaveEventListener method addInsertAction.

private AbstractEntityInsertAction addInsertAction(Object[] values, Serializable id, Object entity, EntityPersister persister, boolean useIdentityColumn, EventSource source, boolean shouldDelayIdentityInserts) {
    if (useIdentityColumn) {
        EntityIdentityInsertAction insert = new EntityIdentityInsertAction(values, entity, persister, isVersionIncrementDisabled(), source, shouldDelayIdentityInserts);
        source.getActionQueue().addAction(insert);
        return insert;
    } else {
        Object version = Versioning.getVersion(values, persister);
        EntityInsertAction insert = new EntityInsertAction(id, values, entity, version, persister, isVersionIncrementDisabled(), source);
        source.getActionQueue().addAction(insert);
        return insert;
    }
}
Also used : EntityIdentityInsertAction(org.hibernate.action.internal.EntityIdentityInsertAction) AbstractEntityInsertAction(org.hibernate.action.internal.AbstractEntityInsertAction) EntityInsertAction(org.hibernate.action.internal.EntityInsertAction)

Aggregations

AbstractEntityInsertAction (org.hibernate.action.internal.AbstractEntityInsertAction)1 EntityIdentityInsertAction (org.hibernate.action.internal.EntityIdentityInsertAction)1 EntityInsertAction (org.hibernate.action.internal.EntityInsertAction)1