Is it possible to get the data from spring-data JPA in the form of CSV data instaed of ArrayList of pojos like
Below is the interface extending JpaRepository.
public interface FactAggRepository extends JpaRepository<FactAggRepository,Integer> {
@Query("select p from FactAggRepository as p where p.pId=:pId and p.periodStart=:periodStart")
public List<FactAggRepository> getAggregates(@Param("pId") Long pId,@Param("periodStart")LocalDateTime periodStart);
@Query("select p from UsageAgg as p where p.pId=:pId")
public List<UsageAgg> UsageAggregates(@Param("pId") Long pId);
}
Autowiring the repository to use the same methods as follows.
fetchedRecord = AggRepo.getAggregates(pId, periodStart);
Now the above the code returnd the List. Is it possible to get the CSV file with the data in the List without any conversion.please let me know. Thanks in advance.