|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ojb.broker.accesslayer.RsIterator
RsIterator can be used to iterate over a jdbc ResultSet to retrieve persistent objects step-by-step and not all at once. In fact the PersistenceBroker::getCollectionByQuery(...) method uses a RsIterator internally to build up a Collection of objects NOTE: this code uses features that only JDBC 2.0 compliant Drivers support. It will NOT work with JDBC 1.0 Drivers (e.g. SUN's JdbcOdbcDriver) If you are forced to use such a driver, you can use code from the 0.1.30 release.
Field Summary | |
protected static ObjectCache |
cache
|
protected boolean |
hasCalledCheck
|
protected boolean |
hasNext
|
protected java.lang.Class |
itemProxyClass
the proxy class to be used or null |
protected Logger |
logger
|
protected PersistenceBrokerImpl |
m_broker
reference to the PersistenceBroker |
protected ClassDescriptor |
m_mif
the classdescriptor providing the mapping information |
protected java.lang.Object[] |
m_row
this container holds the values of the current ro during materialisation |
protected java.sql.ResultSet |
m_rs
the underlying resultset |
Constructor Summary | |
protected |
RsIterator()
|
|
RsIterator(Query query,
ClassDescriptor mif,
PersistenceBrokerImpl broker)
RsIterator constructor. |
Method Summary | |
protected java.lang.Class |
getExtentClass()
|
protected Identity |
getIdentityFromResultSet()
returns an Identity object representing the current resultset row |
protected java.lang.Object |
getObjectFromResultSet()
returns a fully materialized Object from the current row of the underlying resultset. |
protected java.lang.Object |
getProxyFromResultSet()
Reads primary key information from current RS row and generates a corresponding Identity, and returns a proxy from the Identity. |
boolean |
hasNext()
returns true if there are still more rows in the underlying ResultSet. |
java.lang.Object |
next()
moves to the next row of the underlying ResultSet and returns the corresponding Object materialized from this row. |
void |
releaseDbResources()
Release all internally used Database resources of the iterator. |
void |
remove()
removing is not supported |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Logger logger
protected static ObjectCache cache
protected PersistenceBrokerImpl m_broker
protected java.sql.ResultSet m_rs
protected ClassDescriptor m_mif
protected java.lang.Class itemProxyClass
protected java.lang.Object[] m_row
protected boolean hasCalledCheck
protected boolean hasNext
Constructor Detail |
protected RsIterator()
public RsIterator(Query query, ClassDescriptor mif, PersistenceBrokerImpl broker)
mif
- ojb.broker.metadata.ClassDescriptorMethod Detail |
protected java.lang.Class getExtentClass()
public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next() throws java.util.NoSuchElementException
next
in interface java.util.Iterator
java.util.NoSuchElementException
public void remove()
remove
in interface java.util.Iterator
protected Identity getIdentityFromResultSet() throws PersistenceBrokerException
PersistenceBrokerException
protected java.lang.Object getObjectFromResultSet() throws PersistenceBrokerException
PersistenceBrokerException
protected java.lang.Object getProxyFromResultSet() throws PersistenceBrokerException
PersistenceBrokerException
public void releaseDbResources()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |