Package overit.geocall.sql.code
Class Select
java.lang.Object
overit.geocall.sql.code.fragment.Fragment
overit.geocall.sql.code.fragment.FragmentSequence
overit.geocall.sql.code.Sql
overit.geocall.sql.code.Select
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 Summary
FieldsModifier and TypeFieldDescriptionprotected FragmentSequenceprotected FragmentSequenceprotected Conditionprotected FragmentSequenceprotected FragmentSequenceprotected ConditionFields inherited from class overit.geocall.sql.code.fragment.FragmentSequence
_fragments, _prefix, _separator, _suffixFields inherited from class overit.geocall.sql.code.fragment.Fragment
_criterion -
Constructor Summary
ConstructorsConstructorDescriptionSelect()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.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. -
Method Summary
Modifier and TypeMethodDescriptionfrom()Gets the current FROM statement.groupBy()Gets the current GROUP BY statement.having()Gets the current HAVING statement.orderBy()Gets the current ORDER BY statement.select()Gets the current SELECT statement.where()Gets the current WHERE statement.Methods inherited from class overit.geocall.sql.code.fragment.FragmentSequence
add, add, appendTo, clear, get, sizeMethods inherited from class overit.geocall.sql.code.fragment.Fragment
getCriterion, overlapCriterion, replaceCriterion, toString
-
Field Details
-
_selects
-
_froms
-
_wheres
-
_groupBys
-
_havings
-
_orderBys
-
-
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-trueif you want to add the DISTINCT keyword to the SELECT clause,falseotherwise.
-
-
Method Details
-
select
Gets the current SELECT statement.- Returns:
- The current SELECT statement.
-
from
Gets the current FROM statement.- Returns:
- The current FROM statement.
-
where
Gets the current WHERE statement.- Returns:
- The current WHERE statement.
-
groupBy
Gets the current GROUP BY statement.- Returns:
- The current GROUP BY statement.
-
having
Gets the current HAVING statement.- Returns:
- The current HAVING statement.
-
orderBy
Gets the current ORDER BY statement.- Returns:
- The current ORDER BY statement.
-