Class Select


public class Select extends Sql
The class extends Sql and aims to represnt and define an instance of sql code "SELECT FROM WHERE" plus other common clauses like "GROUP BY", "HAVING" and "ORDER BY".
  • Field Details

  • Constructor Details

    • Select

      public Select()
      The class's constructor that sets the structure of each single clause (as Fragment) SELECT, FROM, WHERE, GROUP BY ecc.
      For example the SELECT Clause has the "," separator between two fields and the same for the FROM Clause. For the WHERE clause, instead, the separator between one clause and the other, inside it, is an empty string (because the clauses themselves will define the AND / OR conditions).
    • Select

      public Select(boolean distinct)
      The class's constructor that sets the structure of each single clause (as Fragment) SELECT, FROM, WHERE, GROUP BY ecc.
      The SELECT Clause can be structured with the DISTINCT keyword.
      For example the SELECT Clause has the "," separator between two fields and the same for the FROM Clause. For the WHERE clause, instead, the separator between one clause and the other, inside it, is an empty string (because the clauses themselves will define the AND / OR conditions).
      Parameters:
      distinct - true if you want to add the DISTINCT keyword to the SELECT clause, false otherwise.
  • Method Details

    • select

      public FragmentSequence select()
      Gets the current SELECT statement.
      Returns:
      The current SELECT statement.
    • from

      public FragmentSequence from()
      Gets the current FROM statement.
      Returns:
      The current FROM statement.
    • where

      public Condition where()
      Gets the current WHERE statement.
      Returns:
      The current WHERE statement.
    • groupBy

      public FragmentSequence groupBy()
      Gets the current GROUP BY statement.
      Returns:
      The current GROUP BY statement.
    • having

      public Condition having()
      Gets the current HAVING statement.
      Returns:
      The current HAVING statement.
    • orderBy

      public FragmentSequence orderBy()
      Gets the current ORDER BY statement.
      Returns:
      The current ORDER BY statement.