employeeRep = new EmployeeRepositoryRDB(mp);
}
private FoodComplaint accessFood(Long code) throws RepositoryException, ObjectNotFoundException {
FoodComplaint complaint;
String sql = null;
try {
complaint = new FoodComplaint();
// fazer join para acessar as duas tabelas
sql = "select * from scbs_queixa q,scbs_queixaalimentar qa where q.codigo=qa.codigo and q."
+ "codigo = '" + code + "';";
Statement stmt = (Statement) this.mp.getCommunicationChannel();
resultSet = stmt.executeQuery(sql);
if (resultSet.next()) {
try {
accessComplaint(resultSet, complaint);
} catch (ObjectNotFoundException e) {
e.printStackTrace();
}
complaint.setQtdeComensais(resultSet.getShort("qtdeComensais"));
complaint.setQtdeDoentes(resultSet.getShort("qtdeDoentes"));
complaint.setQtdeInternacoes(resultSet.getShort("qtdeInternacoes"));
complaint.setQtdeObitos(resultSet.getShort("qtdeObitos"));
complaint.setLocalAtendimento(resultSet.getString("localAtendimento"));
complaint.setRefeicaoSuspeita(resultSet.getString("refeicaoSuspeita"));
String endDoente = resultSet.getString("enderecodoente");
// System.out.println("endere�o doente = "+endDoente);
Address endDo = addressRep.search((new Long(endDoente)).longValue());
complaint.setEnderecoDoente(endDo);
} else {
throw new ObjectNotFoundException(ExceptionMessages.EXC_FALHA_PROCURA);
}
resultSet.close();
stmt.close();