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
<R> Query<R> createQuery(CriteriaQuery<R> criteriaQuery);
@Override
@Override @Deprecated @SuppressWarnings("rawtypes")
Query createQuery(CriteriaDelete deleteQuery);
@Override
@Override @Deprecated @SuppressWarnings("rawtypes")
Query createQuery(CriteriaUpdate updateQuery);
}

View File

@ -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);

View File

@ -53,16 +53,16 @@ public interface QueryProducerImplementor extends QueryProducer {
@Override
<R> NativeQueryImplementor<R> createNativeQuery(String sqlString, Class<R> resultClass, String tableAlias);
@Override @SuppressWarnings("rawtypes")
@Override @Deprecated @SuppressWarnings("rawtypes")
NativeQueryImplementor createNativeQuery(String sqlString, String resultSetMappingName);
@Override
<R> NativeQueryImplementor<R> createNativeQuery(String sqlString, String resultSetMappingName, Class<R> 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
<R> QueryImplementor<R> createQuery(CriteriaQuery<R> 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);
}