AstVisitor, InsertAsStep, InsertColumnsManyStep, InsertColumnsStep, InsertConflictActionStep, InsertDefaultValuesStep, InsertDoUpdateSetStep, InsertDoUpdateWhereFirstStep, InsertDoUpdateWhereManySteps, InsertFinalStep, InsertOnConflictStep, InsertOnConflictWhereFirstStep, InsertOnConflictWhereManySteps, InsertOnConstraintStep, InsertOverridingStep, InsertReturningStep, InsertValuesManyStep, InsertValuesStep, Querypublic class InsertImpl extends AbstractQuery implements InsertAsStep, InsertColumnsStep, InsertColumnsManyStep, InsertOverridingStep, InsertDefaultValuesStep, InsertValuesManyStep, InsertValuesStep, InsertOnConflictStep, InsertOnConflictWhereFirstStep, InsertOnConflictWhereManySteps, InsertOnConstraintStep, InsertConflictActionStep, InsertDoUpdateSetStep, InsertDoUpdateWhereFirstStep, InsertDoUpdateWhereManySteps
| Constructor | Description |
|---|---|
InsertImpl(Expression table) |
| Modifier and Type | Method | Description |
|---|---|---|
InsertImpl |
and(Conditions conditions) |
For full information see the
Conditions.and(Conditions) method. |
<T> InsertImpl |
and(T left,
T operator,
T right) |
For full information see the
Conditions.and(Object, Object, Object) method. |
InsertImpl |
andExists(Query query) |
For full information see the
Conditions.andExists(Query) method. |
InsertImpl |
andNot(Conditions conditions) |
For full information see the
Conditions.andNot(Conditions) method. |
<T> InsertImpl |
andNot(T left,
T operator,
T right) |
For full information see the
Conditions.andNot(Object, Object, Object) method. |
InsertImpl |
andNotExists(Query query) |
For full information see the
Conditions.andNotExists(Query) method. |
InsertImpl |
as(java.lang.String alias) |
Sets a substitute name for target table.
|
void |
assemble(AbstractSyntaxTree tree) |
Visits SQL query making a tree from its clauses.
|
InsertImpl |
columns(java.lang.String... columns) |
|
InsertImpl |
columns(Expression... columns) |
|
InsertImpl |
defaultValues() |
|
InsertImpl |
doNothing() |
|
InsertImpl |
doUpdate() |
|
InsertImpl |
onConflict() |
|
InsertImpl |
onConflict(java.lang.String indexColumnName) |
Specifies index column name of conflict target.
|
InsertImpl |
onConflict(ConflictTarget... targets) |
Specifies a conflict target
|
InsertImpl |
onConstraint(java.lang.String name) |
|
InsertImpl |
or(Conditions conditions) |
For full information see the
Conditions.or(Conditions) method. |
<T> InsertImpl |
or(T left,
T operator,
T right) |
For full information see the
Conditions.or(Object, Object, Object) method. |
InsertImpl |
orExists(Query query) |
For full information see the
Conditions.orExists(Query) method. |
InsertImpl |
orNot(Conditions conditions) |
For full information see the
Conditions.orNot(Conditions) method. |
<T> InsertImpl |
orNot(T left,
T operator,
T right) |
For full information see the
Conditions.orNot(Object, Object, Object) method. |
InsertImpl |
orNotExists(Query query) |
For full information see the
Conditions.orNot(Conditions) method. |
InsertImpl |
overridingSystemValue() |
Specifies a possible override IDENTITY column value by user-provided
value.
|
InsertImpl |
overridingUserValue() |
|
InsertImpl |
query(Query query) |
Set query which output values are used to insert.
|
InsertImpl |
returning(Expression... output) |
Set list of expressions that to be computed after each row is inserted.
|
<T> InsertImpl |
returning(T... output) |
Set list of expressions that to be computed after each row is inserted.
|
<T> InsertImpl |
set(java.lang.String column,
T value) |
Set a column name and an expression that is be assigned to the column.
|
InsertImpl |
set(Expression listColumns,
Query subSelect) |
Set a columns names and a sub-select that is be assigned to the columns.
|
InsertImpl |
set(Expression listColumns,
Expression listValues) |
Set a columns names and an expression list that are be assigned to the columns.
|
InsertImpl |
values(Expression... values) |
|
<T> InsertImpl |
values(T... values) |
|
InsertImpl |
where(Conditions conditions) |
This function useful in a few case:
When the
conditions is a special case of condition,
like Queryman.conditionBetween(Object, Object, Object), or
Queryman.conditionSome(Object, Object, Query) etc. |
<T> InsertImpl |
where(T left,
T operator,
T right) |
Example:
// SELECT * FROM book WHERE year > 2010
select("*")
.from("book")
.where("year", ">", "2010")
.sql()
|
InsertImpl |
whereExists(Query query) |
Example:
// SELECT * FROM book WHERE EXISTS (SELECT * FROM author)
select("*")
.from("book")
.whereExists(select("*").from("authors"))
.sql()
|
buildPreparedStatement, sql, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbuildPreparedStatement, sqlpublic InsertImpl(Expression table)
public void assemble(AbstractSyntaxTree tree)
AstVisitorassemble in interface AstVisitortree - - abstract syntax treepublic final InsertImpl as(java.lang.String alias)
InsertAsStepas in interface InsertAsStepalias - alias of target tablepublic final InsertImpl columns(java.lang.String... columns)
columns in interface InsertColumnsStepcolumns - set of columnsInsertColumnsStep.columns(Expression...)public final InsertImpl columns(Expression... columns)
columns in interface InsertColumnsStepcolumns - set of columnspublic final InsertImpl overridingSystemValue()
InsertOverridingStepoverridingSystemValue in interface InsertOverridingSteppublic final InsertImpl overridingUserValue()
overridingUserValue in interface InsertOverridingSteppublic final InsertImpl defaultValues()
defaultValues in interface InsertDefaultValuesStep@SafeVarargs public final <T> InsertImpl values(T... values)
values in interface InsertValuesSteppublic final InsertImpl values(Expression... values)
values in interface InsertValuesSteppublic final InsertImpl query(Query query)
InsertValuesManyStepquery in interface InsertValuesManyStepquery - sub selectpublic final InsertImpl onConflict()
onConflict in interface InsertOnConflictSteppublic final InsertImpl onConflict(ConflictTarget... targets)
InsertOnConflictSteponConflict in interface InsertOnConflictSteptargets - targetQueryman.targetColumn(String),
Queryman.targetExpression(String)public final InsertImpl onConflict(java.lang.String indexColumnName)
InsertOnConflictStepInsertOnConflictStep.onConflict(ConflictTarget...)onConflict in interface InsertOnConflictStepindexColumnName - index column nameInsertOnConflictStep.onConflict(ConflictTarget...),
Queryman.targetColumn(String),
Queryman.targetExpression(String)public final InsertImpl onConstraint(java.lang.String name)
onConstraint in interface InsertOnConstraintSteppublic final InsertImpl doNothing()
doNothing in interface InsertConflictActionSteppublic final InsertImpl doUpdate()
doUpdate in interface InsertConflictActionSteppublic final <T> InsertImpl where(T left, T operator, T right)
InsertOnConflictWhereFirstStep
// SELECT * FROM book WHERE year > 2010
select("*")
.from("book")
.where("year", ">", "2010")
.sql()
where in interface InsertDoUpdateWhereFirstStepwhere in interface InsertOnConflictWhereFirstStepT - String, Expression, Operator or Query objectleft - left operandoperator - operatorright - right operandpublic final InsertImpl where(Conditions conditions)
InsertOnConflictWhereFirstStepconditions is a special case of condition,
like Queryman.conditionBetween(Object, Object, Object), or
Queryman.conditionSome(Object, Object, Query) etc.
See the first example.
conditions is a group of conditions are joined by AND, AND NOT,
OR and OR NOT operators. These conditions are being a grouped condition,
and will be surrounded by parentheses.
See the second example.
// SELECT * FROM book WHERE id BETWEEN 1 AND 10
select("*")
.from("book")
.where(conditionBetween("id", "1", "10"))
.sql()
The second example:
// SELECT * FROM book WHERE (id BETWEEN 1 AND 10 AND name = 'Advanced SQL')
select("*")
.from("book")
.where(
conditionBetween("id", "1", "10")
.and(asName("name"), operator("="), asString("Advanced SQL"))
)
.sql()
where in interface InsertDoUpdateWhereFirstStepwhere in interface InsertOnConflictWhereFirstStepconditions - conditionQueryman.condition(Object, Object, Object)public final InsertImpl whereExists(Query query)
InsertOnConflictWhereFirstStep
// SELECT * FROM book WHERE EXISTS (SELECT * FROM author)
select("*")
.from("book")
.whereExists(select("*").from("authors"))
.sql()
whereExists in interface InsertDoUpdateWhereFirstStepwhereExists in interface InsertOnConflictWhereFirstStepquery - subquerypublic final <T> InsertImpl and(T left, T operator, T right)
InsertOnConflictWhereManyStepsConditions.and(Object, Object, Object) method.and in interface InsertDoUpdateWhereManyStepsand in interface InsertOnConflictWhereManyStepsT - String, Expression, Operator or Query objectleft - left operandoperator - operatorright - right operandpublic final InsertImpl and(Conditions conditions)
InsertOnConflictWhereManyStepsConditions.and(Conditions) method.and in interface InsertDoUpdateWhereManyStepsand in interface InsertOnConflictWhereManyStepsconditions - conditionspublic final InsertImpl andExists(Query query)
InsertOnConflictWhereManyStepsConditions.andExists(Query) method.andExists in interface InsertDoUpdateWhereManyStepsandExists in interface InsertOnConflictWhereManyStepsquery - subquerypublic final <T> InsertImpl andNot(T left, T operator, T right)
InsertOnConflictWhereManyStepsConditions.andNot(Object, Object, Object) method.andNot in interface InsertDoUpdateWhereManyStepsandNot in interface InsertOnConflictWhereManyStepsT - String, Expression, Operator or Query objectleft - left operandoperator - operatorright - right operandpublic final InsertImpl andNot(Conditions conditions)
InsertOnConflictWhereManyStepsConditions.andNot(Conditions) method.andNot in interface InsertDoUpdateWhereManyStepsandNot in interface InsertOnConflictWhereManyStepsconditions - conditionspublic final InsertImpl andNotExists(Query query)
InsertOnConflictWhereManyStepsConditions.andNotExists(Query) method.andNotExists in interface InsertDoUpdateWhereManyStepsandNotExists in interface InsertOnConflictWhereManyStepsquery - subquerypublic final <T> InsertImpl or(T left, T operator, T right)
InsertOnConflictWhereManyStepsConditions.or(Object, Object, Object) method.or in interface InsertDoUpdateWhereManyStepsor in interface InsertOnConflictWhereManyStepsT - String, Expression, Operator or Query objectleft - left operandoperator - operatorright - right operandpublic final InsertImpl or(Conditions conditions)
InsertOnConflictWhereManyStepsConditions.or(Conditions) method.or in interface InsertDoUpdateWhereManyStepsor in interface InsertOnConflictWhereManyStepsconditions - conditionspublic final InsertImpl orExists(Query query)
InsertOnConflictWhereManyStepsConditions.orExists(Query) method.orExists in interface InsertDoUpdateWhereManyStepsorExists in interface InsertOnConflictWhereManyStepsquery - subquerypublic final <T> InsertImpl orNot(T left, T operator, T right)
InsertOnConflictWhereManyStepsConditions.orNot(Object, Object, Object) method.orNot in interface InsertDoUpdateWhereManyStepsorNot in interface InsertOnConflictWhereManyStepsT - String, Expression, Operator or Query objectleft - left operandoperator - operatorright - right operandpublic final InsertImpl orNot(Conditions conditions)
InsertOnConflictWhereManyStepsConditions.orNot(Conditions) method.orNot in interface InsertDoUpdateWhereManyStepsorNot in interface InsertOnConflictWhereManyStepsconditions - conditionspublic final InsertImpl orNotExists(Query query)
InsertOnConflictWhereManyStepsConditions.orNot(Conditions) method.orNotExists in interface InsertDoUpdateWhereManyStepsorNotExists in interface InsertOnConflictWhereManyStepsquery - subquerypublic final <T> InsertImpl set(java.lang.String column, T value)
InsertDoUpdateSetStepset in interface InsertDoUpdateSetStepcolumn - column namevalue - expression valuepublic final InsertImpl set(Expression listColumns, Expression listValues)
InsertDoUpdateSetStepset in interface InsertDoUpdateSetSteplistColumns - columns nameslistValues - expressions listpublic final InsertImpl set(Expression listColumns, Query subSelect)
InsertDoUpdateSetStepset in interface InsertDoUpdateSetSteplistColumns - columns namessubSelect - sub-select@SafeVarargs public final <T> InsertImpl returning(T... output)
InsertReturningStepreturning in interface InsertReturningStepoutput - list of output expressionsInsertReturningStep.returning(Expression...)public final InsertImpl returning(Expression... output)
InsertReturningStepreturning in interface InsertReturningStepoutput - list of output expressions