|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.access.jdbc.JDBCResultIterator
public class JDBCResultIterator
A ResultIterator over the underlying JDBC ResultSet.
Field Summary | |
---|---|
protected boolean |
closed
|
protected boolean |
closingConnection
|
protected Connection |
connection
|
protected int |
fetchedSoFar
|
protected int |
fetchLimit
|
protected int |
mapCapacity
|
protected boolean |
nextRow
|
protected int[] |
pkIndices
|
protected ResultSet |
resultSet
|
protected DbEntity |
rootEntity
|
protected RowDescriptor |
rowDescriptor
|
protected Statement |
statement
|
Constructor Summary | |
---|---|
JDBCResultIterator(Connection connection,
Statement statement,
ResultSet resultSet,
RowDescriptor descriptor,
int fetchLimit)
Creates new JDBCResultIterator that reads from provided ResultSet. |
Method Summary | |
---|---|
protected void |
checkNextRow()
Moves internal ResultSet cursor position down one row. |
void |
close()
Closes ResultIterator and associated ResultSet. |
List |
dataRows(boolean close)
Returns all unread data rows from ResultSet, closing this iterator if needed. |
int |
getDataRowWidth()
Returns the number of columns in the result row. |
RowDescriptor |
getRowDescriptor()
|
boolean |
hasNextRow()
Returns true if there is at least one more record that can be read from the iterator. |
protected void |
indexPK()
Creates an index of PK columns in the RowDescriptor. |
boolean |
isClosingConnection()
Returns true if this iterator is responsible for closing its
connection, otherwise a user of the iterator must close the connection after
closing the iterator. |
Map |
nextDataRow()
Returns the next result row as a Map. |
Map |
nextObjectId(DbEntity entity)
Returns a map of ObjectId values from the next result row. |
protected Map |
readDataRow()
Reads a row from the internal ResultSet at the current cursor position. |
protected Map |
readIdRow()
Reads a row from the internal ResultSet at the current cursor position, processing only columns that are part of the ObjectId of a target class. |
void |
setClosingConnection(boolean flag)
Sets the closingConnection property. |
void |
skipDataRow()
Skips current data row instead of reading it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Connection connection
protected Statement statement
protected ResultSet resultSet
protected RowDescriptor rowDescriptor
protected DbEntity rootEntity
protected int[] pkIndices
protected int mapCapacity
protected boolean closingConnection
protected boolean closed
protected boolean nextRow
protected int fetchedSoFar
protected int fetchLimit
Constructor Detail |
---|
public JDBCResultIterator(Connection connection, Statement statement, ResultSet resultSet, RowDescriptor descriptor, int fetchLimit) throws CayenneException
CayenneException
Method Detail |
---|
public List dataRows(boolean close) throws CayenneException
dataRows
in interface ResultIterator
CayenneException
public boolean hasNextRow()
hasNextRow
in interface ResultIterator
public Map nextDataRow() throws CayenneException
nextDataRow
in interface ResultIterator
CayenneException
public Map nextObjectId(DbEntity entity) throws CayenneException
nextObjectId
in interface ResultIterator
CayenneException
public void skipDataRow() throws CayenneException
ResultIterator
skipDataRow
in interface ResultIterator
CayenneException
public void close() throws CayenneException
close
in interface ResultIterator
CayenneException
public int getDataRowWidth()
getDataRowWidth
in interface ResultIterator
protected void checkNextRow() throws CayenneException
CayenneException
protected Map readDataRow() throws CayenneException
CayenneException
protected Map readIdRow() throws CayenneException
CayenneException
protected void indexPK()
public boolean isClosingConnection()
true
if this iterator is responsible for closing its
connection, otherwise a user of the iterator must close the connection after
closing the iterator.
public void setClosingConnection(boolean flag)
closingConnection
property.
public RowDescriptor getRowDescriptor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |