Class SelectBuilder
java.lang.Object
org.eclipse.dirigible.database.sql.builders.AbstractSqlBuilder
org.eclipse.dirigible.database.sql.builders.AbstractQuerySqlBuilder
org.eclipse.dirigible.database.sql.builders.records.SelectBuilder
- All Implemented Interfaces:
ISqlBuilder,ISqlKeywords
The Select Builder.
-
Field Summary
Fields inherited from interface org.eclipse.dirigible.database.sql.ISqlKeywords
ALTER, CLOSE, COMMA, DOT, EQUALS, FUNCTION_CURRENT_DATE, FUNCTION_CURRENT_TIME, FUNCTION_CURRENT_TIMESTAMP, KEYWORD_ADD, KEYWORD_ALTER, KEYWORD_AND, KEYWORD_AS, KEYWORD_ASC, KEYWORD_CHECK, KEYWORD_COLUMN, KEYWORD_COLUMNSTORE, KEYWORD_CONSTRAINT, KEYWORD_CREATE, KEYWORD_DATA, KEYWORD_DATABASE_DROP_CASCADE, KEYWORD_DATABASE_DROP_RESTRICT, KEYWORD_DELETE, KEYWORD_DESC, KEYWORD_DISTINCT, KEYWORD_DROP, KEYWORD_DYNAMIC, KEYWORD_EVENT, KEYWORD_EXTERNAL, KEYWORD_FETCH, KEYWORD_FOR, KEYWORD_FOR_UPDATE, KEYWORD_FOREIGN, KEYWORD_FROM, KEYWORD_FULL, KEYWORD_GLOBAL_TEMPORARY, KEYWORD_GLOBAL_TEMPORARY_COLUMN, KEYWORD_GROUP_BY, KEYWORD_HAVING, KEYWORD_HYBRID, KEYWORD_ICEBERG, KEYWORD_IDENTITY, KEYWORD_INDEX, KEYWORD_INNER, KEYWORD_INSERT, KEYWORD_INTO, KEYWORD_JOIN, KEYWORD_KEY, KEYWORD_LEFT, KEYWORD_LIKE, KEYWORD_LIMIT, KEYWORD_NEXT, KEYWORD_NEXT_VALUE_FOR, KEYWORD_NO, KEYWORD_NOT, KEYWORD_NULL, KEYWORD_OFFSET, KEYWORD_ON, KEYWORD_ONLY, KEYWORD_OR, KEYWORD_ORDER_BY, KEYWORD_OUTER, KEYWORD_PRIMARY, KEYWORD_PUBLIC, KEYWORD_REFERENCES, KEYWORD_RIGHT, KEYWORD_ROW, KEYWORD_ROWS, KEYWORD_ROWSTORE, KEYWORD_SCHEMA, KEYWORD_SELECT, KEYWORD_SEQUENCE, KEYWORD_SEQUENCE_CYCLE, KEYWORD_SEQUENCE_EMPTY_STRING_FOR_BOOLEAN_TYPES, KEYWORD_SEQUENCE_INCREMENT_BY, KEYWORD_SEQUENCE_MAXVALUE, KEYWORD_SEQUENCE_MINVALUE, KEYWORD_SEQUENCE_NO_MAXVALUE, KEYWORD_SEQUENCE_NO_MINVALUE, KEYWORD_SEQUENCE_RESET_BY, KEYWORD_SEQUENCE_RESTART_WITH, KEYWORD_SEQUENCE_START_WITH, KEYWORD_SET, KEYWORD_START, KEYWORD_SYNONYM, KEYWORD_TABLE, KEYWORD_TABLE_TYPE, KEYWORD_UNION, KEYWORD_UNIQUE, KEYWORD_UPDATE, KEYWORD_VALUES, KEYWORD_VIEW, KEYWORD_WHERE, KEYWORD_WITH, METADATA_ALIAS, METADATA_BASE_TABLE, METADATA_CALC_VIEW, METADATA_GLOBAL_TEMPORARY, METADATA_GLOBAL_TEMPORARY_COLUMN, METADATA_LOCAL_TEMPORARY, METADATA_SYNONYM, METADATA_SYSTEM_TABLE, METADATA_TABLE, METADATA_TABLE_STRUCTURES, METADATA_TABLE_TYPES, METADATA_VIEW, OPEN, QUESTION, SEMICOLON, SPACE, STAR, TABLE, UNDERSCROE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionColumn.distinct()Distinct.For update.From.From.Full join.Full join.generate()Generate.protected voidGenerate columns.protected voidGenerate distinct.protected voidGenerate for update.protected voidGenerate group by.protected voidGenerate having.protected voidGenerate joins.protected voidGenerate select.protected voidGenerate tables.protected voidGenerate union.genericJoin(String type, String table, String on, String alias) Generic join.Gets the columns.Gets the groups.Gets the having.getJoins()Gets the joins.intgetLimit()Gets the limit.intGets the offset.Gets the orders.Gets the tables.Gets the unions.Gets the wheres.Group.Having.Inner join.Inner join.booleanChecks if is distinct.booleanChecks if is for update.Join.Join.Left join.Left join.limit(int limit) Limit.Limit.offset(int offset) Offset.Offset.Order.Order.Outer join.Outer join.Right join.Right join.From.protected StringTraverse columns.protected StringTraverse groups.protected StringTraverse joins.protected StringTraverse tables.protected StringTraverse unions.Union.Where.Methods inherited from class org.eclipse.dirigible.database.sql.builders.AbstractQuerySqlBuilder
generateCreate, generateLimitAndOffset, generateOrderBy, generateWhere, toStringMethods inherited from class org.eclipse.dirigible.database.sql.builders.AbstractSqlBuilder
build, encapsulate, encapsulate, encapsulateMany, encapsulateMany, encapsulateWhere, getDialect, getEscapeSymbol, isCaseSensitive, isColumn, isNumeric, isValue
-
Constructor Details
-
SelectBuilder
Instantiates a new select builder.- Parameters:
dialect- the dialect
-
-
Method Details
-
distinct
Distinct.- Returns:
- the select builder
-
forUpdate
For update.- Returns:
- the select builder
-
column
Column.- Parameters:
column- the column- Returns:
- the select builder
-
from
From.- Parameters:
table- the table- Returns:
- the select builder
-
from
From.- Parameters:
table- the tablealias- the alias- Returns:
- the select builder
-
schema
From.- Parameters:
schema- the schema- Returns:
- the select builder
-
join
Join.- Parameters:
table- the tableon- the on- Returns:
- the select builder
-
join
Join.- Parameters:
table- the tableon- the onalias- the alias- Returns:
- the select builder
-
innerJoin
Inner join.- Parameters:
table- the tableon- the on- Returns:
- the select builder
-
innerJoin
Inner join.- Parameters:
table- the tableon- the onalias- the alias- Returns:
- the select builder
-
outerJoin
Outer join.- Parameters:
table- the tableon- the on- Returns:
- the select builder
-
outerJoin
Outer join.- Parameters:
table- the tableon- the onalias- the alias- Returns:
- the select builder
-
leftJoin
Left join.- Parameters:
table- the tableon- the on- Returns:
- the select builder
-
leftJoin
Left join.- Parameters:
table- the tableon- the onalias- the alias- Returns:
- the select builder
-
rightJoin
Right join.- Parameters:
table- the tableon- the on- Returns:
- the select builder
-
rightJoin
Right join.- Parameters:
table- the tableon- the onalias- the alias- Returns:
- the select builder
-
fullJoin
Full join.- Parameters:
table- the tableon- the on- Returns:
- the select builder
-
fullJoin
Full join.- Parameters:
table- the tableon- the onalias- the alias- Returns:
- the select builder
-
genericJoin
Generic join.- Parameters:
type- the typetable- the tableon- the onalias- the alias- Returns:
- the select builder
-
where
Where.- Parameters:
condition- the condition- Returns:
- the select builder
-
order
Order.- Parameters:
column- the column- Returns:
- the select builder
-
order
Order.- Parameters:
column- the columnasc- the asc- Returns:
- the select builder
-
group
Group.- Parameters:
column- the column- Returns:
- the select builder
-
limit
Limit.- Parameters:
limit- the limit- Returns:
- the select builder
-
limit
Limit.- Parameters:
limit- the limit- Returns:
- the select builder
-
offset
Offset.- Parameters:
offset- the offset- Returns:
- the select builder
-
offset
Offset.- Parameters:
offset- the offset- Returns:
- the select builder
-
having
Having.- Parameters:
having- the having- Returns:
- the select builder
-
union
Union.- Parameters:
select- the select- Returns:
- the select builder
-
generate
Generate.- Returns:
- the string
-
generateUnion
Generate union.- Parameters:
sql- the sql
-
generateHaving
Generate having.- Parameters:
sql- the sql
-
generateGroupBy
Generate group by.- Parameters:
sql- the sql
-
generateJoins
Generate joins.- Parameters:
sql- the sql
-
generateTables
Generate tables.- Parameters:
sql- the sql
-
generateColumns
Generate columns.- Parameters:
sql- the sql
-
generateDistinct
Generate distinct.- Parameters:
sql- the sql
-
generateForUpdate
Generate for update.- Parameters:
sql- the sql
-
traverseColumns
Traverse columns.- Returns:
- the string
-
traverseTables
Traverse tables.- Returns:
- the string
-
traverseJoins
Traverse joins.- Returns:
- the string
-
traverseGroups
Traverse groups.- Returns:
- the string
-
traverseUnions
Traverse unions.- Returns:
- the string
-
generateSelect
Generate select.- Parameters:
sql- the sql
-
getColumns
Gets the columns.- Returns:
- the columns
-
getTables
Gets the tables.- Returns:
- the tables
-
getJoins
Gets the joins.- Returns:
- the joins
-
getWheres
Gets the wheres.- Returns:
- the wheres
-
getOrders
Gets the orders.- Returns:
- the orders
-
getGroups
Gets the groups.- Returns:
- the groups
-
getUnions
Gets the unions.- Returns:
- the unions
-
isDistinct
public boolean isDistinct()Checks if is distinct.- Returns:
- true, if is distinct
-
getHaving
Gets the having.- Returns:
- the having
-
getLimit
public int getLimit()Gets the limit.- Returns:
- the limit
-
getOffset
public int getOffset()Gets the offset.- Returns:
- the offset
-
isForUpdate
public boolean isForUpdate()Checks if is for update.- Returns:
- true, if is for update
-