use of org.springframework.jdbc.core.RowMapper in project cu-kfs by CU-CommunityApps.
the class LevelOrganizationDaoJdbc method getCLevelOrganizations.
/**
* This overridden method ...
*
* @see edu.cornell.kfs.module.purap.dataaccess.LevelOrganizationDao#getCLevelOrganizations()
*/
public List<LevelOrganization> getCLevelOrganizations() {
try {
// Build the SQL
StringBuilder sqlBuilder = new StringBuilder(3500);
sqlBuilder.append("select fin_coa_cd, org_cd, org_nm from ca_org_t where fin_coa_cd in('IT') and ORG_ACTIVE_CD = 'Y' and org_cd <> 'XXXX' and org_typ_cd = 'C' order by fin_coa_cd desc, org_nm");
String sqlString = sqlBuilder.toString();
RowMapper<LevelOrganization> mapper = new RowMapper<LevelOrganization>() {
public LevelOrganization mapRow(ResultSet rs, int rowNum) throws SQLException {
LevelOrganization cLevelOrganization = new LevelOrganization();
cLevelOrganization.setCode(rs.getString("fin_coa_cd") + "-" + rs.getString("org_cd"));
cLevelOrganization.setName(rs.getString("org_nm"));
return cLevelOrganization;
}
};
return this.getJdbcTemplate().query(sqlString, mapper);
} catch (Exception ex) {
LOG.info("LevelOrganizationDaoJdbc Exception: " + ex.getMessage());
return null;
}
}
Aggregations