Record Class PaginationJdbcInstructions
java.lang.Object
java.lang.Record
org.hibernate.dialect.pagination.spi.PaginationJdbcInstructions
- Record Components:
parametersAtStart- integer pagination values bound before original query parametersparametersAtEnd- integer pagination values bound after original query parametersmaxRows- JDBC maximum rows, ornullwhen no JDBC maximum is neededrowsToSkip- rows Hibernate must skip in the returned result set
@SPI
public record PaginationJdbcInstructions(List<Integer> parametersAtStart, List<Integer> parametersAtEnd, @Nullable Integer maxRows, int rowsToSkip)
extends Record
Immutable JDBC execution instructions produced by a LimitHandler together
with paginated SQL.
Hibernate binds parametersAtStart in list order, then the query's original
parameters, and then parametersAtEnd in list order. It applies maxRows
through PreparedStatement.setMaxRows() and advances rowsToSkip rows in
the result set. A handler must encode each responsibility exactly once; for
example, an offset represented in SQL must not also be returned as rows to
skip.
- Since:
- 8.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PaginationJdbcInstructionsNo additional pagination parameters or JDBC/result-set work. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.maxRows()Returns the value of themaxRowsrecord component.intOne-based position of the first original query parameter after pagination parameters inserted at the start.Returns the value of theparametersAtEndrecord component.Returns the value of theparametersAtStartrecord component.intReturns the value of therowsToSkiprecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
No additional pagination parameters or JDBC/result-set work.
-
-
Constructor Details
-
PaginationJdbcInstructions
public PaginationJdbcInstructions(List<Integer> parametersAtStart, List<Integer> parametersAtEnd, @Nullable Integer maxRows, int rowsToSkip) Creates an instance of aPaginationJdbcInstructionsrecord class.- Parameters:
parametersAtStart- the value for theparametersAtStartrecord componentparametersAtEnd- the value for theparametersAtEndrecord componentmaxRows- the value for themaxRowsrecord componentrowsToSkip- the value for therowsToSkiprecord component
-
-
Method Details
-
parameterPositionStart
public int parameterPositionStart()One-based position of the first original query parameter after pagination parameters inserted at the start. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
parametersAtStart
Returns the value of theparametersAtStartrecord component.- Returns:
- the value of the
parametersAtStartrecord component
-
parametersAtEnd
Returns the value of theparametersAtEndrecord component.- Returns:
- the value of the
parametersAtEndrecord component
-
maxRows
-
rowsToSkip
public int rowsToSkip()Returns the value of therowsToSkiprecord component.- Returns:
- the value of the
rowsToSkiprecord component
-