Skip to content

fix up weird signature of ReactiveEntityPersister.insertReactive() #2124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public CompletionStage<Void> reactiveExecute() throws HibernateException {
final ReactiveEntityPersister reactivePersister = (ReactiveEntityPersister) persister;
final PersistenceContext persistenceContext = session.getPersistenceContextInternal();
return stage
.thenCompose( v -> reactivePersister.insertReactive( id, getState(), instance, session, false ) )
.thenCompose( v -> reactivePersister.insertReactive( id, getState(), instance, session ) )
.thenCompose( generatedValues -> {
final EntityEntry entry = persistenceContext.getEntry( instance );
if ( entry == null ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.hibernate.generator.values.GeneratedValues;
import org.hibernate.loader.ast.spi.MultiIdLoadOptions;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.reactive.persister.entity.mutation.ReactiveInsertCoordinator;

import jakarta.persistence.metamodel.Attribute;

Expand All @@ -33,16 +32,7 @@ public interface ReactiveEntityPersister extends EntityPersister {
*
* @see EntityPersister#insert(Object, Object[], Object, SharedSessionContractImplementor)
*/
default CompletionStage<GeneratedValues> insertReactive(Object id, Object[] fields, Object object, SharedSessionContractImplementor session) {
return ( (ReactiveInsertCoordinator) getInsertCoordinator() ).reactiveInsert( object, id, fields, session );
};

/**
* Insert the given instance state without blocking, but it allows to specify if it's an identity insert or a regular one.
*
* @see EntityPersister#insert(Object, Object[], Object, SharedSessionContractImplementor)
*/
CompletionStage<GeneratedValues> insertReactive(Object id, Object[] fields, Object object, SharedSessionContractImplementor session, boolean isIdentityType);
CompletionStage<GeneratedValues> insertReactive(Object id, Object[] fields, Object object, SharedSessionContractImplementor session);

/**
* Insert the given instance state without blocking.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,7 @@ public NaturalIdMapping generateNaturalIdMapping(MappingModelCreationProcess cre

@Override
public CompletionStage<GeneratedValues> insertReactive(Object id, Object[] fields, Object object, SharedSessionContractImplementor session) {
return insertReactive( id, fields, object, session, true );
}

@Override
public CompletionStage<GeneratedValues> insertReactive(Object id, Object[] fields, Object object, SharedSessionContractImplementor session, boolean isIdentityInsert) {
return ( (ReactiveInsertCoordinatorStandard) getInsertCoordinator() ).coordinateReactiveInsert( object, id, fields, session, isIdentityInsert );
return ( (ReactiveInsertCoordinatorStandard) getInsertCoordinator() ).coordinateReactiveInsert( object, id, fields, session, false );
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,7 @@ public CompletionStage<GeneratedValues> insertReactive(Object[] fields, Object e

@Override
public CompletionStage<GeneratedValues> insertReactive(Object id, Object[] fields, Object entity, SharedSessionContractImplementor session) {
return insertReactive( id, fields, entity, session, true );
}

@Override
public CompletionStage<GeneratedValues> insertReactive(Object id, Object[] fields, Object entity, SharedSessionContractImplementor session, boolean isIdentityInsert) {
return ( (ReactiveInsertCoordinatorStandard) getInsertCoordinator() ).coordinateReactiveInsert( entity, id, fields, session, isIdentityInsert );
return ( (ReactiveInsertCoordinatorStandard) getInsertCoordinator() ).coordinateReactiveInsert( entity, id, fields, session, false );
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,7 @@ private CompletionStage<Object> doReactiveLoad(Object id, Object optionalObject,

@Override
public CompletionStage<GeneratedValues> insertReactive(Object id, Object[] fields, Object entity, SharedSessionContractImplementor session) {
return insertReactive( id, fields, entity, session, true );
}

@Override
public CompletionStage<GeneratedValues> insertReactive(Object id, Object[] fields, Object entity, SharedSessionContractImplementor session, boolean isIdentityInsert) {
return ( (ReactiveInsertCoordinatorStandard) getInsertCoordinator() )
.coordinateReactiveInsert( entity, id, fields, session, isIdentityInsert );
return ( (ReactiveInsertCoordinatorStandard) getInsertCoordinator() ).coordinateReactiveInsert( entity, id, fields, session, false );
}

@Override
Expand Down
Loading