|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--velosurf.context.RowIterator
This class is a context wrapper for ResultSets, and provides an iteration mecanism for #foreach loops, as long as getters for values of the current row.
| Field Summary | |
protected java.util.List |
mColumnNames
Column names in sequential order |
protected Pooled |
mPooledStatement
the statement |
protected Entity |
mResultEntity
the resulting entity |
protected java.sql.ResultSet |
mResultSet
the result set |
protected static boolean |
sFillInstance
whether or not all instance fields are automatically filled TODO : should depend upon some init param |
| Constructor Summary | |
RowIterator(Pooled inPooledStatement,
java.sql.ResultSet inResultSet,
Entity inResultEntity)
Build a new RowIterator |
|
| Method Summary | |
protected boolean |
dataAvailable()
check if some data is available |
java.lang.Object |
get(int inCol)
returns the value of a column specified by its order (starting at 1, as for ResultSet.get()) |
java.lang.Object |
get(java.lang.Object inKey)
generic getter for values of the current row. |
int |
getInt(int inCol)
returns the value of a column specified by its order (starting at 1, as for ResultSet.get()) |
int |
getInt(java.lang.Object inKey)
returns the value of a column specified by its name |
java.lang.String |
getString(int inCol)
returns the value of a column specified by its order (starting at 1, as for ResultSet.get()) |
java.lang.String |
getString(java.lang.Object inKey)
returns the value of a column specified by its name |
boolean |
hasNext()
Returns true if the iteration has more elements. |
java.lang.Object |
next()
Returns the next element in the iteration. |
void |
remove()
not implemented. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected Pooled mPooledStatement
protected java.sql.ResultSet mResultSet
protected Entity mResultEntity
protected java.util.List mColumnNames
protected static boolean sFillInstance
| Constructor Detail |
public RowIterator(Pooled inPooledStatement,
java.sql.ResultSet inResultSet,
Entity inResultEntity)
inPooledStatement - the sql statementinResultSet - the resultsetinResultEntity - the resulting entity (may be null)| Method Detail |
public boolean hasNext()
hasNext in interface java.util.Iteratortrue if the iterator has more elements.public java.lang.Object next()
next in interface java.util.Iteratorpublic void remove()
remove in interface java.util.Iteratorpublic java.lang.Object get(java.lang.Object inKey)
get in interface DataAccessorinKey - the name of an existing column or attributepublic java.lang.Object get(int inCol)
inCol - the index of the wanted column (starting at 1)public int getInt(java.lang.Object inKey)
inKey - the name of the wanted columnpublic int getInt(int inCol)
inCol - the index of the wanted column (starting at 1)public java.lang.String getString(java.lang.Object inKey)
inKey - the name of the wanted columnpublic java.lang.String getString(int inCol)
inCol - the index of the wanted column (starting at 1)
protected boolean dataAvailable()
throws java.sql.SQLException
true if some data is available (ie the internal
ResultSet is not empty, and not before first row neither after last
one)java.sql.SQLException - if the internal ResultSet is not happy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||