Package org.apache.cayenne.query
Class UpdateBatchQuery
java.lang.Object
org.apache.cayenne.query.BatchQuery
org.apache.cayenne.query.UpdateBatchQuery
- All Implemented Interfaces:
- Serializable,- Query
public class UpdateBatchQuery extends BatchQuery
Batched UPDATE query.
- See Also:
- Serialized Form
- 
Field SummaryFields Modifier and Type Field Description protected booleanusingOptimisticLockingFields inherited from class org.apache.cayenne.query.BatchQuerydbAttributes, dbEntity, rows
- 
Constructor SummaryConstructors Constructor Description UpdateBatchQuery(DbEntity dbEntity, List<DbAttribute> qualifierAttributes, List<DbAttribute> updatedAttributes, Collection<String> nullQualifierNames, int batchCapacity)Creates new UpdateBatchQuery.
- 
Method SummaryModifier and Type Method Description voidadd(Map<String,Object> qualifierSnapshot, Map<String,Object> updateSnapshot)Adds a parameter row to the batch.voidadd(Map<String,Object> qualifierSnapshot, Map<String,Object> updateSnapshot, ObjectId id)Adds a parameter row to the batch.List<DbAttribute>getDbAttributes()Returns a list of DbAttributes describing batch parameters.List<DbAttribute>getQualifierAttributes()List<DbAttribute>getUpdatedAttributes()booleanisNull(DbAttribute attribute)Returns true if a given attribute always has a null value in the batch.booleanisUsingOptimisticLocking()Returns true if the batch query uses optimistic locking.voidsetUsingOptimisticLocking(boolean usingOptimisticLocking)Methods inherited from class org.apache.cayenne.query.BatchQuerycreateSQLAction, getDbEntity, getMetaData, getRows, route
- 
Field Details- 
usingOptimisticLockingprotected boolean usingOptimisticLocking
 
- 
- 
Constructor Details- 
UpdateBatchQuerypublic UpdateBatchQuery(DbEntity dbEntity, List<DbAttribute> qualifierAttributes, List<DbAttribute> updatedAttributes, Collection<String> nullQualifierNames, int batchCapacity)Creates new UpdateBatchQuery.- Parameters:
- dbEntity- Table or view to update.
- qualifierAttributes- DbAttributes used in the WHERE clause.
- nullQualifierNames- DbAttribute names in the WHERE clause that have null values.
- updatedAttributes- DbAttributes describing updated columns.
- batchCapacity- Estimated size of the batch.
 
 
- 
- 
Method Details- 
isNullReturns true if a given attribute always has a null value in the batch.- Since:
- 1.1
 
- 
isUsingOptimisticLockingpublic boolean isUsingOptimisticLocking()Returns true if the batch query uses optimistic locking.- Overrides:
- isUsingOptimisticLockingin class- BatchQuery
- Since:
- 1.1
 
- 
setUsingOptimisticLockingpublic void setUsingOptimisticLocking(boolean usingOptimisticLocking)- Since:
- 1.1
 
- 
addAdds a parameter row to the batch.
- 
addpublic void add(Map<String,Object> qualifierSnapshot, Map<String,Object> updateSnapshot, ObjectId id)Adds a parameter row to the batch.- Since:
- 1.2
 
- 
getDbAttributesDescription copied from class:BatchQueryReturns a list of DbAttributes describing batch parameters.- Overrides:
- getDbAttributesin class- BatchQuery
 
- 
getUpdatedAttributes- Since:
- 1.1
 
- 
getQualifierAttributes- Since:
- 1.1
 
 
-