C - The type extending this class.public abstract class AbstractSQLInsertClause<C extends AbstractSQLInsertClause<C>> extends AbstractSQLClause<C> implements InsertClause<C>
| Modifier and Type | Field and Description |
|---|---|
protected List<SQLInsertBatch> |
batches |
protected boolean |
batchToBulk |
protected List<Path<?>> |
columns |
protected List<Object> |
constants |
protected RelationalPath<?> |
entity |
protected static org.slf4j.Logger |
logger |
protected QueryMetadata |
metadata |
protected String |
queryString |
protected SubQueryExpression<?> |
subQuery |
protected SQLQuery<?> |
subQueryBuilder |
protected List<Expression<?>> |
values |
configuration, context, listeners, useLiterals| Constructor and Description |
|---|
AbstractSQLInsertClause(Connection connection,
Configuration configuration,
RelationalPath<?> entity) |
AbstractSQLInsertClause(Connection connection,
Configuration configuration,
RelationalPath<?> entity,
SQLQuery<?> subQuery) |
AbstractSQLInsertClause(javax.inject.Provider<Connection> connection,
Configuration configuration,
RelationalPath<?> entity) |
AbstractSQLInsertClause(javax.inject.Provider<Connection> connection,
Configuration configuration,
RelationalPath<?> entity,
SQLQuery<?> subQuery) |
| Modifier and Type | Method and Description |
|---|---|
C |
addBatch()
Add the current state of bindings as a batch item
|
C |
addFlag(QueryFlag.Position position,
Expression<?> flag)
Add the given Expression at the given position as a query flag
|
C |
addFlag(QueryFlag.Position position,
String flag)
Add the given String literal at the given position as a query flag
|
void |
clear()
Clear the internal state of the clause
|
C |
columns(Path<?>... columns) |
protected PreparedStatement |
createStatement(boolean withKeys) |
protected Collection<PreparedStatement> |
createStatements(boolean withKeys) |
long |
execute() |
<T> T |
executeWithKey(Class<T> type)
Execute the clause and return the generated key cast to the given type.
|
protected <T> T |
executeWithKey(Class<T> type,
Path<T> path) |
<T> T |
executeWithKey(Path<T> path)
Execute the clause and return the generated key with the type of the
given path.
|
ResultSet |
executeWithKeys()
Execute the clause and return the generated keys as a ResultSet
|
<T> List<T> |
executeWithKeys(Class<T> type) |
protected <T> List<T> |
executeWithKeys(Class<T> type,
Path<T> path) |
<T> List<T> |
executeWithKeys(Path<T> path)
Execute the clause and return the generated key with the type of the
given path.
|
int |
getBatchCount() |
List<SQLBindings> |
getSQL()
Get the SQL string and bindings
|
boolean |
isEmpty() |
C |
populate(Object bean)
Populate the INSERT clause with the properties of the given bean.
|
<T> C |
populate(T obj,
Mapper<T> mapper)
Populate the INSERT clause with the properties of the given bean using
the given Mapper.
|
protected PreparedStatement |
prepareStatementAndSetParameters(SQLSerializer serializer,
boolean withKeys) |
C |
select(SubQueryExpression<?> sq) |
<T> C |
set(Path<T> path,
Expression<? extends T> expression) |
<T> C |
set(Path<T> path,
T value) |
void |
setBatchToBulk(boolean b)
Set whether batches should be optimized into a single bulk operation.
|
<T> C |
setNull(Path<T> path) |
String |
toString() |
C |
values(Object... v) |
addListener, cleanupMDC, close, close, close, connection, createBindings, createSerializer, endContext, executeBatch, logQuery, onException, reset, setParameters, setUseLiterals, startContextprotected static final org.slf4j.Logger logger
protected final RelationalPath<?> entity
protected final QueryMetadata metadata
@Nullable protected SubQueryExpression<?> subQuery
protected final List<SQLInsertBatch> batches
protected final List<Expression<?>> values
protected transient String queryString
protected transient boolean batchToBulk
public AbstractSQLInsertClause(Connection connection, Configuration configuration, RelationalPath<?> entity, SQLQuery<?> subQuery)
public AbstractSQLInsertClause(Connection connection, Configuration configuration, RelationalPath<?> entity)
public AbstractSQLInsertClause(javax.inject.Provider<Connection> connection, Configuration configuration, RelationalPath<?> entity, SQLQuery<?> subQuery)
public AbstractSQLInsertClause(javax.inject.Provider<Connection> connection, Configuration configuration, RelationalPath<?> entity)
@WithBridgeMethods(value=SQLInsertClause.class, castRequired=true) public C addFlag(QueryFlag.Position position, String flag)
position - positionflag - query flag@WithBridgeMethods(value=SQLInsertClause.class, castRequired=true) public C addFlag(QueryFlag.Position position, Expression<?> flag)
position - positionflag - query flag@WithBridgeMethods(value=SQLInsertClause.class, castRequired=true) public C addBatch()
public void setBatchToBulk(boolean b)
public void clear()
AbstractSQLClauseclear in class AbstractSQLClause<C extends AbstractSQLInsertClause<C>>@WithBridgeMethods(value=SQLInsertClause.class, castRequired=true) public C columns(Path<?>... columns)
columns in interface InsertClause<C extends AbstractSQLInsertClause<C>>@Nullable public <T> T executeWithKey(Path<T> path)
T - path - path for keypublic <T> T executeWithKey(Class<T> type)
T - type - type of keypublic <T> List<T> executeWithKeys(Path<T> path)
T - path - path for keyprotected PreparedStatement createStatement(boolean withKeys) throws SQLException
SQLExceptionprotected Collection<PreparedStatement> createStatements(boolean withKeys) throws SQLException
SQLExceptionprotected PreparedStatement prepareStatementAndSetParameters(SQLSerializer serializer, boolean withKeys) throws SQLException
SQLExceptionpublic ResultSet executeWithKeys()
public long execute()
execute in interface DMLClause<C extends AbstractSQLInsertClause<C>>public List<SQLBindings> getSQL()
AbstractSQLClausegetSQL in class AbstractSQLClause<C extends AbstractSQLInsertClause<C>>@WithBridgeMethods(value=SQLInsertClause.class, castRequired=true) public C select(SubQueryExpression<?> sq)
select in interface InsertClause<C extends AbstractSQLInsertClause<C>>@WithBridgeMethods(value=SQLInsertClause.class, castRequired=true) public <T> C set(Path<T> path, T value)
set in interface StoreClause<C extends AbstractSQLInsertClause<C>>@WithBridgeMethods(value=SQLInsertClause.class, castRequired=true) public <T> C set(Path<T> path, Expression<? extends T> expression)
set in interface StoreClause<C extends AbstractSQLInsertClause<C>>@WithBridgeMethods(value=SQLInsertClause.class, castRequired=true) public <T> C setNull(Path<T> path)
setNull in interface StoreClause<C extends AbstractSQLInsertClause<C>>@WithBridgeMethods(value=SQLInsertClause.class, castRequired=true) public C values(Object... v)
values in interface InsertClause<C extends AbstractSQLInsertClause<C>>@WithBridgeMethods(value=SQLInsertClause.class, castRequired=true) public C populate(Object bean)
bean - bean to use for population@WithBridgeMethods(value=SQLInsertClause.class, castRequired=true) public <T> C populate(T obj, Mapper<T> mapper)
obj - object to use for populationmapper - mapper to usepublic boolean isEmpty()
isEmpty in interface StoreClause<C extends AbstractSQLInsertClause<C>>public int getBatchCount()
getBatchCount in class AbstractSQLClause<C extends AbstractSQLInsertClause<C>>Copyright © 2007–2020 Querydsl. All rights reserved.