1
Good afternoon,
I’m doing a jpql query to bring up a VO(Value Object) with some information, one of them being a List
. This list is in the object opCambio, however, is returning me 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]
Consultation:
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 someone help me?
Put more codes so we can understand the problem, such as an excerpt from which instance this class.
– Henrique Luiz
Good morning, then, I’m trying to pass to a VO (Value Object) information coming from a query, one of this information is a list. The builder I passed up there, he’s in my VO class. In my query, I give a new one in my class and pass the fields I want to bring from the query to create the VO, in case, for the List, this returning me this error "Unable to locate appropriate constructor on class". The most relevant codes, are the ones I posted in doubt. I appreciate the help.
– Thiago Brito