Simplifies MappingSqlQueryWithParameters API by dropping parameters and context. Most subclasses won't care about parameters. If you don't use contextual information, subclass this instead of MappingSqlQueryWithParameters.
MappingSqlQueryWithParameters
| Access | Constructor and Description |
|---|---|
| public | |
| public | MappingSqlQuery(DataSource
the DataSource to use to obtain connections ds, String the SQL to run sql)Convenient constructor with DataSource and SQL string. |
| Modifier and Type | Method and Description |
|---|---|
| protected final T | mapRow(ResultSet
the ResultSet we're working through rs, int row number (from 0) we're up to rowNum, Object[] to the query (passed to the execute() method).
Subclasses are rarely interested in these.
It can be parameters, Map<?, ?> null if there are no parameters.passed to the execute() method.
It can be context)null if no contextual information is need.Implements abstract org. This method is implemented to invoke the simpler mapRow template method, ignoring parameters. |
| protected abstract T |
| MappingSqlQuery | back to summary |
|---|---|
| public MappingSqlQuery() Constructor that allows use as a JavaBean. | |
| MappingSqlQuery | back to summary |
|---|---|
| public MappingSqlQuery(DataSource ds, String sql) Convenient constructor with DataSource and SQL string.
| |
| mapRow | back to summary |
|---|---|
| protected final T mapRow(ResultSet rs, int rowNum, Object[] parameters, Map<?, ?> context) throws SQLException Implements abstract org. This method is implemented to invoke the simpler mapRow template method, ignoring parameters.
| |
| mapRow | back to summary |
|---|---|
| protected abstract T mapRow(ResultSet rs, int rowNum) throws SQLException Subclasses must implement this method to convert each row of the ResultSet into an object of the result type. Subclasses of this class, as opposed to direct subclasses of MappingSqlQueryWithParameters, don't need to concern themselves with the parameters to the execute method of the query object.
| |