My Repository
public interface ProductRepository extends JpaRepository<Product,Integer> { @Query(value = "select mp.*,u.name,p.name, p.ext_id from merchant_product mp join campaign c on c.product_id = mp.id and c.status in (4, 8)join product p on p.id = mp.product_id join user u on u.id = mp.user_id where mp.status = 4 and mp.availability = 'Y';", nativeQuery = true) List<Object> getAllProduct(); } This is my Query in Spring Boot i am using Spring data JPA . I need to map this to a Pojo class . So that i can use it for further processing .
can anyone help me with this.
My pojo
@Data @AllArgsConstructor public class Product { @Id //data of merchant product table //data of user table private int id; private String name; private String ext_id; }