| java.lang.Object org.springframework.jdbc.object.RdbmsOperation org.springframework.jdbc.object.SqlOperation org.springframework.jdbc.object.SqlQuery org.springframework.jdbc.object.UpdatableSqlQuery
UpdatableSqlQuery | abstract public class UpdatableSqlQuery extends SqlQuery (Code) | | Reusable RDBMS query in which concrete subclasses must implement
the abstract updateRow(ResultSet, int, context) method to update each
row of the JDBC ResultSet and optionally map contents into an object.
Subclasses can be constructed providing SQL, parameter types
and a DataSource. SQL will often vary between subclasses.
author: Thomas Risberg See Also: org.springframework.jdbc.object.SqlQuery |
Inner Class :protected class RowMapperImpl implements RowMapper | |
Method Summary | |
protected RowMapper | newRowMapper(Object[] parameters, Map context) Implementation of the superclass template method. | abstract protected Object | updateRow(ResultSet rs, int rowNum, Map context) Subclasses must implement this method to update each row of the
ResultSet and optionally create object of the result type.
Parameters: rs - ResultSet we're working through Parameters: rowNum - row number (from 0) we're up to Parameters: context - passed to the execute() method.It can be null if no contextual information is need. |
UpdatableSqlQuery | public UpdatableSqlQuery()(Code) | | Constructor to allow use as a JavaBean
|
UpdatableSqlQuery | public UpdatableSqlQuery(DataSource ds, String sql)(Code) | | Convenient constructor with DataSource and SQL string.
Parameters: ds - DataSource to use to get connections Parameters: sql - SQL to run |
newRowMapper | protected RowMapper newRowMapper(Object[] parameters, Map context)(Code) | | Implementation of the superclass template method. This invokes the subclass's
implementation of the updateRow() method.
|
updateRow | abstract protected Object updateRow(ResultSet rs, int rowNum, Map context) throws SQLException(Code) | | Subclasses must implement this method to update each row of the
ResultSet and optionally create object of the result type.
Parameters: rs - ResultSet we're working through Parameters: rowNum - row number (from 0) we're up to Parameters: context - passed to the execute() method.It can be null if no contextual information is need. If youneed to pass in data for each row, you can pass in a HashMap with the primary key of the row being the key for the HashMap. That wayit is easy to locate the updates for each row an object of the result type throws: SQLException - if there's an error updateing data.Subclasses can simply not catch SQLExceptions, relying on theframework to clean up. |
Methods inherited from org.springframework.jdbc.object.SqlQuery | public List execute(Object[] params, Map context) throws DataAccessException(Code)(Java Doc) public List execute(Object[] params) throws DataAccessException(Code)(Java Doc) public List execute(Map context) throws DataAccessException(Code)(Java Doc) public List execute() throws DataAccessException(Code)(Java Doc) public List execute(int p1, Map context) throws DataAccessException(Code)(Java Doc) public List execute(int p1) throws DataAccessException(Code)(Java Doc) public List execute(int p1, int p2, Map context) throws DataAccessException(Code)(Java Doc) public List execute(int p1, int p2) throws DataAccessException(Code)(Java Doc) public List execute(long p1, Map context) throws DataAccessException(Code)(Java Doc) public List execute(long p1) throws DataAccessException(Code)(Java Doc) public List execute(String p1, Map context) throws DataAccessException(Code)(Java Doc) public List execute(String p1) throws DataAccessException(Code)(Java Doc) public List executeByNamedParam(Map paramMap, Map context) throws DataAccessException(Code)(Java Doc) public List executeByNamedParam(Map paramMap) throws DataAccessException(Code)(Java Doc) public Object findObject(Object[] params, Map context) throws DataAccessException(Code)(Java Doc) public Object findObject(Object[] params) throws DataAccessException(Code)(Java Doc) public Object findObject(int p1, Map context) throws DataAccessException(Code)(Java Doc) public Object findObject(int p1) throws DataAccessException(Code)(Java Doc) public Object findObject(int p1, int p2, Map context) throws DataAccessException(Code)(Java Doc) public Object findObject(int p1, int p2) throws DataAccessException(Code)(Java Doc) public Object findObject(long p1, Map context) throws DataAccessException(Code)(Java Doc) public Object findObject(long p1) throws DataAccessException(Code)(Java Doc) public Object findObject(String p1, Map context) throws DataAccessException(Code)(Java Doc) public Object findObject(String p1) throws DataAccessException(Code)(Java Doc) public Object findObjectByNamedParam(Map paramMap, Map context) throws DataAccessException(Code)(Java Doc) public Object findObjectByNamedParam(Map paramMap) throws DataAccessException(Code)(Java Doc) public int getRowsExpected()(Code)(Java Doc) abstract protected RowMapper newRowMapper(Object[] parameters, Map context)(Code)(Java Doc) public void setRowsExpected(int rowsExpected)(Code)(Java Doc)
|
Fields inherited from org.springframework.jdbc.object.RdbmsOperation | final protected Log logger(Code)(Java Doc)
|
|
|