use of org.hibernate.reactive.engine.impl.ReactiveEntityRegularInsertAction in project hibernate-reactive by hibernate.
the class AbstractReactiveSaveEventListener method addInsertAction.
private CompletionStage<AbstractEntityInsertAction> addInsertAction(Object[] values, Serializable id, Object entity, EntityPersister persister, boolean useIdentityColumn, EventSource source, boolean shouldDelayIdentityInserts) {
if (useIdentityColumn) {
ReactiveEntityIdentityInsertAction insert = new ReactiveEntityIdentityInsertAction(values, entity, persister, false, source, shouldDelayIdentityInserts);
return source.unwrap(ReactiveSession.class).getReactiveActionQueue().addAction(insert).thenApply(v -> insert);
} else {
Object version = Versioning.getVersion(values, persister);
ReactiveEntityRegularInsertAction insert = new ReactiveEntityRegularInsertAction(id, values, entity, version, persister, false, source);
return source.unwrap(ReactiveSession.class).getReactiveActionQueue().addAction(insert).thenApply(v -> insert);
}
}
Aggregations