Package org.apache.cayenne.query
Class InsertBatchQuery
java.lang.Object
org.apache.cayenne.query.BatchQuery
org.apache.cayenne.query.InsertBatchQuery
- All Implemented Interfaces:
Serializable
,Query
Batched INSERT query. Allows inserting multiple object snapshots (DataRows)
for a given DbEntity in a single query. InsertBatchQuery normally is not used
directly. Rather DataContext creates one internally when committing
DataObjects.
- See Also:
-
Field Summary
Fields inherited from class org.apache.cayenne.query.BatchQuery
dbAttributes, dbEntity, rows
-
Constructor Summary
ConstructorDescriptionInsertBatchQuery
(DbEntity entity, int batchCapacity) Creates new InsertBatchQuery for a given DbEntity and estimated capacity. -
Method Summary
Methods inherited from class org.apache.cayenne.query.BatchQuery
createSQLAction, getDbAttributes, getDbEntity, getMetaData, getRows, isUsingOptimisticLocking, route
-
Constructor Details
-
InsertBatchQuery
Creates new InsertBatchQuery for a given DbEntity and estimated capacity.
-
-
Method Details
-
add
Adds a snapshot to batch. A shortcut for "add(snapshot, null)". -
add
Adds a snapshot to batch. Optionally stores the object id for the snapshot. Note that snapshot can hold either the real values or the instances of java.util.Supplier that will be resolved to the actual value on the spot, thus allowing deferred propagated keys resolution.- Since:
- 1.2
-