Hi, how can I get the results of a query and insert in a hash or list or any other list object
example:
Query q = Sistema.getSession().createQuery("select distinct new Guia(g.guia, b.nome) from Guia g, Beneficiario b, GuiaEvento e where g=e.guia and e.dataexecucao between :di and :df and b=g.beneficiario and b.empresa=:empresa");
q.setEntity("empresa", this);
q.setDate("di", dataInicial);
q.setDate("df", dataFinal);
return q.list();
My Guia object does not have a constructor with these two parameters. Instead of creating a constructor for every different select, I think to get this result in a generic class.
|