From de927ce547463a431d218c33d1801c9dfa2e8165 Mon Sep 17 00:00:00 2001 From: Furkan Kamaci Date: Thu, 20 Feb 2014 14:10:58 +0200 Subject: [PATCH] HHH-8989 Logic mismatch between AbstractQueryImpl and LimitHelper for setMaxResults(0) is fixed. --- .../main/java/org/hibernate/internal/AbstractQueryImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/internal/AbstractQueryImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/AbstractQueryImpl.java index 8b76fc3b1b..2b8b29bb24 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/AbstractQueryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/AbstractQueryImpl.java @@ -222,8 +222,8 @@ public abstract class AbstractQueryImpl implements Query { @Override public Query setMaxResults(int maxResults) { - if ( maxResults < 0 ) { - // treat negatives specically as meaning no limit... + if ( maxResults <= 0 ) { + // treat zero and negatives specically as meaning no limit... selection.setMaxRows( null ); } else {