|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.benow.repository.query.QueryContext
public class QueryContext
A QueryContext is an accessor to an instance of a query. It uses the field information of a given query, along with supplied field values to perform a query. The separation between QueryContext and ClassQuery allows for query preparation before execution, speeding things up, and also allows for re-entrant code (multiple of the same query executing simultaneously).
| Nested Class Summary | |
|---|---|
static class |
QueryContext.ObjectsIterator
repository: org.benow.repository.query.ObjectsIterator |
static class |
QueryContext.OrderField
|
| Method Summary | |
|---|---|
QueryContext |
bind(int val)
Adds an int to this context, returning this |
QueryContext |
bind(long from)
|
QueryContext |
bind(java.lang.Object val)
Adds an object to this context, returning this |
org.benow.java.collection.SubList<? extends PersistentObject> |
getAllObjects(Transaction tx)
|
java.lang.Class |
getClassToQuery()
|
PersistentObject |
getObject()
|
java.lang.Object |
getObject(Transaction tx)
|
ResultIterator<? extends PersistentObject> |
getObjectIterator()
|
ResultIterator<? extends PersistentObject> |
getObjectIterator(Transaction tx)
|
java.util.List |
getObjects()
Gets object using a one-off transaction from default connection to default repository realm. |
org.benow.java.collection.SubList |
getObjects(int starting,
int spanning)
|
PersistentList |
getObjects(int from,
int spanning,
Transaction tx)
|
void |
getObjects(JSQLList<?> holder,
int starting,
int spanning)
|
PersistentList |
getObjects(PersistentArrayList objects,
Transaction tx)
Gets all objects into the given collection |
PersistentList<? extends PersistentObject> |
getObjects(PopulateableArray objects,
int starting,
int spanning,
Transaction tx)
Fetches a subset of objects as dictated by this query into the given collection. |
java.util.List |
getObjects(Transaction tx)
|
QueryContext.ObjectsIterator |
getObjectsIterator(Transaction tx)
Returns an $ObjectsIterator over the objects (and specifications) in the query. |
java.lang.Object[] |
getParameters()
|
ClassQuery |
getQuery()
|
int |
getSpanning()
|
int |
getStartIndex()
|
boolean |
hasParameters()
|
void |
setOrderField(QueryContext.OrderField orderPair)
|
void |
setOrderField(java.lang.String fieldName)
Orders ascending by given field. |
void |
setOrderField(java.lang.String fieldName,
QueryContext.OrderField.Ordering ordering)
|
void |
setOrderFields(QueryContext.OrderField[] orderPairs)
|
void |
setOrderStatement(java.lang.String ordering)
|
void |
setSpanning(int spanning)
|
void |
setStartIndex(int startIdx)
Fetch object starting from this index |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public void setSpanning(int spanning)
spanning - public void setStartIndex(int startIdx)
startIdx - public int getSpanning()
public void setOrderStatement(java.lang.String ordering)
public QueryContext.ObjectsIterator getObjectsIterator(Transaction tx)
throws ObjectRepositoryException
tx -
ObjectRepositoryException - on initial fetch errorSubList
public java.lang.Object getObject(Transaction tx)
throws NoSuchObjectException,
ObjectRepositoryException
tx -
ObjectRepositoryException
NoSuchObjectException
public java.util.List getObjects(Transaction tx)
throws ObjectRepositoryException
tx -
ObjectRepositoryExceptionpublic QueryContext bind(int val)
val -
public QueryContext bind(java.lang.Object val)
val -
public java.lang.Class getClassToQuery()
public ClassQuery getQuery()
public java.lang.Object[] getParameters()
public int getStartIndex()
public boolean hasParameters()
public QueryContext bind(long from)
from -
public PersistentList getObjects(int from,
int spanning,
Transaction tx)
throws ObjectRepositoryException
from - spanning - tx -
ObjectRepositoryException
public PersistentList getObjects(PersistentArrayList objects,
Transaction tx)
throws ObjectRepositoryException
objects - tx -
ObjectRepositoryException
public PersistentList<? extends PersistentObject> getObjects(PopulateableArray objects,
int starting,
int spanning,
Transaction tx)
throws ObjectRepositoryException
objects - starting - spanning - tx -
ObjectRepositoryExceptionpublic java.lang.String toString()
toString in class java.lang.Object
public org.benow.java.collection.SubList<? extends PersistentObject> getAllObjects(Transaction tx)
throws ObjectRepositoryException
tx -
ObjectRepositoryException
public java.util.List getObjects()
throws ObjectRepositoryError
ObjectRepositoryError
public PersistentObject getObject()
throws NoSuchObjectException
NoSuchObjectException
public org.benow.java.collection.SubList getObjects(int starting,
int spanning)
public void getObjects(JSQLList<?> holder,
int starting,
int spanning)
public ResultIterator<? extends PersistentObject> getObjectIterator()
public ResultIterator<? extends PersistentObject> getObjectIterator(Transaction tx)
public void setOrderField(QueryContext.OrderField orderPair)
public void setOrderFields(QueryContext.OrderField[] orderPairs)
public void setOrderField(java.lang.String fieldName,
QueryContext.OrderField.Ordering ordering)
public void setOrderField(java.lang.String fieldName)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||