| java.lang.Object simpleorm.properties.SPropertyMap simpleorm.core.SResultSet
SResultSet | public class SResultSet extends SPropertyMap (Code) | | This class is analagous to a JDBC result set. It is returned by
sPreparedStatement.execute() and is then used to access
individual rows.
See Also: SPreparedStatement |
finished | boolean finished(Code) | | |
nrRetrieved | long nrRetrieved(Code) | | |
close | public void close()(Code) | | Close the underlying JDBC result set, if required. SimpleORM
normally closes the cursor automatically by
SResultSet.hasNext ,
provided that you retrieve all the records (the common case).
Some JDBC dirvers (eg. Oracle) have bugs that require cusrors to
always be closed. Closing a cursor twice is OK. From 1.05
closing the cursor also closes the prepared statement.
|
getArrayList | public SArrayList getArrayList(int maxRows)(Code) | | Retrieves all rows as an SArrayList. An exception is thrown if
more than maxRows are retrieved to trap unbounded queries, and is
mandatory. Provide a generous value, eg. if you expect about 10
rows, specify 1000.
Note that there is no point in creating the SArrayList object if
you just want to iterate over the rows. An explicit loop can
also give you more control over how a collection is created.
|
getJDBCResultSet | public ResultSet getJDBCResultSet()(Code) | | Retrieves the underlying JDBC result set. Dangerous. But
allows arbitrary JDBC calls to be made if really necessary.
|
getNrRetrieved | public long getNrRetrieved()(Code) | | Returns the number of records retrieved so far.
This excludes any rows required to implement Offset.
|
getOnlyRecord | public SRecordInstance getOnlyRecord()(Code) | | Convenience routine for retrieving at most one row. Throws an
exception if there are multiple rows. Returns null if no rows
(not a dummy SRecrodInstance -- we may not have a key).
|
getRecord | public SRecordInstance getRecord()(Code) | | Retrieves the next record from the result set.
hasNext() must have been called and returned
true.
|
hasNext | public boolean hasNext(int maxRows)(Code) | | See if there is another record to retrieve. The loop is the
same as JDBC, ie. while (rs.hasNext()) {rec = getRecord();}
If more than maxRows are retrieved an exception is
thrown. Use this to prevent run away queries.
Note that this is different from SPreparedStatement.Offset and
Limit, which may change the generated SQL to only retrieve this
number of rows.
Automatically closes the cursor when the last record is retrieved.
|
hasNext | public boolean hasNext()(Code) | | |
|
|