|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exolab.castor.persist.spi.AbstractCallQuery
public abstract class AbstractCallQuery
| Field Summary | |
|---|---|
protected String |
_call
|
protected Identity |
_lastIdentity
|
protected ResultSet |
_rs
|
protected PreparedStatement |
_stmt
|
protected Object[] |
_values
|
| Constructor Summary | |
|---|---|
protected |
AbstractCallQuery(String call,
Class<?>[] types,
Class<?> javaClass,
int[] sqlTypes)
|
| Method Summary | |
|---|---|
boolean |
absolute(int row)
Moves the result of the query to the absolute position in the resultset. |
void |
close()
Close the query and release all resources held by the query. |
protected abstract void |
execute(Object conn,
AccessMode accessMode)
|
void |
execute(Object conn,
AccessMode accessMode,
boolean scrollable)
Execute the query with the give connection and lock type. |
void |
fetch(ProposedEntity proposedObject)
Loades the object. |
int |
getParameterCount()
|
Class<?> |
getParameterType(int index)
|
Class<?> |
getResultType()
Returns the type of object returned by this query. |
Identity |
nextIdentity(Identity identity)
Returns the identity of the next object to be returned. |
protected abstract boolean |
nextRow()
|
void |
setParameter(int index,
Object value)
Sets the value of a paramter. |
int |
size()
Finds the size of the resulting resultset from the query. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PreparedStatement _stmt
protected ResultSet _rs
protected Identity _lastIdentity
protected final Object[] _values
protected final String _call
| Constructor Detail |
|---|
protected AbstractCallQuery(String call,
Class<?>[] types,
Class<?> javaClass,
int[] sqlTypes)
| Method Detail |
|---|
protected abstract boolean nextRow()
throws SQLException
SQLException
public void fetch(ProposedEntity proposedObject)
throws PersistenceException
PersistenceQueryPersistenceQuery.nextIdentity(org.exolab.castor.persist.spi.Identity) with the same identity.
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.
This method is equivalent to Persistence.load(java.lang.Object, org.castor.persist.ProposedEntity, org.exolab.castor.persist.spi.Identity, org.exolab.castor.mapping.AccessMode) with a
known cache engine and access mode and acts on the query
results rather than issuing a new query to load the object.
fetch in interface PersistenceQueryproposedObject - The fields to load into
PersistenceException - The object was not found in
persistent storage or any other persistence error occured.Persistence.load(java.lang.Object, org.castor.persist.ProposedEntity, org.exolab.castor.persist.spi.Identity, org.exolab.castor.mapping.AccessMode)public void close()
PersistenceQuery
close in interface PersistenceQuerypublic int getParameterCount()
public Class<?> getParameterType(int index)
throws ArrayIndexOutOfBoundsException
ArrayIndexOutOfBoundsException
public void setParameter(int index,
Object value)
throws ArrayIndexOutOfBoundsException,
IllegalArgumentException
PersistenceQuery
setParameter in interface PersistenceQueryindex - The parameter indexvalue - The parameter value
ArrayIndexOutOfBoundsException
IllegalArgumentException
public boolean absolute(int row)
throws PersistenceException
PersistenceQuery
absolute in interface PersistenceQueryrow - The row to move to
PersistenceException - A persistence error occured
public int size()
throws PersistenceException
PersistenceQuery
size in interface PersistenceQueryPersistenceExceptionpublic Class<?> getResultType()
PersistenceQuery
getResultType in interface PersistenceQuery
public void execute(Object conn,
AccessMode accessMode,
boolean scrollable)
throws PersistenceException
PersistenceQueryPersistenceQuery.nextIdentity(org.exolab.castor.persist.spi.Identity) and PersistenceQuery.fetch(org.castor.persist.ProposedEntity). The
query parameters will be reset. A new query may be issued by
providing new query parameters and calling PersistenceQuery.execute(Object, AccessMode, boolean).
execute in interface PersistenceQueryconn - An open connectionaccessMode - The access mode (null equals shared)scrollable - The db cursor mode.
PersistenceException - An invalid query or an error reported
by the persistence engine.
protected abstract void execute(Object conn,
AccessMode accessMode)
throws PersistenceException
PersistenceException
public Identity nextIdentity(Identity identity)
throws PersistenceException
PersistenceQuery
nextIdentity in interface PersistenceQueryidentity - The identity of the previous object,
null if this method is called for the first time
PersistenceException - An error reported by the
persistence engine
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||