Pessoal, estou com um problema muito estranho. Tenho um metodo que faz uma busca no banco e me retorna os objetos, quando testo ele isolado o miseravel funciona normal, quando testo a partir da requisição web não funciona, porem se eu alterar o objeto, a partir daí o metodo funciona normal, não tenho a menor idea, até mudei a forma de fazer a consulta usando sql normal para saber e continua na mesma. Coloquei o log em modo de debug e não verifiquei nenhuma exception. Vou colar o codigo para ver se alguem pode ajudar
Collection<PaymentFormProduct> lista = new ArrayList<PaymentFormProduct>();
AbstractDAOFactory abstractDAOFactory = GlobalFactory.createDAOFactory();
FormaPagamentoDAO formaPagamentoDAO = abstractDAOFactory.getFormaPagamentoDAO();
ProductDAO productDAO = abstractDAOFactory.getProductDAO();
List<PaymentForm> formasPagamento = formaPagamentoDAO.listar();
Query query = null;
StringBuffer hql = new StringBuffer();
Connection connection = getSession().connection();
PreparedStatement preparedStatement=null;
ResultSet resultSet = null;
if (product != null) {
for (PaymentForm paymentForm : formasPagamento) {
//hql.append("from PaymentFormProduct pfp where pfp.product.identificador="+product.getIdentificador()+" and pfp.paymentForm.identificador="+paymentForm.getIdentificador());
hql.append("select * from forma_pagamento_produto where cod_product="+product.getIdentificador()+" and cod_forma_pagamento="+paymentForm.getIdentificador());
try{
preparedStatement = connection.prepareStatement(hql.toString());
resultSet = preparedStatement.executeQuery();
System.out.println(hql.toString());
if(resultSet.next()){
PaymentFormProduct paymentFormProduct = new PaymentFormProduct(product,paymentForm,resultSet.getBigDecimal("parcela_minima"));
lista.add(paymentFormProduct);
}
else{
lista.add(new PaymentFormProduct(null,paymentForm,new BigDecimal(0)));
}
}
catch(SQLException exception){
throw ExceptionPitcher.generateException(exception);
}
finally{
try{
preparedStatement.close();
}
catch(SQLException exception2){
throw ExceptionPitcher.generateException(exception2);
}
}
//limpando o buffer
hql = new StringBuffer();
}
}
else{
for (PaymentForm paymentForm : formasPagamento) {
lista.add(new PaymentFormProduct(product,paymentForm,new BigDecimal(0)));
}
}
System.out.println(lista);
return lista;
Desde já agradeço
Alberto