add some @Deprecated annotations on the methods that return raw types

This commit is contained in:
Gavin King 2022-01-22 09:48:11 +01:00
parent bab5b2bf99
commit 2f72d76266
3 changed files with 22 additions and 16 deletions

View File

@ -1321,9 +1321,9 @@ public interface Session extends SharedSessionContract, EntityManager {
@Override @Override
<R> Query<R> createQuery(CriteriaQuery<R> criteriaQuery); <R> Query<R> createQuery(CriteriaQuery<R> criteriaQuery);
@Override @Override @Deprecated @SuppressWarnings("rawtypes")
Query createQuery(CriteriaDelete deleteQuery); Query createQuery(CriteriaDelete deleteQuery);
@Override @Override @Deprecated @SuppressWarnings("rawtypes")
Query createQuery(CriteriaUpdate updateQuery); Query createQuery(CriteriaUpdate updateQuery);
} }

View File

@ -28,8 +28,9 @@ public interface QueryProducer {
* Create a {@link Query} instance for the given HQL query, or * Create a {@link Query} instance for the given HQL query, or
* HQL insert, update, or delete statement. * HQL insert, update, or delete statement.
* *
* @apiNote Returns a raw Query reference, as opposed to unbounded (`<?>`), * @apiNote Returns a raw {@code Query} type instead of a wildcard
* to match {@link jakarta.persistence.EntityManager#createQuery(String)} * type {@code Query<?>}, to match the signature of the JPA method
* {@link jakarta.persistence.EntityManager#createQuery(String)}.
* *
* @param queryString The HQL query * @param queryString The HQL query
* *
@ -65,14 +66,18 @@ public interface QueryProducer {
/** /**
* Create a {@link MutationQuery} for the given JPA {@link CriteriaUpdate} * 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); Query createQuery(CriteriaUpdate updateQuery);
/** /**
* Create a {@link MutationQuery} for the given JPA {@link CriteriaDelete} * 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); Query createQuery(CriteriaDelete deleteQuery);
/** /**
@ -175,12 +180,12 @@ public interface QueryProducer {
MutationQuery createMutationQuery(String hqlString); 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); 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); MutationQuery createMutationQuery(@SuppressWarnings("rawtypes") CriteriaDelete deleteQuery);
@ -207,7 +212,8 @@ public interface QueryProducer {
* *
* @see jakarta.persistence.EntityManager#createNamedQuery(String) * @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") @Deprecated(since = "6.0") @SuppressWarnings("rawtypes")
Query createNamedQuery(String name); Query createNamedQuery(String name);

View File

@ -53,16 +53,16 @@ public interface QueryProducerImplementor extends QueryProducer {
@Override @Override
<R> NativeQueryImplementor<R> createNativeQuery(String sqlString, Class<R> resultClass, String tableAlias); <R> NativeQueryImplementor<R> createNativeQuery(String sqlString, Class<R> resultClass, String tableAlias);
@Override @SuppressWarnings("rawtypes") @Override @Deprecated @SuppressWarnings("rawtypes")
NativeQueryImplementor createNativeQuery(String sqlString, String resultSetMappingName); NativeQueryImplementor createNativeQuery(String sqlString, String resultSetMappingName);
@Override @Override
<R> NativeQueryImplementor<R> createNativeQuery(String sqlString, String resultSetMappingName, Class<R> resultClass); <R> NativeQueryImplementor<R> createNativeQuery(String sqlString, String resultSetMappingName, Class<R> resultClass);
@Override @SuppressWarnings("rawtypes") @Override @Deprecated @SuppressWarnings("rawtypes")
NativeQueryImplementor getNamedNativeQuery(String name); NativeQueryImplementor getNamedNativeQuery(String name);
@Override @SuppressWarnings("rawtypes") @Override @Deprecated @SuppressWarnings("rawtypes")
NativeQueryImplementor getNamedNativeQuery(String name, String resultSetMapping); NativeQueryImplementor getNamedNativeQuery(String name, String resultSetMapping);
@Override @Override
@ -83,9 +83,9 @@ public interface QueryProducerImplementor extends QueryProducer {
@Override @Override
<R> QueryImplementor<R> createQuery(CriteriaQuery<R> criteriaQuery); <R> QueryImplementor<R> createQuery(CriteriaQuery<R> criteriaQuery);
@Override @Override @Deprecated @SuppressWarnings("rawtypes")
QueryImplementor createQuery(@SuppressWarnings("rawtypes") CriteriaUpdate updateQuery); QueryImplementor createQuery(CriteriaUpdate updateQuery);
@Override @Override @Deprecated @SuppressWarnings("rawtypes")
QueryImplementor createQuery(@SuppressWarnings("rawtypes") CriteriaDelete deleteQuery); QueryImplementor createQuery(CriteriaDelete deleteQuery);
} }