public class InsertSelectQuery extends BaseCTEQuery<ThisType>
Modifier and Type | Field and Description |
---|---|
protected SqlObjectList<SqlObject> |
_columns |
ALL_SYMBOL, NULL_VALUE, QUESTION_MARK
Constructor and Description |
---|
InsertSelectQuery(Object tableStr) |
InsertSelectQuery(Table table) |
Modifier and Type | Method and Description |
---|---|
InsertSelectQuery |
addColumns(Column... columns)
Adds the given columns to the query
|
InsertSelectQuery |
addCustomColumns(Object... columnStrs)
Adds the given columns to the query
|
protected void |
appendPrefixTo(AppendableExt app)
Appends the prefix "INSERT INTO (<columns>)" to the given
AppendableExt.
|
protected void |
appendTo(AppendableExt app,
SqlContext newContext)
Appends the sql query to the given AppendableExt within the given,
modifiable SqlContext.
|
protected void |
collectSchemaObjects(ValidationContext vContext)
Used during Query.validate() calls to collect the dbschema objects
referenced in a query.
|
InsertSelectQuery |
setSelectQuery(SelectQuery selectQuery)
Sets the SELECT query which will generate the data to insert into the
table
|
void |
validate(ValidationContext vContext)
Runs validation on this verifiable object using a previously collected
ValidationContext.
|
addCommonTableExpression, prependTo, setRecursive
appendTo, getThisType, validate, validateTables
addCustomization, customAppendTo, customAppendTo, maybeAppendTo, maybeAppendTo
collectSchemaObjects, doValidate, toString
toString, toString
protected SqlObjectList<SqlObject> _columns
public InsertSelectQuery(Table table)
table
- table into which to insert the values.public InsertSelectQuery(Object tableStr)
tableStr
- name of the table into which to insert the values.
Object
-> SqlObject
conversions handled by
Converter.toColumnSqlObject(Object)
.public InsertSelectQuery setSelectQuery(SelectQuery selectQuery)
public InsertSelectQuery addCustomColumns(Object... columnStrs)
Object
-> SqlObject
conversions handled by
Converter.CUSTOM_COLUMN_TO_OBJ
.
public InsertSelectQuery addColumns(Column... columns)
protected void collectSchemaObjects(ValidationContext vContext)
SqlObject
vContext
- handle to the current validation contextpublic void validate(ValidationContext vContext) throws ValidationException
Verifiable
In general, this method will only be called internally, not by users.
validate
in interface Verifiable<InsertSelectQuery>
validate
in class Query<InsertSelectQuery>
vContext
- handle to the current, filled-in validation contextValidationException
protected void appendTo(AppendableExt app, SqlContext newContext) throws IOException
Query
Query.appendTo(AppendableExt)
method within the context of calls to
SqlContext.pushContext(com.healthmarketscience.common.util.AppendableExt)
and SqlContext.popContext(com.healthmarketscience.common.util.AppendableExt, com.healthmarketscience.sqlbuilder.SqlContext)
, so
the implementation is free to modify the given SqlContext.appendTo
in class Query<InsertSelectQuery>
app
- the target for the sql query generationnewContext
- modifiable SqlContext for nested AppendeesIOException
protected void appendPrefixTo(AppendableExt app) throws IOException
IOException
Copyright © 2006–2021 OpenHMS. All rights reserved.