Good afternoon,
I am doing a jpql query to bring a VO (Value Object) with some information, one of which is a List
. This list is in the opCambio object, however, it is returning this error:
Log:
[ERROR] - 01/04/2017 19:16:26 - RuntimeException on EJB call
java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: Unable to locate appropriate constructor on class [br.com.domain.relatorios.iof.vo.RelatorioIOFOrdemDePagamentoOperacaoCambioVO] [SELECT NEW br.com.domain.relatorios.iof.vo.RelatorioIOFOrdemDePagamentoOperacaoCambioVO(lp, opCambio.id, opCambio.dataRegistro) FROM br.com.domain.ordempagamento.OrdemDePagamentoOperacaoCambio opCambio JOIN FETCH opCambio.liquidacoesParciais WHERE opCambio.tipoOperacaoCambioOrdemPagamento = :pTipoOperacao AND opCambio.empresa = :pEmpresa AND opCambio.situacao in (:pSituacoes) AND doc.principal = :pPrincipal AND opCambio.tipoOperacaoCambioOrdemPagamento = :pTipo AND opCambio.tipoAquisicao = :pTipoAquisicaoOrdemDePagamento AND opCambio.dataPrevistaMoedaNacionalBoleto >= :pDataInicial AND opCambio.dataPrevistaMoedaNacionalBoleto < :pDataFinal AND taxa.iof != :pTaxa]
Inquiry:
StringBuffer jpqlClausulaFrom = new StringBuffer("SELECT NEW " + RelatorioIOFOrdemDePagamentoOperacaoCambioVO.class.getName());
jpqlClausulaFrom.append("(opCambio.liquidacoesParciais, opCambio.id, opCambio.dataRegistro)");
jpqlClausulaFrom.append(" FROM OrdemDePagamentoOperacaoCambio opCambio ");
Builder:
public RelatorioIOFOrdemDePagamentoOperacaoCambioVO(List<LiquidacaoParcialOrdemDePagamento> listaLiquidacoes, Long id, Date dataRegistroOperacao) {
Could anyone help me?