From 0bf2365955d8813711afdb67e9e0acdf297a17f0 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Fri, 24 Dec 2021 12:36:27 +0100 Subject: [PATCH] fix signature of createQuery(CriteriaUpdate|CriteriaDelete) --- .../engine/spi/SessionDelegatorBaseImpl.java | 8 ++++---- .../internal/AbstractSharedSessionContract.java | 12 ++++++------ .../main/java/org/hibernate/query/QueryProducer.java | 6 ++---- .../query/spi/QueryProducerImplementor.java | 8 ++++---- 4 files changed, 16 insertions(+), 18 deletions(-) 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 a7f0d51d2d..0d97bcd79e 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 @@ -456,13 +456,13 @@ public class SessionDelegatorBaseImpl implements SessionImplementor { return queryDelegate().createQuery( criteriaQuery ); } - @Override @SuppressWarnings("rawtypes") - public QueryImplementor createQuery(CriteriaUpdate updateQuery) { + @Override + public QueryImplementor createQuery(CriteriaUpdate updateQuery) { return queryDelegate().createQuery( updateQuery ); } - @Override @SuppressWarnings("rawtypes") - public QueryImplementor createQuery(CriteriaDelete deleteQuery) { + @Override + public QueryImplementor createQuery(CriteriaDelete deleteQuery) { return queryDelegate().createQuery( deleteQuery ); } 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 52fde00b5e..4e389c84b7 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java @@ -1006,12 +1006,12 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont } } - @Override @SuppressWarnings("rawtypes") - public QueryImplementor createQuery(CriteriaUpdate criteriaUpdate) { + @Override @SuppressWarnings("unchecked") + public QueryImplementor createQuery(@SuppressWarnings("rawtypes") CriteriaUpdate criteriaUpdate) { checkOpen(); try { return new QuerySqmImpl<>( - (SqmUpdateStatement) criteriaUpdate, + (SqmUpdateStatement) criteriaUpdate, null, this ); @@ -1021,12 +1021,12 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont } } - @Override @SuppressWarnings("rawtypes") - public QueryImplementor createQuery(CriteriaDelete criteriaDelete) { + @Override @SuppressWarnings("unchecked") + public QueryImplementor createQuery(@SuppressWarnings("rawtypes") CriteriaDelete criteriaDelete) { checkOpen(); try { return new QuerySqmImpl<>( - (SqmDeleteStatement) criteriaDelete, + (SqmDeleteStatement) criteriaDelete, null, this ); 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 f37748997c..dcac365eca 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/QueryProducer.java +++ b/hibernate-core/src/main/java/org/hibernate/query/QueryProducer.java @@ -171,16 +171,14 @@ public interface QueryProducer { * * @see jakarta.persistence.EntityManager#createQuery(CriteriaUpdate) */ - @SuppressWarnings("rawtypes") - Query createQuery(CriteriaUpdate updateQuery); + Query createQuery(@SuppressWarnings("rawtypes") CriteriaUpdate updateQuery); /** * Create a Query for the given JPA {@link CriteriaDelete} * * @see jakarta.persistence.EntityManager#createQuery(CriteriaDelete) */ - @SuppressWarnings("rawtypes") - Query createQuery(CriteriaDelete deleteQuery); + Query createQuery(@SuppressWarnings("rawtypes") CriteriaDelete deleteQuery); /** * Create a {@link Query} instance for the named query. 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 8142e9d22a..57b87dd9e0 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 @@ -68,9 +68,9 @@ public interface QueryProducerImplementor extends QueryProducer { @Override QueryImplementor createQuery(CriteriaQuery criteriaQuery); - @Override @SuppressWarnings("rawtypes") - QueryImplementor createQuery(CriteriaUpdate updateQuery); + @Override + QueryImplementor createQuery(@SuppressWarnings("rawtypes") CriteriaUpdate updateQuery); - @Override @SuppressWarnings("rawtypes") - QueryImplementor createQuery(CriteriaDelete deleteQuery); + @Override + QueryImplementor createQuery(@SuppressWarnings("rawtypes") CriteriaDelete deleteQuery); }