I'm using spring boot with JpaRepository to query some specific attributes into a DTO object and pass it to some REST API:
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
public interface BloqueioSaldoRepository extends JpaRepository<entity1, Long> {
@Query("select b.idBloqueioSaldo, mb.descricao, b.dataBloqueio, b.valor "
+ "from entity1 b, entity2 mb, entity3 co "
+ "where b.motBloqueioSaldo = mb.id "
+ "and co.idCc = b.cc "
+ "and co.agencia = :agencia "
+ "and co.numConta = :conta")
public List<myDTO> findByAgenciaAndConta(@Param("agencia") Long agencia, @Param("conta") Long conta);
}
But when I'm debugging I saw this:
And Postman shows me this:
How can I make spring turn this list of lists into a list of myDTO objects? What I'm missing?