I have an object that is persisted with jparepository
, I use pagination but it returns all fields which is not necessary for the application. So is there any way to set a @Query
to just get some data?
@Query(value = "SELECT p.id FROM produto p",
countQuery = "SELECT p.id FROM produto p",
nativeQuery = true)
@Override
Page<Produto> findAll(Pageable pageable);
The above example is not working. I just wanted to get the ID
and other fields but it is not allowing this to work.