4
I have a @Query Spring, which performs a database query by an Entity, to create some Objects DTO. And the properties of this DTO object, I pass via Constructor, but I needed to pass as parameter in Constructor one List that has in the Entity.
public OperacaoDTO(List<Staging> stagings, BigDecimal valor) {
this.stagings = stagings;
this.valor = valor;
}
mine @Query
@Query("SELECT NEW br.com.teste.OperacaoDTO(operacao.stagings, operacao.valor) FROM Operacao operacao")
List<OperacaoDto> findAll();
The problem he complains about is that he doesn’t have a proper builder in Operacaodto. Is there any way that List of the Entity and pass in the Builder? because I will perform some treatment in this List
Could you provide the complete error? How is the entity mapping
Operacao
?– Dherik