public final class SqlBuilder extends Object
| Constructor and Description |
|---|
SqlBuilder() |
| Modifier and Type | Method and Description |
|---|---|
static Expression |
all()
Selects all columns in a row.
|
static Expression |
all(String tableName)
Selects all columns in a table.
|
static AlterColumn |
alterColumn(Expression table,
DbColumn dbColumn)
Alter column operator.
|
static AlterColumn |
alterColumn(Expression table,
Name column,
DbColumnType dbColumnType,
DbColumnConstraint... constraints)
Alter column operator.
|
static Expression |
and(Collection<? extends Expression> exps)
The AND operator.
|
static Expression |
and(Expression... exps)
The AND operator.
|
static Expression |
avg(Expression exp)
The AVG operator.
|
static Between |
between(Expression exp1,
Expression exp2,
Expression exp3)
The BETWEEN operator.
|
static Coalesce |
coalesce(Expression exp,
Expression... alternative)
The coalesce operator.
|
static Name |
column(String name)
A column.
|
static Name |
column(String tableName,
String name)
A column from a table.
|
static Expression |
count(Expression exp)
The COUNT operator.
|
static View |
createView(String name)
Creates a view.
|
static Delete |
delete(Expression table)
The DELETE keyword.
|
static Expression |
div(Collection<? extends Expression> exps)
The DIV operator.
|
static Expression |
div(Expression... exps)
The DIV operator.
|
static DropPrimaryKey |
dropPK(Expression table)
Drop primary key table operator.
|
static Expression |
eq(Collection<? extends Expression> e1)
The equals expression.
|
static Expression |
eq(Expression... e1)
The equals expression.
|
static Expression |
gt(Collection<? extends Expression> exps)
The GT operator.
|
static Expression |
gt(Expression... exps)
The GT operator.
|
static Expression |
gteq(Collection<? extends Expression> exps)
The GTEQ operator.
|
static Expression |
gteq(Expression... exps)
The GTEQ operator.
|
static Expression |
in(Expression e1,
Expression e2)
The IN expression.
|
static Expression |
join(Expression e1,
Expression e2)
The same of making eq(e1, e2).
|
static Expression |
k(Object o)
A constant.
|
static Expression |
L(Collection<? extends Expression> exps)
A list of expression enclosed.
|
static Expression |
L(Expression... exps)
A list of expression enclosed.
|
static Expression |
like(Collection<? extends Expression> exps)
The LIKE operator.
|
static Expression |
like(Expression... exps)
The LIKE operator.
|
static Literal |
lit(Object o)
Use this to add literals (strings, etc) when building the SQL statement.
|
static Expression |
lt(Collection<? extends Expression> exps)
The LT operator.
|
static Expression |
lt(Expression... exps)
The LT operator.
|
static Expression |
lteq(Collection<? extends Expression> exps)
The LTEQ operator.
|
static Expression |
lteq(Expression... exps)
The LTEQ operator.
|
static Expression |
max(Expression exp)
The MAX operator.
|
static Expression |
min(Expression exp)
The MIN operator.
|
static Expression |
minus(Collection<? extends Expression> exps)
The MINUS operator.
|
static Expression |
minus(Expression... exps)
The MINUS operator.
|
static Expression |
mod(Expression exp1,
Expression exp2)
The MOD operator.
|
static Expression |
mult(Collection<? extends Expression> exps)
The MULT operator.
|
static Expression |
mult(Expression... exps)
The MULT operator.
|
static Expression |
neq(Collection<? extends Expression> exps)
The not equal expression.
|
static Expression |
neq(Expression... exps)
The not equal expression.
|
static Between |
notBetween(Expression exp1,
Expression exp2,
Expression exp3)
The NOT BETWEEN operator.
|
static Expression |
notIn(Expression e1,
Expression e2)
The NOT IN expression.
|
static Expression |
or(Collection<? extends Expression> exps)
The OR operator.
|
static Expression |
or(Expression... exps)
The OR operator.
|
static Expression |
plus(Collection<? extends Expression> exps)
The PLUS operator.
|
static Expression |
plus(Expression... exps)
The PLUS operator.
|
static Rename |
rename(Expression oldName,
Expression newName)
Rename table operator.
|
static Query |
select(Collection<? extends Expression> select)
Starts a new query.
|
static Query |
select(Expression... select)
Starts a new query.
|
static Expression |
stddev(Expression exp)
The STDDEV operator.
|
static Expression |
sum(Expression exp)
The SUM operator.
|
static Name |
table(String name)
A table.
|
static Truncate |
truncate(Expression table)
The TRUNCATE keyword.
|
static Expression |
udf(String udf)
The Used Defined Function operator.
|
static Expression |
udf(String udf,
Expression exp)
The Used Defined Function operator.
|
static Update |
update(Expression table)
The UPDATE operator.
|
public static Query select(Expression... select)
select - The objects.public static Query select(Collection<? extends Expression> select)
select - The collection of select columns.public static Expression all()
public static Expression all(String tableName)
tableName - The table.public static Name column(String name)
name - The column name.public static Name column(String tableName, String name)
tableName - The table name.name - The column name.public static Name table(String name)
name - The table name.public static Expression eq(Expression... e1)
e1 - The expressions.public static Expression eq(Collection<? extends Expression> e1)
e1 - The expressions.public static Expression k(Object o)
o - The constant.public static Expression and(Expression... exps)
exps - The expressions.public static Expression and(Collection<? extends Expression> exps)
exps - The expressions.public static Expression or(Expression... exps)
exps - The expressions.public static Expression or(Collection<? extends Expression> exps)
exps - The expressions.public static Expression div(Expression... exps)
exps - The expressions.public static Expression div(Collection<? extends Expression> exps)
exps - The expressions.public static Expression mod(Expression exp1, Expression exp2)
exp1 - The dividend.exp2 - The divisor.public static Expression gt(Expression... exps)
exps - The expressions.public static Expression gt(Collection<? extends Expression> exps)
exps - The expressions.public static Expression gteq(Expression... exps)
exps - The expressions.public static Expression gteq(Collection<? extends Expression> exps)
exps - The expressions.public static Expression like(Expression... exps)
exps - The expressions.public static Expression like(Collection<? extends Expression> exps)
exps - The expressions.public static Expression lt(Expression... exps)
exps - The expressions.public static Expression lt(Collection<? extends Expression> exps)
exps - The expressions.public static Expression lteq(Expression... exps)
exps - The expressions.public static Expression lteq(Collection<? extends Expression> exps)
exps - The expressions.public static Expression minus(Expression... exps)
exps - The expressions.public static Expression minus(Collection<? extends Expression> exps)
exps - The expressions.public static Expression mult(Expression... exps)
exps - The expressions.public static Expression mult(Collection<? extends Expression> exps)
exps - The expressions.public static Expression plus(Expression... exps)
exps - The expressions.public static Expression plus(Collection<? extends Expression> exps)
exps - The expressions.public static Expression max(Expression exp)
exp - The expression.public static Expression min(Expression exp)
exp - The expression.public static Expression stddev(Expression exp)
exp - The expression.public static Expression avg(Expression exp)
exp - The expression.public static Expression count(Expression exp)
exp - The expression.public static Expression sum(Expression exp)
exp - The expression.public static Expression udf(String udf)
udf - The UDF name.public static Expression udf(String udf, Expression exp)
udf - The UDF name.exp - The expression.public static Expression join(Expression e1, Expression e2)
e1 - The first expression.e2 - The second expression.public static View createView(String name)
name - The name of the view.public static Expression neq(Expression... exps)
exps - The expressions.public static Expression neq(Collection<? extends Expression> exps)
exps - The expressions.public static Expression L(Expression... exps)
exps - The expressions.public static Expression L(Collection<? extends Expression> exps)
exps - The expressions.public static Expression in(Expression e1, Expression e2)
e1 - The first expression.e2 - The second expression.public static Expression notIn(Expression e1, Expression e2)
e1 - The first expression.e2 - The second expression.public static Coalesce coalesce(Expression exp, Expression... alternative)
exp - The expression to test if is NULL.alternative - The alternative expressions to use.public static Between between(Expression exp1, Expression exp2, Expression exp3)
exp1 - The column.exp2 - The first bound.exp3 - The second bound.public static Between notBetween(Expression exp1, Expression exp2, Expression exp3)
exp1 - The column.exp2 - The first bound.exp3 - The second bound.public static Update update(Expression table)
table - The table.public static Delete delete(Expression table)
table - The table.public static Literal lit(Object o)
o - The literal.public static Truncate truncate(Expression table)
table - The table.public static Rename rename(Expression oldName, Expression newName)
oldName - The table.public static DropPrimaryKey dropPK(Expression table)
table - The table.public static AlterColumn alterColumn(Expression table, Name column, DbColumnType dbColumnType, DbColumnConstraint... constraints)
table - The table containing the column.column - The column of the table.dbColumnType - The db column type.constraints - The constraints of the column.public static AlterColumn alterColumn(Expression table, DbColumn dbColumn)
table - The table containing the column.dbColumn - The database column definition.Copyright © 2013. All Rights Reserved.