public abstract class BatchQuery extends Object implements Query
Modifier and Type | Field and Description |
---|---|
protected int |
batchIndex |
protected DataMap |
dataMap |
protected DbEntity |
dbEntity |
protected String |
name |
Constructor and Description |
---|
BatchQuery(DbEntity dbEntity) |
Modifier and Type | Method and Description |
---|---|
<T> T |
acceptVisitor(ConfigurationNodeVisitor<T> visitor) |
SQLAction |
createSQLAction(SQLActionVisitor visitor)
Calls "batchAction" on the visitor.
|
DataMap |
getDataMap() |
abstract List<DbAttribute> |
getDbAttributes()
Returns a list of DbAttributes describing batch parameters.
|
DbEntity |
getDbEntity()
Returns a DbEntity associated with this batch.
|
QueryMetadata |
getMetaData(EntityResolver resolver)
Returns default select parameters.
|
String |
getName()
Returns a symbolic name of the query.
|
ObjectId |
getObjectId()
Returns an ObjectId associated with the current batch iteration.
|
abstract Object |
getValue(int valueIndex)
Returns a value at a given index for the current batch iteration.
|
protected Object |
getValue(Map<String,Object> valueMap,
DbAttribute attribute)
A helper method used by subclasses to resolve deferred values on demand.
|
boolean |
isEmpty()
Returns
true if this batch query has no parameter rows. |
boolean |
isUsingOptimisticLocking()
Returns true if the batch query uses optimistic locking.
|
boolean |
next()
Repositions batch to the next object, so that subsequent calls to getObject(int)
would return the values of the next batch object.
|
void |
reset()
Rewinds batch to the first parameter row.
|
void |
route(QueryRouter router,
EntityResolver resolver,
Query substitutedQuery)
A callback method invoked by Cayenne during the routing phase of the query
execution.
|
void |
setDataMap(DataMap dataMap) |
void |
setName(String name) |
abstract int |
size()
Returns the number of parameter rows in a batch.
|
protected int batchIndex
protected DbEntity dbEntity
protected String name
protected DataMap dataMap
public BatchQuery(DbEntity dbEntity)
public <T> T acceptVisitor(ConfigurationNodeVisitor<T> visitor)
acceptVisitor
in interface ConfigurationNode
public String getName()
Query
public void setName(String name)
public DataMap getDataMap()
getDataMap
in interface Query
public void setDataMap(DataMap dataMap)
public QueryMetadata getMetaData(EntityResolver resolver)
getMetaData
in interface Query
public void route(QueryRouter router, EntityResolver resolver, Query substitutedQuery)
Query
QueryRouter.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.public SQLAction createSQLAction(SQLActionVisitor visitor)
createSQLAction
in interface Query
public boolean isUsingOptimisticLocking()
public DbEntity getDbEntity()
public boolean isEmpty()
true
if this batch query has no parameter rows.public abstract List<DbAttribute> getDbAttributes()
public void reset()
public boolean next()
true
if
batch has more objects to iterate over, false
otherwise.public abstract Object getValue(int valueIndex)
public abstract int size()
protected Object getValue(Map<String,Object> valueMap, DbAttribute attribute)
public ObjectId getObjectId()
Default implementation simply returns null.
Copyright © 2001–2014 Apache Cayenne. All rights reserved.