diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionDelegatorBaseImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionDelegatorBaseImpl.java index 441f3d63e8..adc4f8c69b 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionDelegatorBaseImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionDelegatorBaseImpl.java @@ -42,7 +42,6 @@ import org.hibernate.jdbc.ReturningWork; import org.hibernate.jdbc.Work; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.procedure.ProcedureCall; -import org.hibernate.query.MutationNativeQuery; import org.hibernate.query.MutationQuery; import org.hibernate.query.SelectionQuery; import org.hibernate.query.criteria.HibernateCriteriaBuilder; @@ -551,7 +550,7 @@ public class SessionDelegatorBaseImpl implements SessionImplementor { } @Override - public MutationNativeQuery createNativeMutationQuery(String sqlString) { + public MutationQuery createNativeMutationQuery(String sqlString) { return delegate.createNativeMutationQuery( sqlString ); } diff --git a/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java b/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java index 0497ba3791..7162e46f10 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java @@ -54,7 +54,6 @@ import org.hibernate.procedure.spi.NamedCallableQueryMemento; import org.hibernate.query.IllegalMutationQueryException; import org.hibernate.query.IllegalNamedQueryOptionsException; import org.hibernate.query.JpaQuery; -import org.hibernate.query.MutationNativeQuery; import org.hibernate.query.MutationQuery; import org.hibernate.query.SelectionQuery; import org.hibernate.query.UnknownNamedQueryException; @@ -976,7 +975,7 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont } @Override - public MutationNativeQuery createNativeMutationQuery(String sqlString) { + public MutationQuery createNativeMutationQuery(String sqlString) { final NativeQueryImplementor query = createNativeQuery( sqlString ); if ( query.isSelectQuery() == TRUE ) { throw new IllegalMutationQueryException( "Expecting a native mutation query, but found `" + sqlString + "`" ); diff --git a/hibernate-core/src/main/java/org/hibernate/query/MutationNativeQuery.java b/hibernate-core/src/main/java/org/hibernate/query/MutationNativeQuery.java deleted file mode 100644 index 029670a57c..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/query/MutationNativeQuery.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * License: GNU Lesser General Public License (LGPL), version 2.1 or later - * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html - */ -package org.hibernate.query; - -import java.time.Instant; -import java.util.Calendar; -import java.util.Collection; -import java.util.Date; -import java.util.Map; - -import org.hibernate.FlushMode; - -import jakarta.persistence.Parameter; -import jakarta.persistence.TemporalType; - -/** - * @author Steve Ebersole - */ -public interface MutationNativeQuery extends MutationQuery { - @Override - MutationNativeQuery setParameter(String name, Object value); - - @Override -

MutationNativeQuery setParameter(String name, P value, Class

type); - - @Override -

MutationNativeQuery setParameter(String name, P value, BindableType

type); - - @Override - MutationNativeQuery setParameter(String name, Instant value, TemporalType temporalType); - - @Override - MutationNativeQuery setParameter(String name, Calendar value, TemporalType temporalType); - - @Override - MutationNativeQuery setParameter(String name, Date value, TemporalType temporalType); - - @Override - MutationNativeQuery setParameter(int position, Object value); - - @Override -

MutationNativeQuery setParameter(int position, P value, Class

type); - - @Override -

MutationNativeQuery setParameter(int position, P value, BindableType

type); - - @Override - MutationNativeQuery setParameter(int position, Instant value, TemporalType temporalType); - - @Override - MutationNativeQuery setParameter(int position, Date value, TemporalType temporalType); - - @Override - MutationNativeQuery setParameter(int position, Calendar value, TemporalType temporalType); - - @Override - MutationNativeQuery setParameter(QueryParameter parameter, T value); - - @Override -

MutationNativeQuery setParameter(QueryParameter

parameter, P value, Class

type); - - @Override -

MutationNativeQuery setParameter(QueryParameter

parameter, P val, BindableType

type); - - @Override - MutationNativeQuery setParameter(Parameter param, T value); - - @Override - MutationNativeQuery setParameter(Parameter param, Calendar value, TemporalType temporalType); - - @Override - MutationNativeQuery setParameter(Parameter param, Date value, TemporalType temporalType); - - @Override - MutationNativeQuery setParameterList(String name, @SuppressWarnings("rawtypes") Collection values); - - @Override -

MutationNativeQuery setParameterList(String name, Collection values, Class

javaType); - - @Override -

MutationNativeQuery setParameterList(String name, Collection values, BindableType

type); - - @Override - MutationNativeQuery setParameterList(String name, Object[] values); - - @Override -

MutationNativeQuery setParameterList(String name, P[] values, Class

javaType); - - @Override -

MutationNativeQuery setParameterList(String name, P[] values, BindableType

type); - - @Override - MutationNativeQuery setParameterList(int position, @SuppressWarnings("rawtypes") Collection values); - - @Override -

MutationNativeQuery setParameterList(int position, Collection values, Class

javaType); - - @Override -

MutationNativeQuery setParameterList(int position, Collection values, BindableType

type); - - @Override - MutationNativeQuery setParameterList(int position, Object[] values); - - @Override -

MutationNativeQuery setParameterList(int position, P[] values, Class

javaType); - - @Override -

MutationNativeQuery setParameterList(int position, P[] values, BindableType

type); - - @Override -

MutationNativeQuery setParameterList(QueryParameter

parameter, Collection values); - - @Override -

MutationNativeQuery setParameterList(QueryParameter

parameter, Collection values, Class

javaType); - - @Override -

MutationNativeQuery setParameterList(QueryParameter

parameter, Collection values, BindableType

type); - - @Override -

MutationNativeQuery setParameterList(QueryParameter

parameter, P[] values); - - @Override -

MutationNativeQuery setParameterList(QueryParameter

parameter, P[] values, Class

javaType); - - @Override -

MutationNativeQuery setParameterList(QueryParameter

parameter, P[] values, BindableType

type); - - @Override - MutationNativeQuery setProperties(Object bean); - - @Override - MutationNativeQuery setProperties(Map bean); - - @Override - MutationNativeQuery setHibernateFlushMode(FlushMode flushMode); - - @Override - MutationNativeQuery setTimeout(int timeout); -} diff --git a/hibernate-core/src/main/java/org/hibernate/query/NativeQuery.java b/hibernate-core/src/main/java/org/hibernate/query/NativeQuery.java index 284456842f..6b723ff07f 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/NativeQuery.java +++ b/hibernate-core/src/main/java/org/hibernate/query/NativeQuery.java @@ -62,7 +62,7 @@ import org.hibernate.type.BasicTypeReference; * @author Gavin King * @author Steve Ebersole */ -public interface NativeQuery extends Query, MutationNativeQuery, SynchronizeableQuery { +public interface NativeQuery extends Query, SynchronizeableQuery { /** * Declare a scalar query result. Hibernate will attempt to automatically * detect the underlying type. diff --git a/hibernate-core/src/main/java/org/hibernate/query/Query.java b/hibernate-core/src/main/java/org/hibernate/query/Query.java index 89ffffee30..f7f8ee8457 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/Query.java +++ b/hibernate-core/src/main/java/org/hibernate/query/Query.java @@ -48,7 +48,7 @@ import jakarta.persistence.TypedQuery; * @param The query result type, for typed queries, or {@code Object} for untyped queries */ @Incubating -public interface Query extends SelectionQuery, JpaQuery, TypedQuery { +public interface Query extends SelectionQuery, MutationQuery, JpaQuery, TypedQuery { /** * Execute the query and return the query results as a {@link List}. diff --git a/hibernate-core/src/main/java/org/hibernate/query/QueryProducer.java b/hibernate-core/src/main/java/org/hibernate/query/QueryProducer.java index 88e2d8e4b8..98d69a2e1f 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/QueryProducer.java +++ b/hibernate-core/src/main/java/org/hibernate/query/QueryProducer.java @@ -204,7 +204,7 @@ public interface QueryProducer { * * @return The NativeQuery instance for manipulation and execution */ - MutationNativeQuery createNativeMutationQuery(String sqlString); + MutationQuery createNativeMutationQuery(String sqlString); /** * Create a `MutationQuery` from the given update criteria tree diff --git a/hibernate-core/src/main/java/org/hibernate/query/spi/QueryProducerImplementor.java b/hibernate-core/src/main/java/org/hibernate/query/spi/QueryProducerImplementor.java index 99d0647005..9d828ac70b 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/spi/QueryProducerImplementor.java +++ b/hibernate-core/src/main/java/org/hibernate/query/spi/QueryProducerImplementor.java @@ -9,7 +9,6 @@ package org.hibernate.query.spi; import org.hibernate.CacheMode; import org.hibernate.FlushMode; import org.hibernate.engine.spi.SessionFactoryImplementor; -import org.hibernate.query.MutationNativeQuery; import org.hibernate.query.MutationQuery; import org.hibernate.query.QueryProducer; import org.hibernate.query.sql.spi.NativeQueryImplementor; @@ -75,7 +74,7 @@ public interface QueryProducerImplementor extends QueryProducer { MutationQuery createNamedMutationQuery(String name); @Override - MutationNativeQuery createNativeMutationQuery(String sqlString); + MutationQuery createNativeMutationQuery(String sqlString); @Override MutationQuery createMutationQuery(@SuppressWarnings("rawtypes") CriteriaUpdate updateQuery);