Package com.querydsl.sql.dml
Class AbstractSQLUpdateClause<C extends AbstractSQLUpdateClause<C>>
java.lang.Object
com.querydsl.sql.dml.AbstractSQLClause<C>
com.querydsl.sql.dml.AbstractSQLUpdateClause<C>
- Type Parameters:
C- The type extending this class.
- All Implemented Interfaces:
DMLClause<C>,StoreClause<C>,UpdateClause<C>,FilteredClause<C>
- Direct Known Subclasses:
SQLUpdateClause
public abstract class AbstractSQLUpdateClause<C extends AbstractSQLUpdateClause<C>>
extends AbstractSQLClause<C>
implements UpdateClause<C>
Provides a base class for dialect-specific UPDATE clauses.
- Author:
- tiwe
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<SQLUpdateBatch>protected final RelationalPath<?>protected static final Loggerprotected QueryMetadataprotected Stringprotected Map<Path<?>,Expression<?>> Fields inherited from class com.querydsl.sql.dml.AbstractSQLClause
configuration, context, listeners, useLiterals -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSQLUpdateClause(Connection connection, Configuration configuration, RelationalPath<?> entity) AbstractSQLUpdateClause(Supplier<Connection> connection, Configuration configuration, RelationalPath<?> entity) -
Method Summary
Modifier and TypeMethodDescriptionaddBatch()Add the current state of bindings as a batch itemaddFlag(QueryFlag.Position position, Expression<?> flag) Add the given Expression at the given position as a query flagaddFlag(QueryFlag.Position position, String flag) Add the given String literal at the given position as a query flagvoidclear()Clear the internal state of the clauseprotected PreparedStatementprotected Collection<PreparedStatement>longexecute()intgetSQL()Get the SQL string and bindingsbooleanisEmpty()limit(@org.jetbrains.annotations.Range(from=0L, to=2147483647L) long limit) Populate the UPDATE clause with the properties of the given bean.<T> CPopulate the UPDATE clause with the properties of the given bean using the given Mapper.<T> Cset(Path<T> path, Expression<? extends T> expression) <T> C<T> CtoString()Methods inherited from class com.querydsl.sql.dml.AbstractSQLClause
addListener, close, close, close, connection, createBindings, createSerializer, endContext, executeBatch, logQuery, onException, reset, setParameters, setUseLiterals, startContext
-
Field Details
-
logger
-
entity
-
batches
-
updates
-
metadata
-
queryString
-
constants
-
-
Constructor Details
-
AbstractSQLUpdateClause
public AbstractSQLUpdateClause(Connection connection, Configuration configuration, RelationalPath<?> entity) -
AbstractSQLUpdateClause
public AbstractSQLUpdateClause(Supplier<Connection> connection, Configuration configuration, RelationalPath<?> entity)
-
-
Method Details
-
addFlag
Add the given String literal at the given position as a query flag- Parameters:
position- positionflag- query flag- Returns:
- the current object
-
addFlag
Add the given Expression at the given position as a query flag- Parameters:
position- positionflag- query flag- Returns:
- the current object
-
addBatch
Add the current state of bindings as a batch item- Returns:
- the current object
-
clear
public void clear()Description copied from class:AbstractSQLClauseClear the internal state of the clause- Specified by:
clearin classAbstractSQLClause<C extends AbstractSQLUpdateClause<C>>
-
createStatement
- Throws:
SQLException
-
createStatements
- Throws:
SQLException
-
execute
public long execute()- Specified by:
executein interfaceDMLClause<C extends AbstractSQLUpdateClause<C>>
-
getSQL
Description copied from class:AbstractSQLClauseGet the SQL string and bindings- Specified by:
getSQLin classAbstractSQLClause<C extends AbstractSQLUpdateClause<C>>- Returns:
- SQL and bindings
-
set
- Specified by:
setin interfaceStoreClause<C extends AbstractSQLUpdateClause<C>>
-
set
- Specified by:
setin interfaceStoreClause<C extends AbstractSQLUpdateClause<C>>
-
setNull
- Specified by:
setNullin interfaceStoreClause<C extends AbstractSQLUpdateClause<C>>
-
set
- Specified by:
setin interfaceUpdateClause<C extends AbstractSQLUpdateClause<C>>
-
where
-
where
- Specified by:
wherein interfaceFilteredClause<C extends AbstractSQLUpdateClause<C>>
-
limit
-
toString
-
populate
Populate the UPDATE clause with the properties of the given bean. The properties need to match the fields of the clause's entity instance. Primary key columns are skipped in the population.- Parameters:
bean- bean to use for population- Returns:
- the current object
-
populate
Populate the UPDATE clause with the properties of the given bean using the given Mapper.- Parameters:
obj- object to use for populationmapper- mapper to use- Returns:
- the current object
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceStoreClause<C extends AbstractSQLUpdateClause<C>>
-
getBatchCount
public int getBatchCount()- Specified by:
getBatchCountin classAbstractSQLClause<C extends AbstractSQLUpdateClause<C>>
-