- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
public String getServiceClient(final Service service) {
SqlDao dao = (SqlDao) getBean("sqlDao");
return (String) dao.getTemplate().query(SQL_GET_CLIENT, new Long[]{service.getClient().getId()}, new ResultSetExtractor() {
public Object extractData(ResultSet rs) throws SQLException, DataAccessException {
String result;
SqlDao dao = (SqlDao) getBean("sqlDao");
rs.next();
if (rs.getInt("IS_ORG") == 1) {
result = (String) dao.getTemplate().query(SQL_GET_LEGAL_INFO, new Long[]{service.getClient().getId()}, new ResultSetExtractor() {
public Object extractData(ResultSet rsi) throws SQLException, DataAccessException {
if (rsi.next()) {
return rsi.getString("C_INN") + ", " + rsi.getString("C_NAME");
} else {
log.debug("====== No legal client found for service: " + service.getRegistrationNumber() + " (" + service.getId() + ")");
return null;
}
}
});
} else {
result = (String) dao.getTemplate().query(SQL_GET_PERSONINFO, new Long[]{service.getClient().getId()}, new ResultSetExtractor() {
public Object extractData(ResultSet rsi) throws SQLException, DataAccessException {
if (rsi.next()) {
return rsi.getString("LASTNAME") + " " + rsi.getString("FIRSTNAME") + " " + rsi.getString("MIDDLENAME");
} else {
log.debug("====== No phisical client found for service: " + service.getRegistrationNumber() + " (" + service.getId() + ")");
return null;
}
}
});
}
return result;
}
});
}
Я конечно все понимаю, deadline, все эти вещи... Но return на 20 с чем-то строк это сильно.
guest 19.01.2010 08:25 # 0
Видел такое и писал сам.
nagakhl 19.01.2010 23:52 # 0