C
- The type extending this class.public abstract class AbstractSQLUpdateClause<C extends AbstractSQLUpdateClause<C>> extends AbstractSQLClause<C> implements UpdateClause<C>
Modifier and Type | Field and Description |
---|---|
protected List<SQLUpdateBatch> |
batches |
protected List<Object> |
constants |
protected RelationalPath<?> |
entity |
protected static org.slf4j.Logger |
logger |
protected QueryMetadata |
metadata |
protected String |
queryString |
protected Map<Path<?>,Expression<?>> |
updates |
configuration, context, listeners, useLiterals
Constructor and Description |
---|
AbstractSQLUpdateClause(Connection connection,
Configuration configuration,
RelationalPath<?> entity) |
AbstractSQLUpdateClause(javax.inject.Provider<Connection> connection,
Configuration configuration,
RelationalPath<?> entity) |
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
|
protected PreparedStatement |
createStatement() |
protected Collection<PreparedStatement> |
createStatements() |
long |
execute()
Execute the clause and return the amount of affected rows
|
int |
getBatchCount() |
List<SQLBindings> |
getSQL()
Get the SQL string and bindings
|
boolean |
isEmpty()
Returns true, if no bindings have been set, otherwise false.
|
C |
limit(long limit) |
C |
populate(Object bean)
Populate the UPDATE clause with the properties of the given bean.
|
<T> C |
populate(T obj,
Mapper<T> mapper)
Populate the UPDATE clause with the properties of the given bean using the given Mapper.
|
C |
set(List<? extends Path<?>> paths,
List<?> values)
Set the paths to be updated
|
<T> C |
set(Path<T> path,
Expression<? extends T> expression)
Add an expression binding
|
<T> C |
set(Path<T> path,
T value)
Add a value binding
|
<T> C |
setNull(Path<T> path)
Bind the given path to null
|
String |
toString() |
C |
where(Predicate... o)
Adds the given filter conditions
|
C |
where(Predicate p) |
addListener, cleanupMDC, close, close, close, connection, createBindings, createSerializer, endContext, executeBatch, logQuery, onException, reset, setParameters, setUseLiterals, startContext
protected static final org.slf4j.Logger logger
protected final RelationalPath<?> entity
protected final List<SQLUpdateBatch> batches
protected Map<Path<?>,Expression<?>> updates
protected QueryMetadata metadata
protected transient String queryString
public AbstractSQLUpdateClause(Connection connection, Configuration configuration, RelationalPath<?> entity)
public AbstractSQLUpdateClause(javax.inject.Provider<Connection> connection, Configuration configuration, RelationalPath<?> entity)
@WithBridgeMethods(value=SQLUpdateClause.class, castRequired=true) public C addFlag(QueryFlag.Position position, String flag)
position
- positionflag
- query flag@WithBridgeMethods(value=SQLUpdateClause.class, castRequired=true) public C addFlag(QueryFlag.Position position, Expression<?> flag)
position
- positionflag
- query flag@WithBridgeMethods(value=SQLUpdateClause.class, castRequired=true) public C addBatch()
public void clear()
AbstractSQLClause
clear
in class AbstractSQLClause<C extends AbstractSQLUpdateClause<C>>
protected PreparedStatement createStatement() throws SQLException
SQLException
protected Collection<PreparedStatement> createStatements() throws SQLException
SQLException
public long execute()
DMLClause
execute
in interface DMLClause<C extends AbstractSQLUpdateClause<C>>
public List<SQLBindings> getSQL()
AbstractSQLClause
getSQL
in class AbstractSQLClause<C extends AbstractSQLUpdateClause<C>>
@WithBridgeMethods(value=SQLUpdateClause.class, castRequired=true) public <T> C set(Path<T> path, T value)
StoreClause
set
in interface StoreClause<C extends AbstractSQLUpdateClause<C>>
path
- path to be updatedvalue
- value to set@WithBridgeMethods(value=SQLUpdateClause.class, castRequired=true) public <T> C set(Path<T> path, Expression<? extends T> expression)
StoreClause
set
in interface StoreClause<C extends AbstractSQLUpdateClause<C>>
path
- path to be updatedexpression
- binding@WithBridgeMethods(value=SQLUpdateClause.class, castRequired=true) public <T> C setNull(Path<T> path)
StoreClause
setNull
in interface StoreClause<C extends AbstractSQLUpdateClause<C>>
path
- path to be updated@WithBridgeMethods(value=SQLUpdateClause.class, castRequired=true) public C set(List<? extends Path<?>> paths, List<?> values)
UpdateClause
set
in interface UpdateClause<C extends AbstractSQLUpdateClause<C>>
paths
- paths to be updatedvalues
- values to be set@WithBridgeMethods(value=SQLUpdateClause.class, castRequired=true) public C where(Predicate p)
@WithBridgeMethods(value=SQLUpdateClause.class, castRequired=true) public C where(Predicate... o)
FilteredClause
Skips null arguments
where
in interface FilteredClause<C extends AbstractSQLUpdateClause<C>>
o
- filter conditions to be added@WithBridgeMethods(value=SQLUpdateClause.class, castRequired=true) public C limit(@Nonnegative long limit)
@WithBridgeMethods(value=SQLUpdateClause.class, castRequired=true) public C populate(Object bean)
bean
- bean to use for population@WithBridgeMethods(value=SQLUpdateClause.class, castRequired=true) public <T> C populate(T obj, Mapper<T> mapper)
obj
- object to use for populationmapper
- mapper to usepublic boolean isEmpty()
StoreClause
isEmpty
in interface StoreClause<C extends AbstractSQLUpdateClause<C>>
public int getBatchCount()
getBatchCount
in class AbstractSQLClause<C extends AbstractSQLUpdateClause<C>>
Copyright © 2007–2020 Querydsl. All rights reserved.