|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.query.BatchQuery
org.apache.cayenne.query.InsertBatchQuery
public class InsertBatchQuery
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.
Field Summary | |
---|---|
protected java.util.List<DbAttribute> |
dbAttributes
|
protected java.util.List<ObjectId> |
objectIds
|
protected java.util.List<java.util.Map> |
objectSnapshots
|
Fields inherited from class org.apache.cayenne.query.BatchQuery |
---|
batchIndex, dataMap, dbEntity, name |
Constructor Summary | |
---|---|
InsertBatchQuery(DbEntity entity,
int batchCapacity)
Creates new InsertBatchQuery for a given DbEntity and estimated capacity. |
Method Summary | |
---|---|
void |
add(java.util.Map snapshot)
Adds a snapshot to batch. |
void |
add(java.util.Map snapshot,
ObjectId id)
Adds a snapshot to batch. |
java.util.List<DbAttribute> |
getDbAttributes()
Returns a list of DbAttributes describing batch parameters. |
ObjectId |
getObjectId()
Returns an ObjectId associated with the current batch iteration. |
java.lang.Object |
getValue(int dbAttributeIndex)
Returns a value at a given index for the current batch iteration. |
int |
size()
Returns the number of parameter rows in a batch. |
Methods inherited from class org.apache.cayenne.query.BatchQuery |
---|
acceptVisitor, createSQLAction, getDataMap, getDbEntity, getMetaData, getName, getValue, isEmpty, isUsingOptimisticLocking, next, reset, route, setDataMap, setName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<ObjectId> objectIds
protected java.util.List<java.util.Map> objectSnapshots
protected java.util.List<DbAttribute> dbAttributes
Constructor Detail |
---|
public InsertBatchQuery(DbEntity entity, int batchCapacity)
Method Detail |
---|
public java.lang.Object getValue(int dbAttributeIndex)
BatchQuery
getValue
in class BatchQuery
public void add(java.util.Map snapshot)
public void add(java.util.Map snapshot, ObjectId id)
public int size()
BatchQuery
size
in class BatchQuery
public java.util.List<DbAttribute> getDbAttributes()
BatchQuery
getDbAttributes
in class BatchQuery
public ObjectId getObjectId()
getObjectId
in class BatchQuery
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |