Package org.apache.torque.om.mapper
Interface RecordMapper<T>
-
- Type Parameters:
T
- the class to map from and to a database record
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
BigDecimalMapper
,CompositeMapper
,DateMapper
,IntegerMapper
,LongMapper
,ObjectListMapper
,StringMapper
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface RecordMapper<T> extends Serializable
Maps an object to a database record and back. This means that the object can be read from a database resultSet and that it can produce PreparedStatements which insert or update the record in the the database.- Version:
- $Id: RecordMapper.java 1839288 2018-08-27 09:48:33Z tv $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
processRow(ResultSet resultSet, int rowOffset, Criteria criteria)
Constructs the object from the current row in the resultSet.
-
-
-
Method Detail
-
processRow
T processRow(ResultSet resultSet, int rowOffset, Criteria criteria) throws TorqueException
Constructs the object from the current row in the resultSet. Implementing methods can be sure that the resultSet contains a row, but they must only operate on the current row, i.e they must not call resultSet.next().- Parameters:
resultSet
- the resultSet to operate on, already pointing to the correct row. Not null.rowOffset
- a possible offset in the columns to be considered (if previous columns contain other objects), or 0 for no offset.criteria
- the Criteria which contains the query to process, or null if not known or the query was not produced by a Criteria. Can be used by the RecordMapper to determine the columns contained in the result set.- Returns:
- the mapped object, not null.
- Throws:
TorqueException
- when the mapping fails.
-
-