Class JpaPagination

java.lang.Object
org.europa.together.domain.JpaPagination

public class JpaPagination extends Object
Be always aware, when using listAll() because some database tables with a giant amount of rows will slow down your application dramatically. The JpaPagination is designed to limit your result set. It avoid a slow performing OFFSET and implement instead the seek method.
To secure a correct result set, the results aer by default sorted by the primary key of the database table in an ascending manner. This behavior can be changed.
Its necessary to define the Primary Key from the Domain Object and not from the database table name.
  • Field Details

  • Constructor Details

    • JpaPagination

      public JpaPagination()
      Default Constructor.
    • JpaPagination

      public JpaPagination(String primaryKey)
      Allow to set the PrimaryKey (PK) of the database table. Be aware, that the PK is not the colum name of the table. The PK is defined by Domain Object is used.
      Parameters:
      primaryKey - as String
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getPageSize

      public int getPageSize()
      get the amount of elements will be placed on a page.
      Returns:
      pageSize as Integer
    • setPageSize

      public void setPageSize(int limit)
      Define the amount of elements will be placed on a page.
      Parameters:
      limit - as Integer
    • getSorting

      public String getSorting()
      Get if the sorting is DESC or ASC.
      Returns:
      sorting as String
    • setSorting

      public void setSorting(String ordering)
      Define if the sorting is DESC or ASC.
      Parameters:
      ordering - as String
    • getPaging

      public String getPaging()
      Get the direction (forward or backward) of the paging.
      Returns:
      paging as String
    • setPaging

      public void setPaging(String direction)
      Define the direction (forward or backward) of the paging.
      Parameters:
      direction - as String
    • getPrimaryKey

      public String getPrimaryKey()
      Get the defined primarey key of the Domain Object.
      Returns:
      primaryKey as String
    • setPrimaryKey

      public void setPrimaryKey(String primaryKey)
      Set the primarey key of the Domain Object.
      Parameters:
      primaryKey - as String
    • getPageBreak

      public String getPageBreak()
      Get the pivot element, where the page break occur.
      Returns:
      peageBreak as String
    • setPageBreak

      public void setPageBreak(String pageBreak)
      Define the pivot element, where the page break occur.
      Parameters:
      pageBreak - as String
    • getAdditionalOrdering

      public String getAdditionalOrdering()
      Get the 2 nd parameter, besides the primarey key for ordering the result set.
      Returns:
      additionalOrdering as String
    • setAdditionalOrdering

      public void setAdditionalOrdering(String additionalOrdering)
      Set the 2 nd parameter, besides the primarey key for ordering the result set.
      Parameters:
      additionalOrdering - as String
    • getFilterStringCriteria

      public Map<String,String> getFilterStringCriteria()
      Get all String based filters >KEY, Value< to reduce the result set.
      Returns:
      filterStringCriteria as Map
    • setFilterStringCriteria

      public void setFilterStringCriteria(Map<String,String> filterStringCriteria)
      Set all String based filters >KEY, Value< to reduce the result set.
      Parameters:
      filterStringCriteria - as Map
    • getFilterBooleanCriteria

      public Map<String,Boolean> getFilterBooleanCriteria()
      Get all Boolean based filters >KEY, Value< to reduce the result set.
      Returns:
      filterBooleanCriteria as Map
    • setFilterBooleanCriteria

      public void setFilterBooleanCriteria(Map<String,Boolean> filterBooleanCriteria)
      Set all Boolean based filters >KEY, Value< to reduce the result set.
      Parameters:
      filterBooleanCriteria - as Map
    • getFilterIntegerCriteria

      public Map<String,Integer> getFilterIntegerCriteria()
      Get all Integer based filters >KEY, Value< to reduce the result set.
      Returns:
      filterIntegerCriteria as Map
    • setFilterIntegerCriteria

      public void setFilterIntegerCriteria(Map<String,Integer> filterIntegerCriteria)
      Set all Integer based filters >KEY, Value< to reduce the result set.
      Parameters:
      filterIntegerCriteria - as Map
    • getFilterFloatCriteria

      public Map<String,Float> getFilterFloatCriteria()
      Get all Float based filters >KEY, Value< to reduce the result set.
      Returns:
      filterFloatCriteria as Map
    • setFilterFloatCriteria

      public void setFilterFloatCriteria(Map<String,Float> filterFloatCriteria)
      Set all Float based filters >KEY, Value< to reduce the result set.
      Parameters:
      filterFloatCriteria - as Map
    • getFilterDateCriteria

      public Map<String,Date> getFilterDateCriteria()
      Get all Date based filters >KEY, Value< to reduce the result set.
      Returns:
      filterDateCriteria as Map
    • setFilterDateCriteria

      public void setFilterDateCriteria(Map<String,Date> filterDateCriteria)
      Set all Date based filters >KEY, Value< to reduce the result set.
      Parameters:
      filterDateCriteria - as Map