Class LimitSpec

java.lang.Object
org.litebridge.orm.api.select.model.LimitSpec

public final class LimitSpec extends Object
Specification for limiting and offsetting the results of a database query.

This class contains optional properties for specifying a limit and an offset to control the number of records returned and the starting point for the result set. The limit specifies the maximum number of records to return, while the offset specifies the number of records to skip before starting to return results.

  • Constructor Details

    • LimitSpec

      public LimitSpec()
  • Method Details

    • getLimit

      public Optional<Integer> getLimit()
      Returns the limit as an Optional.
      Returns:
      an optional containing the limit.
    • setLimit

      public void setLimit(@Nullable Integer limit)
      Sets the limit for the query results.
      Parameters:
      limit - the limit to set.
    • getOffset

      public Optional<Integer> getOffset()
      Returns the offset as an Optional.
      Returns:
      an optional containing the offset.
    • setOffset

      public void setOffset(@Nullable Integer offset)
      Sets the offset for the query results.
      Parameters:
      offset - the offset to set.
    • toLimit

      public Optional<Limit> toLimit()
      Converts this specification to a database SPI Limit object.
      Returns:
      an optional containing the SPI limit object.