diff --git a/hibernate-core/src/main/java/org/hibernate/sql/model/MutationOperationGroup.java b/hibernate-core/src/main/java/org/hibernate/sql/model/MutationOperationGroup.java index bbef194d94..20fa561dfd 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/model/MutationOperationGroup.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/model/MutationOperationGroup.java @@ -6,10 +6,6 @@ */ package org.hibernate.sql.model; -import java.util.List; -import java.util.function.BiConsumer; -import java.util.function.BiFunction; - /** * Group of {@link MutationOperation} references for a specific * logical operation (target + type) @@ -52,27 +48,4 @@ public interface MutationOperationGroup { */ MutationOperation getOperation(String tableName); - /** - * @deprecated Will be removed - use a combination of {@link #getNumberOfOperations()} and {@link #getOperation(int)} - * to iterate the list of operations. - */ - @Deprecated(forRemoval = true) - List getOperations(); - - /** - * Visit each operation - * @deprecated Will be removed - use a combination of {@link #getNumberOfOperations()} and {@link #getOperation(int)} - * to iterate the list of operations. - */ - @Deprecated(forRemoval = true) - void forEachOperation(BiConsumer action); - - /** - * Test whether any operations match the condition - * @deprecated Will be removed - use a combination of {@link #getNumberOfOperations()} and {@link #getOperation(int)} - * to iterate the list of operations. - */ - @Deprecated(forRemoval = true) - boolean hasMatching(BiFunction matcher); - } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationGroupNone.java b/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationGroupNone.java index f8f14c4507..b705ce4d1f 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationGroupNone.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationGroupNone.java @@ -9,7 +9,6 @@ package org.hibernate.sql.model.internal; import java.util.Locale; import java.util.function.BiConsumer; -import org.hibernate.sql.model.MutationOperation; import org.hibernate.sql.model.MutationTarget; import org.hibernate.sql.model.MutationType; import org.hibernate.sql.model.ast.MutationGroup; @@ -46,17 +45,17 @@ public class MutationGroupNone implements MutationGroup { } @Override - public > M getSingleTableMutation() { + public TableMutation getSingleTableMutation() { return null; } @Override - public > M getTableMutation(String tableName) { + public TableMutation getTableMutation(String tableName) { return null; } @Override - public > void forEachTableMutation(BiConsumer action) { + public void forEachTableMutation(BiConsumer action) { } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationOperationGroupNone.java b/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationOperationGroupNone.java index 520c5c87e0..4a691bd866 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationOperationGroupNone.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationOperationGroupNone.java @@ -6,11 +6,6 @@ */ package org.hibernate.sql.model.internal; -import java.util.Collections; -import java.util.List; -import java.util.function.BiConsumer; -import java.util.function.BiFunction; - import org.hibernate.sql.model.MutationOperation; import org.hibernate.sql.model.MutationTarget; import org.hibernate.sql.model.MutationType; @@ -44,23 +39,9 @@ public class MutationOperationGroupNone extends AbstractMutationOperationGroup { throw new IndexOutOfBoundsException( idx ); } - @Override - public List getOperations() { - return Collections.emptyList(); - } - @Override public MutationOperation getOperation(String tableName) { return null; } - @Override - public void forEachOperation(BiConsumer action) { - } - - @Override - public boolean hasMatching(BiFunction matcher) { - return false; - } - } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationOperationGroupSingle.java b/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationOperationGroupSingle.java index 04a0f828ce..fb7779efda 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationOperationGroupSingle.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationOperationGroupSingle.java @@ -6,11 +6,6 @@ */ package org.hibernate.sql.model.internal; -import java.util.Collections; -import java.util.List; -import java.util.function.BiConsumer; -import java.util.function.BiFunction; - import org.hibernate.sql.model.MutationOperation; import org.hibernate.sql.model.MutationTarget; import org.hibernate.sql.model.MutationType; @@ -26,7 +21,10 @@ public class MutationOperationGroupSingle extends AbstractMutationOperationGroup private final JdbcMutationOperation operation; - public MutationOperationGroupSingle(MutationType mutationType, MutationTarget mutationTarget, JdbcMutationOperation operation) { + public MutationOperationGroupSingle( + MutationType mutationType, + MutationTarget mutationTarget, + JdbcMutationOperation operation) { super( mutationType, mutationTarget ); this.operation = operation; } @@ -47,15 +45,12 @@ public class MutationOperationGroupSingle extends AbstractMutationOperationGroup @Override public MutationOperation getOperation(int idx) { - if ( idx != 0 ) throw new IndexOutOfBoundsException( idx ); + if ( idx != 0 ) { + throw new IndexOutOfBoundsException( idx ); + } return operation; } - @Override - public List getOperations() { - return Collections.singletonList( operation ); - } - @Override public MutationOperation getOperation(String tableName) { if ( !tableName.equals( operation.getTableDetails().getTableName() ) ) { @@ -69,14 +64,4 @@ public class MutationOperationGroupSingle extends AbstractMutationOperationGroup return operation; } - @Override - public void forEachOperation(BiConsumer action) { - action.accept( 0, operation ); - } - - @Override - public boolean hasMatching(BiFunction matcher) { - return matcher.apply( 0, operation ); - } - } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationOperationGroupStandard.java b/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationOperationGroupStandard.java index fc0b4273b4..ddf3cc3767 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationOperationGroupStandard.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/model/internal/MutationOperationGroupStandard.java @@ -8,8 +8,6 @@ package org.hibernate.sql.model.internal; import java.util.List; import java.util.Locale; -import java.util.function.BiConsumer; -import java.util.function.BiFunction; import org.hibernate.sql.model.MutationOperation; import org.hibernate.sql.model.MutationTarget; @@ -51,11 +49,6 @@ public class MutationOperationGroupStandard extends AbstractMutationOperationGro return operations.get( idx ); } - @Override - public List getOperations() { - return operations; - } - @Override public MutationOperation getOperation(String tableName) { for ( int i = 0; i < operations.size(); i++ ) { @@ -67,20 +60,4 @@ public class MutationOperationGroupStandard extends AbstractMutationOperationGro return null; } - @Override - public void forEachOperation(BiConsumer action) { - for ( int i = 0; i < operations.size(); i++ ) { - action.accept( i, operations.get( i ) ); - } - } - - @Override - public boolean hasMatching(BiFunction matcher) { - for ( int i = 0; i < operations.size(); i++ ) { - if ( matcher.apply( i, operations.get( i ) ) ) { - return true; - } - } - return false; - } }