E
- the generic type of entities to update with this querypublic class UpdateQuery<E extends SQLEntity> extends BatchQuery<E>
avarage, batchBacklog, batchBacklogLimit, context, descriptor, mappings, MAX_BATCH_BACKLOG, mixing, oma, properties, query, stmt, type
Modifier | Constructor and Description |
---|---|
protected |
UpdateQuery(BatchContext context,
Class<E> type,
String[] mappings) |
Modifier and Type | Method and Description |
---|---|
protected void |
buildSQL()
Determines the SQL statement to prepare in
BatchQuery.prepareStmt() . |
protected List<Property> |
getPropertiesToUpdate() |
void |
update(E entity,
boolean invokeChecks,
boolean addBatch)
Updates the given entity in the database by comparing the mappings to compare and updating the mappings to update.
|
UpdateQuery<E> |
withUpdatedMappings(Mapping... mappingsToUpdate)
Specifies the list of mappings to update.
|
UpdateQuery<E> |
withUpdatedMappings(String... mappingsToUpdate)
Specifies the list of mappings to update.
|
addBatch, close, commit, createStmt, getDescriptor, getProperties, prepareStmt, safeClose, toString, tryCommit, withCustomBatchLimit
protected UpdateQuery(BatchContext context, Class<E> type, String[] mappings)
public UpdateQuery<E> withUpdatedMappings(Mapping... mappingsToUpdate)
Note that this must be called once before this first entity is updated and cannot be changed later.
mappingsToUpdate
- a list of mappings to updatepublic UpdateQuery<E> withUpdatedMappings(String... mappingsToUpdate)
Note that this must be called once before this first entity is updated and cannot be changed later.
mappingsToUpdate
- a list of mappings to updatepublic void update(@Nonnull E entity, boolean invokeChecks, boolean addBatch)
entity
- the entity to updateinvokeChecks
- determines if before- and after save checks should be performed (true)
or skipped (false)addBatch
- determines if the query should be executed instantly (false) or added to the
batch update (true).protected void buildSQL() throws SQLException
BatchQuery
BatchQuery.prepareStmt()
.buildSQL
in class BatchQuery<E extends SQLEntity>
SQLException
- in case of a database errorCopyright © 2018. All rights reserved.