From 21a837fda0d526551bf5ec32b8b7d991170af32f Mon Sep 17 00:00:00 2001 From: Marco Belladelli Date: Tue, 7 Feb 2023 14:24:08 +0100 Subject: [PATCH] HHH-16109 Don't add limits to named queries when not needed --- .../org/hibernate/query/sqm/internal/QuerySqmImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/QuerySqmImpl.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/QuerySqmImpl.java index 9f0482d446..f0479291ae 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/QuerySqmImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/QuerySqmImpl.java @@ -1128,8 +1128,8 @@ public class QuerySqmImpl return new NamedCriteriaQueryMementoImpl( name, sqmStatement, - getFirstResult(), - getMaxResults(), + getQueryOptions().getLimit().getFirstRow(), + getQueryOptions().getLimit().getMaxRows(), isCacheable(), getCacheRegion(), getCacheMode(), @@ -1147,8 +1147,8 @@ public class QuerySqmImpl return new NamedHqlQueryMementoImpl( name, getQueryString(), - getFirstResult(), - getMaxResults(), + getQueryOptions().getLimit().getFirstRow(), + getQueryOptions().getLimit().getMaxRows(), isCacheable(), getCacheRegion(), getCacheMode(),