| Package | Description |
|---|---|
| com.feedzai.commons.sql.abstraction.ddl |
Contains classes that aid on DDL creation.
|
| com.feedzai.commons.sql.abstraction.dml |
Contains classes to build DML statements.
|
| com.feedzai.commons.sql.abstraction.dml.dialect |
Contains an SQL builder.
|
| com.feedzai.commons.sql.abstraction.engine |
Contains the database engine core.
|
| com.feedzai.commons.sql.abstraction.engine.impl |
Database specific implementations.
|
| Modifier and Type | Class and Description |
|---|---|
class |
AlterColumn
Expression to translate {@code ALTER TABLE...
|
class |
DropPrimaryKey
Translates to a statement that allows to drop the primary key of a table.
|
class |
Rename
Expression to rename tables.
|
| Modifier and Type | Method and Description |
|---|---|
Expression |
Rename.getNewName()
Gets the new name.
|
Expression |
Rename.getOldName()
Gets the old name.
|
Expression |
AlterColumn.getTable()
Gets the table expression.
|
Expression |
DropPrimaryKey.getTable()
Gets the table expression.
|
| Constructor and Description |
|---|
AlterColumn(Expression table,
DbColumn column)
Creates a new instance of
AlterColumn. |
DropPrimaryKey(Expression table)
Creates a new instance of
DropPrimaryKey. |
Rename(Expression oldName,
Expression newName)
Creates a new instance of
Rename. |
| Modifier and Type | Class and Description |
|---|---|
class |
All
Represents the * or environment.* operator.
|
class |
Between
Represents the BETWEEN operator.
|
class |
Case
Case SQL Expression.
|
class |
Cast
The cast expression.
|
class |
Coalesce
Represents the coalesce operator.
|
class |
Delete
Represents the DELETE operator.
|
class |
Function
Represents SQL functions.
|
class |
InternalFunction
Represents functions that are internal to the database engine in place.
|
class |
Join
Represents a SQL join operator.
|
class |
K
Represents a SQL constant.
|
class |
Literal
Represents a literal object that will have no specific translation.
|
class |
Modulo
The MOD operator.
|
class |
Name
Represents a named expression.
|
class |
Query
Represents a SQL Query.
|
class |
RepeatDelimiter
Represents expressions that ca be repeated.
|
class |
StringAgg |
class |
Truncate
Represents the TRUNCATE operator.
|
class |
Union
The union clause.
|
class |
Update
Represents the UPDATE operator.
|
class |
Values
The Values clause.
|
static class |
Values.Row
A Row belonging to a Values clause.
|
class |
View
Represents a SQL view.
|
class |
When |
class |
With
With SQL Expression.
|
| Modifier and Type | Field and Description |
|---|---|
Expression |
When.action
The action to be executed if the condition is true.
|
Expression |
StringAgg.column
The column to aggregate.
|
Expression |
When.condition
The condition to verify.
|
| Modifier and Type | Method and Description |
|---|---|
Expression |
Expression.alias(String alias)
Aliases this expression.
|
Expression |
Expression.asc()
Sets ordering to ascendant.
|
Expression |
Expression.desc()
Sets ordering to descendant.
|
Expression |
Expression.enclose()
Encloses this expression with parenthesis.
|
Expression |
Expression.fullOuterJoin(Expression table,
Expression expr)
Sets a full outer join with the current table.
|
Expression[] |
Coalesce.getAlternative()
Gets the alternative expressions.
|
Expression |
Between.getAnd()
Gets the AND expression.
|
Expression |
View.getAs()
Gets the AS expression.
|
Expression |
StringAgg.getColumn()
Returns the column to be aggregated.
|
Expression |
Between.getColumn()
Gets the column in the expression.
|
Expression |
Modulo.getDividend()
Gets the dividend.
|
Expression |
Modulo.getDivisor()
Gets the divisor.
|
Expression |
Coalesce.getExp()
Gets the expression to test.
|
Expression |
Function.getExp()
Gets the expression in the function.
|
Expression |
Cast.getExpression()
Gets the expression.
|
Expression |
Case.getFalseAction()
Gets the false action.
|
Expression |
Update.getFrom()
Gets the FROM expression.
|
Expression |
Query.getHaving()
Gets the HAVING expression.
|
Expression |
Join.getJoinExpr()
Gets the join expression.
|
Expression |
Join.getJoinTable()
Gets the join table.
|
Expression |
Truncate.getTable()
Gets the table to truncate.
|
Expression |
Update.getTable()
Gets the table.
|
Expression |
Delete.getTable()
Gets the TABLE expression.
|
Expression |
With.getThen()
Gets the then expression.
|
Expression |
Query.getWhere()
Gets the WHERE expression.
|
Expression |
Update.getWhere()
Gets the WHERE expression.
|
Expression |
Delete.getWhere()
Gets the WHERE expression.
|
Expression |
Expression.innerJoin(Expression table,
Expression expr)
Sets an inner join with the current table.
|
Expression |
Expression.leftOuterJoin(Expression table,
Expression expr)
Sets a left outer join with the current table.
|
Expression |
Expression.rightOuterJoin(Expression table,
Expression expr)
Sets a right outer join with the current table.
|
Expression |
Expression.unquote()
Removes the quotes for this expression.
|
Expression |
Expression.withNoLock()
Sets no lock keyword on SQL Server tables.
|
| Modifier and Type | Method and Description |
|---|---|
List<org.apache.commons.lang3.tuple.ImmutablePair<Name,Expression>> |
With.getClauses()
Gets the clauses.
|
List<Expression> |
Update.getColumns()
Gets the columns.
|
List<Expression> |
RepeatDelimiter.getExpressions()
Gets the expressions.
|
List<Expression> |
Values.Row.getExpressions()
Gets the list of expressions.
|
List<Expression> |
Union.getExpressions()
Gets the expressions to union.
|
List<Expression> |
Query.getFromColumns()
Gets the FROM columns.
|
List<Expression> |
Query.getGroupbyColumns()
Gets the GROUP BY expressions.
|
List<Expression> |
Query.getOrderbyColumns()
Gets the ORDER BY expressions.
|
List<Expression> |
Query.getSelectColumns()
Gets the SELECT columns.
|
| Modifier and Type | Method and Description |
|---|---|
Query |
Query.andWhere(Expression where)
The WHERE clause.
|
With |
With.andWith(String alias,
Expression expression)
Adds an alias and expression to the with clause.
|
View |
View.as(Expression as)
Sets the AS expression.
|
static Case |
Case.caseWhen(Expression condition,
Expression trueAction)
Returns a new "case when" that does the trueAction considering the condition.
|
Query |
Query.from(Expression... fromColumns)
Adds the FROM columns.
|
Update |
Update.from(Expression from)
Adds the FROM expression.
|
Expression |
Expression.fullOuterJoin(Expression table,
Expression expr)
Sets a full outer join with the current table.
|
Query |
Query.groupby(Expression... groupbyColumns)
Adds the GROUP BY columns.
|
Query |
Query.having(Expression having)
Adds the HAVING expression.
|
Expression |
Expression.innerJoin(Expression table,
Expression expr)
Sets an inner join with the current table.
|
Expression |
Expression.leftOuterJoin(Expression table,
Expression expr)
Sets a left outer join with the current table.
|
Query |
Query.orderby(Expression... orderbyColumns)
Adds the ORDER BY columns.
|
Case |
Case.otherwise(Expression falseAction)
Sets the false action.
|
Expression |
Expression.rightOuterJoin(Expression table,
Expression expr)
Sets a right outer join with the current table.
|
Values |
Values.row(Expression... expressions)
Add a row to values.
|
Query |
Query.select(Expression... selectColumns)
Adds the SELECT columns.
|
Update |
Update.set(Expression... exps)
The set keyword.
|
static StringAgg |
StringAgg.stringAgg(Expression column)
Returns a new StringAgg.
|
With |
With.then(Expression thenExpression)
Sets the expression to be executed given the clauses.
|
static When |
When.when(Expression condition,
Expression action)
Creates a new When expression.
|
Case |
Case.when(Expression condition,
Expression action)
Adds a new when clause to this case.
|
Query |
Query.where(Expression where)
The where clause.
|
Update |
Update.where(Expression where)
Adds the WHERE expression.
|
Delete |
Delete.where(Expression where)
Sets the where expression.
|
| Modifier and Type | Method and Description |
|---|---|
Query |
Query.from(Collection<? extends Expression> fromColumns)
Adds the FROM columns.
|
Query |
Query.groupby(Collection<? extends Expression> groupbyColumns)
Adds the GROUP BY columns.
|
Query |
Query.orderby(Collection<? extends Expression> orderbyColumns)
Adds the ORDER BY columns.
|
Query |
Query.select(Collection<? extends Expression> selectColumns)
Adds the SELECT columns.
|
Update |
Update.set(Collection<? extends Expression> exps)
The set keyword.
|
| Constructor and Description |
|---|
Between(Expression column,
Expression exp)
Creates a new instance of
Between. |
Cast(Expression expression,
DbColumnType type)
Creates a new cast expression.
|
Coalesce(Expression exp,
Expression... alternative)
Creates a new instance of
Coalesce. |
Coalesce(Expression exp,
Expression... alternative)
Creates a new instance of
Coalesce. |
Delete(Expression table)
Creates a new instance of
Delete. |
Function(String function,
Expression exp)
Creates a new instance of
Function. |
InternalFunction(String function,
Expression exp)
Creates a new instance of
InternalFunction. |
Join(String join,
Expression joinTable,
Expression joinExpr)
Creates a new instance of
Join. |
Modulo(Expression dividend,
Expression divisor)
Creates a new instance of
Modulo. |
RepeatDelimiter(String delimiter,
Expression... dbe)
Creates a new instance of
RepeatDelimiter. |
Truncate(Expression table)
Creates a new instance of
Truncate. |
Union(Expression... expressions)
Creates a new UNION expression.
|
Update(Expression table)
Creates a new instance of
Update. |
With(String alias,
Expression expression)
Creates a new WITH expression.
|
| Constructor and Description |
|---|
RepeatDelimiter(String delimiter,
Collection<? extends Expression> dbe)
Creates a new instance of
RepeatDelimiter. |
Union(Collection<Expression> expressions)
Creates a new UNION expression.
|
| Modifier and Type | Method and Description |
|---|---|
static Expression |
SqlBuilder.all()
Selects all columns in a row.
|
static Expression |
SqlBuilder.all(String tableName)
Selects all columns in a table.
|
static Expression |
SqlBuilder.and(Collection<? extends Expression> exps)
The AND operator.
|
static Expression |
SqlBuilder.and(Expression... exps)
The AND operator.
|
static Expression |
SqlBuilder.avg(Expression exp)
The AVG operator.
|
static Expression |
SqlBuilder.ceiling(Expression exp)
The CEILING operator.
|
static Expression |
SqlBuilder.count(Expression exp)
The COUNT operator.
|
static Expression |
SqlBuilder.div(Collection<? extends Expression> exps)
The DIV operator.
|
static Expression |
SqlBuilder.div(Expression... exps)
The DIV operator.
|
static Expression |
SqlBuilder.eq(Collection<? extends Expression> e1)
The equals expression.
|
static Expression |
SqlBuilder.eq(Expression... e1)
The equals expression.
|
static Expression |
SqlBuilder.f(String function)
An internal function (provided by the engine in place).
|
static Expression |
SqlBuilder.f(String function,
Expression exp)
An internal function (provided by the engine in place).
|
static Expression |
SqlBuilder.floor(Expression exp)
The FLOOR operator.
|
static Expression |
SqlBuilder.gt(Collection<? extends Expression> exps)
The GT operator.
|
static Expression |
SqlBuilder.gt(Expression... exps)
The GT operator.
|
static Expression |
SqlBuilder.gteq(Collection<? extends Expression> exps)
The GTEQ operator.
|
static Expression |
SqlBuilder.gteq(Expression... exps)
The GTEQ operator.
|
static Expression |
SqlBuilder.in(Expression e1,
Expression e2)
The IN expression.
|
static Expression |
SqlBuilder.join(Expression e1,
Expression e2)
The same of making eq(e1, e2).
|
static Expression |
SqlBuilder.k(Object o)
A constant.
|
static Expression |
SqlBuilder.L(Collection<? extends Expression> exps)
A list of expression enclosed.
|
static Expression |
SqlBuilder.L(Expression... exps)
A list of expressions enclosed.
|
static Expression |
SqlBuilder.like(Collection<? extends Expression> exps)
The LIKE operator.
|
static Expression |
SqlBuilder.like(Expression... exps)
The LIKE operator.
|
static Expression |
SqlBuilder.lower(Expression exp)
The LOWER operator.
|
static Expression |
SqlBuilder.lt(Collection<? extends Expression> exps)
The LT operator.
|
static Expression |
SqlBuilder.lt(Expression... exps)
The LT operator.
|
static Expression |
SqlBuilder.lteq(Collection<? extends Expression> exps)
The LTEQ operator.
|
static Expression |
SqlBuilder.lteq(Expression... exps)
The LTEQ operator.
|
static Expression |
SqlBuilder.max(Expression exp)
The MAX operator.
|
static Expression |
SqlBuilder.min(Expression exp)
The MIN operator.
|
static Expression |
SqlBuilder.minus(Collection<? extends Expression> exps)
The MINUS operator.
|
static Expression |
SqlBuilder.minus(Expression... exps)
The MINUS operator.
|
static Expression |
SqlBuilder.mod(Expression exp1,
Expression exp2)
The MOD operator.
|
static Expression |
SqlBuilder.mult(Collection<? extends Expression> exps)
The MULT operator.
|
static Expression |
SqlBuilder.mult(Expression... exps)
The MULT operator.
|
static Expression |
SqlBuilder.neq(Collection<? extends Expression> exps)
The not equal expression.
|
static Expression |
SqlBuilder.neq(Expression... exps)
The not equal expression.
|
static Expression |
SqlBuilder.notIn(Expression e1,
Expression e2)
The NOT IN expression.
|
static Expression |
SqlBuilder.or(Collection<? extends Expression> exps)
The OR operator.
|
static Expression |
SqlBuilder.or(Expression... exps)
The OR operator.
|
static Expression |
SqlBuilder.plus(Collection<? extends Expression> exps)
The PLUS operator.
|
static Expression |
SqlBuilder.plus(Expression... exps)
The PLUS operator.
|
static Expression |
SqlBuilder.stddev(Expression exp)
The STDDEV operator.
|
static Expression |
SqlBuilder.sum(Expression exp)
The SUM operator.
|
static Expression |
SqlBuilder.udf(String udf)
The Used Defined Function operator.
|
static Expression |
SqlBuilder.udf(String udf,
Expression exp)
The Used Defined Function operator.
|
static Expression |
SqlBuilder.upper(Expression exp)
The UPPER operator.
|
| Modifier and Type | Method and Description |
|---|---|
static AlterColumn |
SqlBuilder.alterColumn(Expression table,
DbColumn dbColumn)
Alter column operator.
|
static AlterColumn |
SqlBuilder.alterColumn(Expression table,
Name column,
DbColumnType dbColumnType,
DbColumnConstraint... constraints)
Alter column operator.
|
static Expression |
SqlBuilder.and(Expression... exps)
The AND operator.
|
static Expression |
SqlBuilder.avg(Expression exp)
The AVG operator.
|
static Between |
SqlBuilder.between(Expression exp1,
Expression exp2,
Expression exp3)
The BETWEEN operator.
|
static Case |
SqlBuilder.caseWhen(Expression condition,
Expression trueAction)
Creates a case expression.
|
static Cast |
SqlBuilder.cast(Expression expression,
DbColumnType type)
Creates a cast expression.
|
static Expression |
SqlBuilder.ceiling(Expression exp)
The CEILING operator.
|
static Coalesce |
SqlBuilder.coalesce(Expression exp,
Expression... alternative)
The coalesce operator.
|
static Coalesce |
SqlBuilder.coalesce(Expression exp,
Expression... alternative)
The coalesce operator.
|
static Expression |
SqlBuilder.count(Expression exp)
The COUNT operator.
|
static Delete |
SqlBuilder.delete(Expression table)
The DELETE keyword.
|
static Expression |
SqlBuilder.div(Expression... exps)
The DIV operator.
|
static DropPrimaryKey |
SqlBuilder.dropPK(Expression table)
Drop primary key table operator.
|
static Expression |
SqlBuilder.eq(Expression... e1)
The equals expression.
|
static Expression |
SqlBuilder.f(String function,
Expression exp)
An internal function (provided by the engine in place).
|
static Expression |
SqlBuilder.floor(Expression exp)
The FLOOR operator.
|
static Expression |
SqlBuilder.gt(Expression... exps)
The GT operator.
|
static Expression |
SqlBuilder.gteq(Expression... exps)
The GTEQ operator.
|
static Expression |
SqlBuilder.in(Expression e1,
Expression e2)
The IN expression.
|
static Expression |
SqlBuilder.join(Expression e1,
Expression e2)
The same of making eq(e1, e2).
|
static Expression |
SqlBuilder.L(Expression... exps)
A list of expressions enclosed.
|
static Expression |
SqlBuilder.like(Expression... exps)
The LIKE operator.
|
static Expression |
SqlBuilder.lower(Expression exp)
The LOWER operator.
|
static Expression |
SqlBuilder.lt(Expression... exps)
The LT operator.
|
static Expression |
SqlBuilder.lteq(Expression... exps)
The LTEQ operator.
|
static Expression |
SqlBuilder.max(Expression exp)
The MAX operator.
|
static Expression |
SqlBuilder.min(Expression exp)
The MIN operator.
|
static Expression |
SqlBuilder.minus(Expression... exps)
The MINUS operator.
|
static Expression |
SqlBuilder.mod(Expression exp1,
Expression exp2)
The MOD operator.
|
static Expression |
SqlBuilder.mult(Expression... exps)
The MULT operator.
|
static Expression |
SqlBuilder.neq(Expression... exps)
The not equal expression.
|
static Between |
SqlBuilder.notBetween(Expression exp1,
Expression exp2,
Expression exp3)
The NOT BETWEEN operator.
|
static Expression |
SqlBuilder.notIn(Expression e1,
Expression e2)
The NOT IN expression.
|
static Expression |
SqlBuilder.or(Expression... exps)
The OR operator.
|
static Expression |
SqlBuilder.plus(Expression... exps)
The PLUS operator.
|
static Rename |
SqlBuilder.rename(Expression oldName,
Expression newName)
Rename table operator.
|
static Query |
SqlBuilder.select(Expression... select)
Starts a new query.
|
static Expression |
SqlBuilder.stddev(Expression exp)
The STDDEV operator.
|
static StringAgg |
SqlBuilder.stringAgg(Expression column)
The StringAgg function.
|
static Expression |
SqlBuilder.sum(Expression exp)
The SUM operator.
|
static Truncate |
SqlBuilder.truncate(Expression table)
The TRUNCATE keyword.
|
static Expression |
SqlBuilder.udf(String udf,
Expression exp)
The Used Defined Function operator.
|
static Union |
SqlBuilder.union(Expression... expressions)
Creates a union expression.
|
static Update |
SqlBuilder.update(Expression table)
The UPDATE operator.
|
static Expression |
SqlBuilder.upper(Expression exp)
The UPPER operator.
|
static With |
SqlBuilder.with(String alias,
Expression expression)
The With clause.
|
| Modifier and Type | Method and Description |
|---|---|
static Expression |
SqlBuilder.and(Collection<? extends Expression> exps)
The AND operator.
|
static Expression |
SqlBuilder.div(Collection<? extends Expression> exps)
The DIV operator.
|
static Expression |
SqlBuilder.eq(Collection<? extends Expression> e1)
The equals expression.
|
static Expression |
SqlBuilder.gt(Collection<? extends Expression> exps)
The GT operator.
|
static Expression |
SqlBuilder.gteq(Collection<? extends Expression> exps)
The GTEQ operator.
|
static Expression |
SqlBuilder.L(Collection<? extends Expression> exps)
A list of expression enclosed.
|
static Expression |
SqlBuilder.like(Collection<? extends Expression> exps)
The LIKE operator.
|
static Expression |
SqlBuilder.lt(Collection<? extends Expression> exps)
The LT operator.
|
static Expression |
SqlBuilder.lteq(Collection<? extends Expression> exps)
The LTEQ operator.
|
static Expression |
SqlBuilder.minus(Collection<? extends Expression> exps)
The MINUS operator.
|
static Expression |
SqlBuilder.mult(Collection<? extends Expression> exps)
The MULT operator.
|
static Expression |
SqlBuilder.neq(Collection<? extends Expression> exps)
The not equal expression.
|
static Expression |
SqlBuilder.or(Collection<? extends Expression> exps)
The OR operator.
|
static Expression |
SqlBuilder.plus(Collection<? extends Expression> exps)
The PLUS operator.
|
static Query |
SqlBuilder.select(Collection<? extends Expression> select)
Starts a new query.
|
static Union |
SqlBuilder.union(Collection<Expression> expressions)
Creates a union expression.
|
| Modifier and Type | Method and Description |
|---|---|
void |
DatabaseEngine.createPreparedStatement(String name,
Expression query)
Creates a prepared statement.
|
void |
AbstractDatabaseEngine.createPreparedStatement(String name,
Expression query) |
void |
DatabaseEngine.createPreparedStatement(String name,
Expression query,
int timeout)
Creates a prepared statement.
|
void |
AbstractDatabaseEngine.createPreparedStatement(String name,
Expression query,
int timeout) |
int |
DatabaseEngine.executeUpdate(Expression query)
Executes the given update.
|
int |
AbstractDatabaseEngine.executeUpdate(Expression query)
Executes the given update.
|
Map<String,DbColumnType> |
DatabaseEngine.getQueryMetadata(Expression query)
Gets the query metadata.
|
Map<String,DbColumnType> |
AbstractDatabaseEngine.getQueryMetadata(Expression query)
Gets the query metadata.
|
protected void |
AbstractTranslator.inject(Expression... objs)
Injects dependencies on the given objects.
|
protected void |
AbstractDatabaseEngine.inject(Expression... objs) |
ResultIterator |
DatabaseEngine.iterator(Expression query)
Creates an iterator for the given SQL expression.
|
ResultIterator |
AbstractDatabaseEngine.iterator(Expression query) |
ResultIterator |
DatabaseEngine.iterator(Expression query,
int fetchSize)
Creates an iterator for the given SQL expression.
|
ResultIterator |
AbstractDatabaseEngine.iterator(Expression query,
int fetchSize) |
default ResultIterator |
DatabaseEngine.iterator(Expression query,
int fetchSize,
int readTimeoutOverride)
Creates an iterator for the given SQL expression overriding the configured query
timeout (see
PdbProperties.getSelectQueryTimeout()) if the underlying engine
supports query timeouts. |
ResultIterator |
AbstractDatabaseEngine.iterator(Expression query,
int fetchSize,
int readTimeoutOverride) |
List<Map<String,ResultColumn>> |
DatabaseEngine.query(Expression query)
Executes the given query.
|
List<Map<String,ResultColumn>> |
AbstractDatabaseEngine.query(Expression query)
Executes the given query.
|
default List<Map<String,ResultColumn>> |
DatabaseEngine.query(Expression query,
int readTimeoutOverride)
Executes the given query overriding the configured query timeout (see
PdbProperties.getSelectQueryTimeout())
if the underlying engine supports query timeouts. |
List<Map<String,ResultColumn>> |
AbstractDatabaseEngine.query(Expression query,
int readTimeoutOverride) |
String |
DatabaseEngine.translate(Expression query)
Translates the given expression to the current dialect.
|
String |
AbstractDatabaseEngine.translate(Expression query)
Translates the given expression to the current dialect.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
AbstractTranslator.inject(Collection<? extends Expression> objs)
Injects dependencies on the given objects.
|
protected Union |
AbstractTranslator.rowsToUnion(List<Expression> rows)
Transform values' rows into a union.
|
| Modifier and Type | Method and Description |
|---|---|
void |
OracleEngine.createPreparedStatement(String name,
Expression query) |
int |
SqlServerEngine.executeUpdate(Expression query) |
| Modifier and Type | Method and Description |
|---|---|
protected Union |
MySqlTranslator.rowsToUnion(List<Expression> rows) |
Copyright © 2021 Feedzai. All rights reserved.