org.skife.jdbi.v2
Class BaseResultSetMapper<ResultType>

java.lang.Object
  extended by org.skife.jdbi.v2.BaseResultSetMapper<ResultType>
All Implemented Interfaces:
ResultSetMapper<ResultType>

public abstract class BaseResultSetMapper<ResultType>
extends Object
implements ResultSetMapper<ResultType>

Convenience class which allows definition of result set mappers which getAttribute the row as a map instead of a result set. This can be useful.


Constructor Summary
BaseResultSetMapper()
           
 
Method Summary
 ResultType map(int index, ResultSet r, StatementContext ctx)
          Defers to mapInternal
protected abstract  ResultType mapInternal(int index, Map<String,Object> row)
          Subclasses should implement this method in order to map the result
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseResultSetMapper

public BaseResultSetMapper()
Method Detail

map

public final ResultType map(int index,
                            ResultSet r,
                            StatementContext ctx)
Defers to mapInternal

Specified by:
map in interface ResultSetMapper<ResultType>
Parameters:
index - which row of the result set we are at, starts at 0
r - the result set being iterated
Returns:
the value to return for this row

mapInternal

protected abstract ResultType mapInternal(int index,
                                          Map<String,Object> row)
Subclasses should implement this method in order to map the result

Parameters:
index - The row, starting at 0
row - The result of a ResultSetMapper.map(int, java.sql.ResultSet, org.skife.jdbi.v2.StatementContext) call
Returns:
the value to pt into the results from a query


Copyright © 2011. All Rights Reserved.