Skip to content

Commit

Permalink
--wip-- remove java17 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mbladel committed Dec 19, 2023
1 parent b0fddeb commit 442b444
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ public MutationExecutorStandard(

for ( int i = mutationOperationGroup.getNumberOfOperations() - 1; i >= 0; i-- ) {
final MutationOperation operation = mutationOperationGroup.getOperation( i );
if ( operation instanceof final SelfExecutingUpdateOperation selfExecutingMutation ) {
if ( operation instanceof SelfExecutingUpdateOperation ) {
if ( selfExecutingMutations == null ) {
selfExecutingMutations = new ArrayList<>();
}
selfExecutingMutations.add( 0, selfExecutingMutation );
selfExecutingMutations.add( 0, ( (SelfExecutingUpdateOperation) operation ) );
}
else {
final PreparableMutationOperation preparableMutationOperation = (PreparableMutationOperation) operation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ public static JdbcValuesMappingProducer createMappingProducer(
final GeneratedValuesMappingProducer mappingProducer = new GeneratedValuesMappingProducer();
for ( int i = 0; i < generatedProperties.size(); i++ ) {
final ModelPart modelPart = generatedProperties.get( i );
if ( modelPart instanceof BasicValuedModelPart basicModelPart ) {
if ( modelPart instanceof BasicValuedModelPart ) {
final BasicValuedModelPart basicModelPart = (BasicValuedModelPart) modelPart;
final GeneratedValueBasicResultBuilder resultBuilder = new GeneratedValueBasicResultBuilder(
parentNavigablePath.append( basicModelPart.getSelectableName() ),
basicModelPart,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ default InsertGeneratedIdentifierDelegate getIdentityInsertDelegate() {
GeneratedValuesMutationDelegate getUpdateDelegate();

default GeneratedValuesMutationDelegate getMutationDelegate(MutationType mutationType) {
return switch ( mutationType ) {
case INSERT -> getInsertDelegate();
case UPDATE -> getUpdateDelegate();
default -> null;
};
switch ( mutationType ) {
case INSERT:
return getInsertDelegate();
case UPDATE:
return getUpdateDelegate();
default:
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ default boolean canBeBatched(BatchKey batchKey, int batchSize) {

// This should already be guaranteed by the batchKey being null
assert !getTableDetails().isIdentifierTable() ||
!( getMutationTarget() instanceof EntityMutationTarget entityTarget
&& entityTarget.getMutationDelegate( getMutationType() ) != null );
!( getMutationTarget() instanceof EntityMutationTarget
&& ( (EntityMutationTarget) getMutationTarget() ).getMutationDelegate( getMutationType() ) != null );

if ( getMutationType() == MutationType.UPDATE ) {
// we cannot batch updates against optional tables
Expand Down

0 comments on commit 442b444

Please sign in to comment.