|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.access.jdbc.DistinctResultIterator
public class DistinctResultIterator
A ResultIterator that does in-memory filtering of rows to return only distinct rows. Distinct comparison is done by comparing ObjectIds created from each row. Internally DistinctResultIterator wraps another ResultIterator that provides the actual rows.
Field Summary | |
---|---|
protected boolean |
compareFullRows
|
protected DbEntity |
defaultEntity
|
protected java.util.Set<java.util.Map<java.lang.String,java.lang.Object>> |
fetchedIds
|
protected java.lang.Object |
nextDataRow
|
protected ResultIterator |
wrappedIterator
|
Constructor Summary | |
---|---|
DistinctResultIterator(ResultIterator wrappedIterator,
DbEntity defaultEntity,
boolean compareFullRows)
Creates new DistinctResultIterator wrapping another ResultIterator. |
Method Summary | |
---|---|
java.util.List<?> |
allRows()
Returns all yet unread rows from ResultSet without closing it. |
void |
close()
CLoses underlying ResultIterator. |
boolean |
hasNextRow()
Returns true if there is at least one more record that can be read from the iterator. |
java.lang.Object |
nextRow()
Returns the next result row that is, depending on the query, may be a scalar value, a DataRow, or an Object[] array containing a mix of scalars and DataRows. |
void |
skipRow()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ResultIterator wrappedIterator
protected java.util.Set<java.util.Map<java.lang.String,java.lang.Object>> fetchedIds
protected java.lang.Object nextDataRow
protected DbEntity defaultEntity
protected boolean compareFullRows
Constructor Detail |
---|
public DistinctResultIterator(ResultIterator wrappedIterator, DbEntity defaultEntity, boolean compareFullRows) throws CayenneException
wrappedIterator
- defaultEntity
- an entity needed to build ObjectIds for distinct comparison.
CayenneException
Method Detail |
---|
public void close() throws CayenneException
close
in interface ResultIterator
CayenneException
public java.util.List<?> allRows() throws CayenneException
ResultIterator
allRows
in interface ResultIterator
CayenneException
public boolean hasNextRow() throws CayenneException
ResultIterator
hasNextRow
in interface ResultIterator
CayenneException
public java.lang.Object nextRow() throws CayenneException
ResultIterator
nextRow
in interface ResultIterator
CayenneException
public void skipRow() throws CayenneException
skipRow
in interface ResultIterator
CayenneException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |