Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.exolab.castor.persist.QueryResults
public final class QueryResults
extends java.lang.Object
Constructor Summary | |
|
Method Summary | |
boolean |
|
void |
|
Object |
|
PersistenceQuery |
|
Class |
|
TransactionContext |
|
Object |
|
int |
|
(package private) QueryResults(TransactionContext tx, LockEngine engine, PersistenceQuery query, AccessMode accessMode, Database db)
public void close()
Close the query and release all resources held by the query.
public Object fetch() throws TransactionNotInProgressException, PersistenceException, ObjectNotFoundException, LockNotGrantedException
Loads the specified object with the identity. The identity must have been retrieved with a call tonextIdentity()
. If the object is locked by another transaction this method will block until the lock is released, or a timeout occured. If a timeout occurs or the object has been deleted by the other transaction, this method will report anObjectNotFoundException
. The query may proceed to the next identity. If the object has been deleted in this transaction, this method will report anObjectNotFoundException
. However, the caller may iterate to and obtain the next object. This method is equivalent toTransactionContext.fetch(LockEngine,ClassMolder,Object,AccessMode)
with a know cache engine, identity and lock and acts on the query results rather than issuing a new query to load the object.
- Returns:
- The loaded object
- Throws:
ObjectNotFoundException
- The object was not found in persistent storageLockNotGrantedException
- Could not acquire a lock on the objectPersistenceException
- An error reported by the persistence engineTransactionNotInProgressException
- The transaction has been closed
public Class getResultType()
Returns the type of object returned by this query.
- Returns:
- The type of object returned by this query
public TransactionContext getTransaction()
Returns the transaction context in which this query was opened. The transaction may be closed.
- Returns:
- The query's transaction context
public Object nextIdentity() throws TransactionNotInProgressException, PersistenceException
Returns the identity of the next object to be returned. Calling this method multiple time will skip objects. When the result set has been exhuasted, this method will return null.
- Returns:
- The identity of the next object
- Throws:
PersistenceException
- An error reported by the persistence engineTransactionNotInProgressException
- The transaction has been closed