|
SolarMetric Kodo JDO 2.5.8 generated on January 11 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
List interface that represents a potentially lazy ResultList
instantiation. In accordance with section 14.6.7 of the JDO
specification, iterators obtained from a Query or Extent that have
been subsequently closed will return false for
hasNext()
A ResultList will typically be instantiated from a factory, and will use a ResultObjectProvider for obtaining individual object data representations. For exmaple:
java.sql.ResultSet rs = myStatement.executeQuery ("SELECT NAME FROM FOO");
ResultList names = ResultListFactory.createResultList (threshold, rs,
new ResultObjectProvider ()
{
public Object getResultObject (Object currentRow)
throws Exception
{
return ((ResultSet) currentRow).getString ("NAME");
}
public boolean open (Object input)
{
return ((ResultSet) input).next ();
}
public boolean advance (Object input)
{
return ((ResultSet) input).next ();
}
public void free (Object input) { }
});
Depending on the data store support for scrolling result sets, the list that is returned may use lazy instantiation of the objects, and thus allow very large result sets to be obtained and manipulated.
Note that wrapping a ResultList in another Collection will always instantiate the entire set of elements contained in the ResultList. This may not always be desireable, since the list may be very large.
| Method Summary | |
void |
checkClosed()
Check to see if this ResultList has been closed, and if so, throw a JDOUserException. |
void |
close()
Close the list. |
int |
getInstantiatedCount()
Returns the number of objects that are currently instantiated internally in this list. |
boolean |
isClosed()
Returns true if the list has been closed. |
| Methods inherited from interface java.util.List |
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray |
| Method Detail |
public void close()
throws JDOException
public boolean isClosed()
throws JDOException
public void checkClosed()
throws JDOException
public int getInstantiatedCount()
|
SolarMetric Kodo JDO 2.5.8 generated on January 11 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||