}
public PianoDeiConti getPianoDeiContiDaPraticaNonChiusa(long numeroPratica)
throws ImpossibileLeggerePianoDeiContiDaPraticaNonChiusaException {
String query = "SELECT LGTB002_GRUPPO_COGE, LGTB002_MASTRO_COGE, LGTB002_CONTO_COGE FROM PRATICA WHERE LGTB002_PRATICA = ? AND LGTB002_DT_CHIUSURA is null";
PianoDeiConti result = null;
Object[] bind = new Object[1];
bind[0] = Long.valueOf(numeroPratica);
try {
result = (PianoDeiConti) getJdbcTemplate().query(query, bind, new ResultSetExtractor() {
public Object extractData(ResultSet rs) throws SQLException, DataAccessException {
PianoDeiConti result = new PianoDeiConti();
if (rs.next()) {
result.setCodiceGruppo(rs.getLong(1));
result.setCodiceMastro(rs.getLong(2));
result.setCodiceConto(rs.getLong(3));
}
return result;
}
});
} catch (DataAccessException e) {