diff --git a/hibernate-core/src/main/java/org/hibernate/Session.java b/hibernate-core/src/main/java/org/hibernate/Session.java index 36656d3781..381444c89b 100644 --- a/hibernate-core/src/main/java/org/hibernate/Session.java +++ b/hibernate-core/src/main/java/org/hibernate/Session.java @@ -1321,9 +1321,9 @@ public interface Session extends SharedSessionContract, EntityManager { @Override Query createQuery(CriteriaQuery criteriaQuery); - @Override + @Override @Deprecated @SuppressWarnings("rawtypes") Query createQuery(CriteriaDelete deleteQuery); - @Override + @Override @Deprecated @SuppressWarnings("rawtypes") Query createQuery(CriteriaUpdate updateQuery); } 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 ac0d782cc1..4fb59d9bde 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/QueryProducer.java +++ b/hibernate-core/src/main/java/org/hibernate/query/QueryProducer.java @@ -28,8 +28,9 @@ public interface QueryProducer { * Create a {@link Query} instance for the given HQL query, or * HQL insert, update, or delete statement. * - * @apiNote Returns a raw Query reference, as opposed to unbounded (``), - * to match {@link jakarta.persistence.EntityManager#createQuery(String)} + * @apiNote Returns a raw {@code Query} type instead of a wildcard + * type {@code Query}, to match the signature of the JPA method + * {@link jakarta.persistence.EntityManager#createQuery(String)}. * * @param queryString The HQL query * @@ -65,14 +66,18 @@ public interface QueryProducer { /** * Create a {@link MutationQuery} for the given JPA {@link CriteriaUpdate} + * + * @deprecated use {@link #createMutationQuery(CriteriaUpdate)} */ - @SuppressWarnings("rawtypes") + @Deprecated(since = "6.0") @SuppressWarnings("rawtypes") Query createQuery(CriteriaUpdate updateQuery); /** * Create a {@link MutationQuery} for the given JPA {@link CriteriaDelete} + * + * @deprecated use {@link #createMutationQuery(CriteriaDelete)} */ - @SuppressWarnings("rawtypes") + @Deprecated(since = "6.0") @SuppressWarnings("rawtypes") Query createQuery(CriteriaDelete deleteQuery); /** @@ -175,12 +180,12 @@ public interface QueryProducer { MutationQuery createMutationQuery(String hqlString); /** - * Create a `MutationQuery` from the given update criteria tree + * Create a {@link MutationQuery} from the given update criteria tree */ MutationQuery createMutationQuery(@SuppressWarnings("rawtypes") CriteriaUpdate updateQuery); /** - * Create a `MutationQuery` from the given delete criteria tree + * Create a {@link MutationQuery} from the given delete criteria tree */ MutationQuery createMutationQuery(@SuppressWarnings("rawtypes") CriteriaDelete deleteQuery); @@ -207,7 +212,8 @@ public interface QueryProducer { * * @see jakarta.persistence.EntityManager#createNamedQuery(String) * - * @deprecated use {@link #createNamedQuery(String, Class)} or {@link #createNamedMutationQuery(String)} + * @deprecated use {@link #createNamedQuery(String, Class)} or + * {@link #createNamedMutationQuery(String)} */ @Deprecated(since = "6.0") @SuppressWarnings("rawtypes") Query createNamedQuery(String name); 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 09dc25f39d..bc4d1bf984 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 @@ -53,16 +53,16 @@ public interface QueryProducerImplementor extends QueryProducer { @Override NativeQueryImplementor createNativeQuery(String sqlString, Class resultClass, String tableAlias); - @Override @SuppressWarnings("rawtypes") + @Override @Deprecated @SuppressWarnings("rawtypes") NativeQueryImplementor createNativeQuery(String sqlString, String resultSetMappingName); @Override NativeQueryImplementor createNativeQuery(String sqlString, String resultSetMappingName, Class resultClass); - @Override @SuppressWarnings("rawtypes") + @Override @Deprecated @SuppressWarnings("rawtypes") NativeQueryImplementor getNamedNativeQuery(String name); - @Override @SuppressWarnings("rawtypes") + @Override @Deprecated @SuppressWarnings("rawtypes") NativeQueryImplementor getNamedNativeQuery(String name, String resultSetMapping); @Override @@ -83,9 +83,9 @@ public interface QueryProducerImplementor extends QueryProducer { @Override QueryImplementor createQuery(CriteriaQuery criteriaQuery); - @Override - QueryImplementor createQuery(@SuppressWarnings("rawtypes") CriteriaUpdate updateQuery); + @Override @Deprecated @SuppressWarnings("rawtypes") + QueryImplementor createQuery(CriteriaUpdate updateQuery); - @Override - QueryImplementor createQuery(@SuppressWarnings("rawtypes") CriteriaDelete deleteQuery); + @Override @Deprecated @SuppressWarnings("rawtypes") + QueryImplementor createQuery(CriteriaDelete deleteQuery); }