Class PageableQueryValidator

java.lang.Object
org.eclipse.persistence.jpa.rs.features.paging.PageableQueryValidator

public final class PageableQueryValidator extends Object
Finds out if a named query is pageable and validates paging parameters.
Author:
Dmitry Kornilov
  • Constructor Details

    • PageableQueryValidator

      public PageableQueryValidator(PersistenceContext context, String queryName, jakarta.ws.rs.core.UriInfo uri)
      Creates a validator.
      Parameters:
      context - persistence context
      queryName - query name to validate
      uri - request uri
  • Method Details

    • isFeatureApplicable

      public boolean isFeatureApplicable() throws JPARSException
      Checks if request is valid.
      Returns:
      true if request is valid and supports pagination, false if request is valid but doesn't support pagination
      Throws:
      JPARSException - in case of any validation errors
    • getOffset

      public int getOffset()
      Returns a value of Offset paging parameter. The value is available only after calling checkParameters method.
      Returns:
      the Offset value.
    • getLimit

      public int getLimit()
      Returns a value of Limit paging parameter. The value is available only after calling checkParameters method.
      Returns:
      the Limit value.