diff --git a/hibernate-core/src/main/java/org/hibernate/Query.java b/hibernate-core/src/main/java/org/hibernate/Query.java index 78bb95b91d..8244ba3173 100644 --- a/hibernate-core/src/main/java/org/hibernate/Query.java +++ b/hibernate-core/src/main/java/org/hibernate/Query.java @@ -423,10 +423,6 @@ public interface Query extends TypedQuery, CommonQueryContract { */ List list(); - default List getResultList() { - return list(); - } - /** * Convenience method to return a single instance that matches * the query, or {@code null} if the query returns no results. @@ -437,10 +433,6 @@ public interface Query extends TypedQuery, CommonQueryContract { */ R uniqueResult(); - default R getSingleResult() { - return uniqueResult(); - } - /** * Access to information about query parameters. * 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 3c82703a53..593176e279 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/Query.java +++ b/hibernate-core/src/main/java/org/hibernate/query/Query.java @@ -16,6 +16,7 @@ import java.time.ZonedDateTime; import java.util.Calendar; import java.util.Collection; import java.util.Date; +import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Optional; @@ -31,6 +32,8 @@ import org.hibernate.FlushMode; import org.hibernate.Incubating; import org.hibernate.LockMode; import org.hibernate.LockOptions; +import org.hibernate.ScrollMode; +import org.hibernate.ScrollableResults; import org.hibernate.engine.spi.RowSelection; import org.hibernate.transform.ResultTransformer; import org.hibernate.type.BigDecimalType; @@ -89,7 +92,7 @@ public interface Query extends TypedQuery, org.hibernate.Query, CommonQ * Retrieve a Stream over the query results. *

* In the initial implementation (5.2) this returns a simple sequential Stream. The plan - * is to return a a smarter stream in 6.0 leveraging the SQM model. + * is to return a a smarter stream in 6.x leveraging the SQM model. * *

* @@ -128,8 +131,55 @@ public interface Query extends TypedQuery, org.hibernate.Query, CommonQ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // covariant overrides + // Overrides for methods we do not want deprecated + @Override + ScrollableResults scroll(); + + @Override + ScrollableResults scroll(ScrollMode scrollMode); + + @Override + List list(); + + default List getResultList() { + return list(); + } + + @Override + R uniqueResult(); + + default R getSingleResult() { + return uniqueResult(); + } + + @Override + FlushMode getHibernateFlushMode(); + + @Override + CacheMode getCacheMode(); + + @Override + String getCacheRegion(); + + @Override + Integer getFetchSize(); + + @Override + LockOptions getLockOptions(); + + @Override + String getComment(); + + @Override + String getQueryString(); + + @Override + ParameterMetadata getParameterMetadata(); + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + // covariant overrides @Override Query setMaxResults(int maxResult);