|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.torque.om.mapper.ObjectListMapper
public class ObjectListMapper
Maps a record to a list of objects. Either the database driver decides which object type is appropriate for each column, or a list of classes can be defined.
Constructor Summary | |
---|---|
ObjectListMapper()
Constructor. |
|
ObjectListMapper(int numberOfColumnsToMap)
Constructor which sets the number of columns to map. |
|
ObjectListMapper(List<Class<?>> convertClasses)
Constructor which determines the number of columns to map and the classes the result columns are mapped to. |
Method Summary | |
---|---|
List<Object> |
processRow(ResultSet resultSet,
int offset)
Maps the current row in the result set by reading all columns from offset on to the end of the row and store an object for each column in the result. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectListMapper()
public ObjectListMapper(int numberOfColumnsToMap)
numberOfColumnsToMap
- how many columns should be mapped,
or -1 to determine the number of columns to map from the
result set's metadata (this may issue
additional database queries).public ObjectListMapper(List<Class<?>> convertClasses)
convertClasses
- the classes to which the columns should be mapped.
The first column is mapped to the first class in the list and
so on. May be null, in which case the number of columns to map
and the mapped to classes are determined by the database driver.
Known classes are: java.lang.reflect.Array, java.math.BigDecimal,
java.io.InputStream, java.sql. Blob, Boolean, Byte, byte[],
java.io.Reader, java.sql.Clob, java.sql.Date, Double, Float,
Integer, Long, Object (i.e. let the database driver decide
which class is returned), java.sql.Ref, Short, String,
java.sql.Time, java.sql.Timestamp and java.net.URL.Method Detail |
---|
public List<Object> processRow(ResultSet resultSet, int offset) throws TorqueException
processRow
in interface RecordMapper<List<Object>>
resultSet
- the result set to map, not null.offset
- the offset of this mapper within the result set.
TorqueException
- if retrieving column values from the result set
fails or if the number of available columns cannot be determined
from the result set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |