| Method from org.springframework.jdbc.object.SqlQuery Detail: |
public List execute() throws DataAccessException {
return execute((Object[]) null);
}
Convenient method to execute without parameters nor context. |
public List execute(Object[] params) throws DataAccessException {
return execute(params, null);
}
Convenient method to execute without context. |
public List execute(Map context) throws DataAccessException {
return execute((Object[]) null, context);
}
Convenient method to execute without parameters. |
public List execute(int p1) throws DataAccessException {
return execute(p1, null);
}
Convenient method to execute with a single int parameter. |
public List execute(long p1) throws DataAccessException {
return execute(p1, null);
}
Convenient method to execute with a single long parameter. |
public List execute(String p1) throws DataAccessException {
return execute(p1, null);
}
Convenient method to execute with a single String parameter. |
public List execute(Object[] params,
Map context) throws DataAccessException {
validateParameters(params);
RowMapper rowMapper = newRowMapper(params, context);
return getJdbcTemplate().query(newPreparedStatementCreator(params), rowMapper);
}
Central execution method. All un-named parameter execution goes through this method. |
public List execute(int p1,
Map context) throws DataAccessException {
return execute(new Object[] {new Integer(p1)}, context);
}
Convenient method to execute with a single int parameter and context. |
public List execute(int p1,
int p2) throws DataAccessException {
return execute(p1, p2, null);
}
Convenient method to execute with two int parameters. |
public List execute(long p1,
Map context) throws DataAccessException {
return execute(new Object[] {new Long(p1)}, context);
}
Convenient method to execute with a single long parameter and context. |
public List execute(String p1,
Map context) throws DataAccessException {
return execute(new Object[] {p1}, context);
}
Convenient method to execute with a single String parameter and context. |
public List execute(int p1,
int p2,
Map context) throws DataAccessException {
return execute(new Object[] {new Integer(p1), new Integer(p2)}, context);
}
Convenient method to execute with two int parameters and context. |
public List executeByNamedParam(Map paramMap) throws DataAccessException {
return executeByNamedParam(paramMap, null);
}
Convenient method to execute without context. |
public List executeByNamedParam(Map paramMap,
Map context) throws DataAccessException {
validateNamedParameters(paramMap);
ParsedSql parsedSql = getParsedSql();
MapSqlParameterSource paramSource = new MapSqlParameterSource(paramMap);
String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, getDeclaredParameters());
RowMapper rowMapper = newRowMapper(params, context);
return getJdbcTemplate().query(newPreparedStatementCreator(sqlToUse, params), rowMapper);
}
Central execution method. All named parameter execution goes through this method. |
public Object findObject(Object[] params) throws DataAccessException {
return findObject(params, null);
}
Convenient method to find a single object without context. |
public Object findObject(int p1) throws DataAccessException {
return findObject(p1, null);
}
Convenient method to find a single object given a single int parameter. |
public Object findObject(long p1) throws DataAccessException {
return findObject(p1, null);
}
Convenient method to find a single object given a single long parameter. |
public Object findObject(String p1) throws DataAccessException {
return findObject(p1, null);
}
Convenient method to find a single object given a single String parameter. |
public Object findObject(Object[] params,
Map context) throws DataAccessException {
List results = execute(params, context);
return DataAccessUtils.singleResult(results);
}
Generic object finder method, used by all other findObject methods.
Object finder methods are like EJB entity bean finders, in that it is
considered an error if they return more than one result. |
public Object findObject(int p1,
Map context) throws DataAccessException {
return findObject(new Object[] {new Integer(p1)}, context);
}
Convenient method to find a single object given a single int parameter
and a context. |
public Object findObject(int p1,
int p2) throws DataAccessException {
return findObject(p1, p2, null);
}
Convenient method to find a single object given two int parameters. |
public Object findObject(long p1,
Map context) throws DataAccessException {
return findObject(new Object[] {new Long(p1)}, context);
}
Convenient method to find a single object given a single long parameter
and a context. |
public Object findObject(String p1,
Map context) throws DataAccessException {
return findObject(new Object[] {p1}, context);
}
Convenient method to find a single object given a single String parameter
and a context. |
public Object findObject(int p1,
int p2,
Map context) throws DataAccessException {
return findObject(new Object[] {new Integer(p1), new Integer(p2)}, context);
}
Convenient method to find a single object given two int parameters
and a context. |
public Object findObjectByNamedParam(Map paramMap) throws DataAccessException {
return findObjectByNamedParam(paramMap, null);
}
Convenient method to execute without context. |
public Object findObjectByNamedParam(Map paramMap,
Map context) throws DataAccessException {
List results = executeByNamedParam(paramMap, context);
return DataAccessUtils.singleResult(results);
}
Generic object finder method for named parameters. |
public int getRowsExpected() {
return this.rowsExpected;
}
Get the number of rows expected. |
abstract protected RowMapper newRowMapper(Object[] parameters,
Map context)
Subclasses must implement this method to extract an object per row, to be
returned by the execute method as an aggregated List . |
public void setRowsExpected(int rowsExpected) {
this.rowsExpected = rowsExpected;
}
Set the number of rows expected.
This can be used to ensure efficient storage of results. The
default behavior is not to expect any specific number of rows. |