public final class QueryResults
extends java.lang.Object
| Constructor and Description |
|---|
QueryResults(TransactionContext tx,
LockEngine engine,
PersistenceQuery query,
AccessMode accessMode,
Database db) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
absolute(int row) |
void |
close()
Close the query and release all resources held by the query.
|
java.lang.Object |
fetch()
Loads the specified object with the identity.
|
PersistenceQuery |
getQuery()
Returns the associated query.
|
java.lang.Class |
getResultType()
Returns the type of object returned by this query.
|
TransactionContext |
getTransaction()
Returns the transaction context in which this query was opened.
|
java.lang.Object |
nextIdentity()
Returns the identity of the next object to be returned.
|
int |
size() |
public QueryResults(TransactionContext tx, LockEngine engine, PersistenceQuery query, AccessMode accessMode, Database db)
public TransactionContext getTransaction()
public PersistenceQuery getQuery()
public java.lang.Class getResultType()
public java.lang.Object nextIdentity()
throws TransactionNotInProgressException,
PersistenceException
PersistenceException - An error reported by the
persistence engineTransactionNotInProgressException - The transaction
has been closedpublic java.lang.Object fetch()
throws TransactionNotInProgressException,
PersistenceException,
ObjectNotFoundException,
LockNotGrantedException
nextIdentity().
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 an ObjectNotFoundException. The query may proceed to the next
identity.
If the object has been deleted in this transaction, this method
will report an ObjectNotFoundException. However, the
caller may iterate to and obtain the next object.
This method is equivalent to TransactionContext.fetch(org.exolab.castor.persist.ClassMolder, org.exolab.castor.persist.spi.Identity, org.exolab.castor.mapping.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.
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 closedpublic void close()
public boolean absolute(int row)
throws PersistenceException
PersistenceExceptionpublic int size()
throws PersistenceException
PersistenceExceptionIntalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com