0
我試圖用Spring JPA中查詢Postgres DB後得到的resultset對象來映射視圖。 但我不知道該怎麼做,任何幫助將不勝感激用數據庫結果對象映射一個視圖
@Query(nativeQuery = true, value = "select e.job_number, p.tag_number, e.drawing_number, p.part_number, "
+ "eoa.operation_order, peoa.name, peoa.status, peoa.comment, peoa.last_updated_by, "
+ "peoa.last_updated_date, peoa.revtype "
+ "from brs.events e "
+ "join brs.parts p on e.id = p.event_id "
+ "join brs.event_operations_audit eoa on eoa.event_id = e.id "
+ "join brs.part_event_operations_audit peoa on peoa.part_id = p.id and peoa.event_operation_id = eoa.id "
+ "where e.id = :eventId "
+ "and e.is_received = true "
+ "and e.is_workscope_reviewed = true "
+ "order by p.tag_number, eoa.operation_order, peoa.last_updated_date ")
Set<Object> getJobPartRecentActivityData(@Param("eventId")Long eventId);