Custom Query for fetching data from multiple tables in spring Data Jpa
Entities are following Product Table @Entity public class Product implements Serializable { /*@Id @GeneratedValue(strategy = GenerationType.AUTO) private Integer id;*/ @Id @GeneratedValue(strategy = GenerationType.AUTO) private Integer id; @NotNull(message = "Product name must not be null") @NotEmpty private String name; @ManyToOne @JoinColumn(name="category_id") private Category category; @ManyToMany(mappedBy = "productlist") private List<OrderDetail> orderDetail =new ArrayList<OrderDetail>(); //getters setter OrderDetail Table @Entity public class OrderDetail { @Id @GeneratedValue(strategy =