Package org.apache.cayenne.query
Class BatchQuery
java.lang.Object
org.apache.cayenne.query.BatchQuery
- All Implemented Interfaces:
- Serializable,- Query
- Direct Known Subclasses:
- DeleteBatchQuery,- InsertBatchQuery,- UpdateBatchQuery
public abstract class BatchQuery extends Object implements Query
BatchQuery and its descendants allow to group similar data for the batch
 database modifications, including inserts, updates and deletes. Single
 BatchQuery corresponds to a parameterized PreparedStatement and a matrix of
 values.
- See Also:
- Serialized Form
- 
Field SummaryFields Modifier and Type Field Description protected List<DbAttribute>dbAttributesprotected DbEntitydbEntityprotected List<BatchQueryRow>rows
- 
Constructor SummaryConstructors Constructor Description BatchQuery(DbEntity dbEntity, List<DbAttribute> dbAttributes, int batchCapacity)
- 
Method SummaryModifier and Type Method Description SQLActioncreateSQLAction(SQLActionVisitor visitor)Calls "batchAction" on the visitor.List<DbAttribute>getDbAttributes()Returns a list of DbAttributes describing batch parameters.DbEntitygetDbEntity()Returns a DbEntity associated with this batch.QueryMetadatagetMetaData(EntityResolver resolver)Returns default select parameters.List<BatchQueryRow>getRows()booleanisUsingOptimisticLocking()Returns true if the batch query uses optimistic locking.voidroute(QueryRouter router, EntityResolver resolver, Query substitutedQuery)A callback method invoked by Cayenne during the routing phase of the query execution.
- 
Field Details- 
dbEntity- Since:
- 1.2
 
- 
rows- Since:
- 4.0
 
- 
dbAttributes
 
- 
- 
Constructor Details- 
BatchQuery- Since:
- 4.0
 
 
- 
- 
Method Details- 
getRows- Since:
- 4.0
 
- 
getMetaDataReturns default select parameters.- Specified by:
- getMetaDatain interface- Query
- Since:
- 1.2
 
- 
routeDescription copied from interface:QueryA callback method invoked by Cayenne during the routing phase of the query execution. Mapping of DataNodes is provided by QueryRouter. Query should use aQueryRouter.route(QueryEngine, Query, Query)callback method to route itself. Query can create one or more substitute queries or even provide its own QueryEngine to execute itself.
- 
createSQLActionCalls "batchAction" on the visitor.- Specified by:
- createSQLActionin interface- Query
- Since:
- 1.2
 
- 
isUsingOptimisticLockingpublic boolean isUsingOptimisticLocking()Returns true if the batch query uses optimistic locking.- Since:
- 1.1
 
- 
getDbEntityReturns a DbEntity associated with this batch.
- 
getDbAttributesReturns a list of DbAttributes describing batch parameters.
 
-