From 66802a70c152e81bb8ecfab601b6e7b0f9c193a0 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Mon, 2 May 2016 12:22:08 -0500 Subject: [PATCH] HHH-10664 - Prep 6.0 feature branch - merge hibernate-entitymanager into hibernate-core (fix test failures) --- .../hibernate/engine/spi/RowSelection.java | 19 ++++++++++++++++--- .../procedure/internal/ProcedureCallImpl.java | 1 - .../query/internal/AbstractProducedQuery.java | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/RowSelection.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/RowSelection.java index a52b1c0ed1..75a62c50ae 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/RowSelection.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/RowSelection.java @@ -17,6 +17,10 @@ public final class RowSelection { private Integer timeout; private Integer fetchSize; + public void setFirstRow(Integer firstRow) { + this.firstRow = firstRow; + } + public void setFirstRow(int firstRow) { this.firstRow = firstRow; } @@ -25,6 +29,10 @@ public final class RowSelection { return firstRow; } + public void setMaxRows(Integer maxRows) { + this.maxRows = maxRows; + } + public void setMaxRows(int maxRows) { this.maxRows = maxRows; } @@ -33,6 +41,10 @@ public final class RowSelection { return maxRows; } + public void setTimeout(Integer timeout) { + this.timeout = timeout; + } + public void setTimeout(int timeout) { this.timeout = timeout; } @@ -45,6 +57,10 @@ public final class RowSelection { return fetchSize; } + public void setFetchSize(Integer fetchSize) { + this.fetchSize = fetchSize; + } + public void setFetchSize(int fetchSize) { this.fetchSize = fetchSize; } @@ -53,7 +69,4 @@ public final class RowSelection { return maxRows != null || (firstRow != null && firstRow <= 0); } - public void unsetMaxRows() { - maxRows = null; - } } diff --git a/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java b/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java index 9900860a43..4d8fcb9777 100644 --- a/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java @@ -594,7 +594,6 @@ public class ProcedureCallImpl @Override public ProcedureCallImplementor registerStoredProcedureParameter(int position, Class type, ParameterMode mode) { getProducer().checkOpen( true ); - getProducer().checkOpen( true ); try { registerParameter( (ParameterRegistrationImplementor) registerParameter( position, type, mode ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/query/internal/AbstractProducedQuery.java b/hibernate-core/src/main/java/org/hibernate/query/internal/AbstractProducedQuery.java index 93b12616da..fca1b9c9c2 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/internal/AbstractProducedQuery.java +++ b/hibernate-core/src/main/java/org/hibernate/query/internal/AbstractProducedQuery.java @@ -629,7 +629,7 @@ public abstract class AbstractProducedQuery implements QueryImplementor { public QueryImplementor setMaxResults(int maxResult) { if ( maxResult <= 0 ) { // treat zero and negatives specially as meaning no limit... - queryOptions.unsetMaxRows(); + queryOptions.setMaxRows( null ); } else { queryOptions.setMaxRows( maxResult );