Class Paginated

java.lang.Object
com.github.fabriciofx.cactoos.jdbc.query.Paginated
All Implemented Interfaces:
Query, org.cactoos.Text

public final class Paginated extends Object implements Query
Paginated query.
Since:
0.8.0
  • Constructor Details

    • Paginated

      public Paginated(Query qury, int max, int skip)
      Ctor.
      Parameters:
      qury - The query that retrieves all elements
      max - The maximum amount of elements per page
      skip - Skip the first nth elements
  • Method Details

    • prepared

      public PreparedStatement prepared(Connection connection) throws Exception
      Description copied from interface: Query
      Create a PreparedStatement.
      Specified by:
      prepared in interface Query
      Parameters:
      connection - A connection to the DataSource
      Returns:
      A PreparedStatement
      Throws:
      Exception - If fails
    • params

      public Params params()
      Description copied from interface: Query
      Return the Query params.
      Specified by:
      params in interface Query
      Returns:
      The query parameters
    • named

      public String named()
      Description copied from interface: Query
      Return a named query string.
      Specified by:
      named in interface Query
      Returns:
      A named query string
    • asString

      public String asString() throws Exception
      Specified by:
      asString in interface org.cactoos.Text
      Throws:
      Exception