There are 3 tables in my db:
SalesOrderMaster
SalesOrderDetail
CustomerMaster
I have repository class SalesOrderDetailRespository.java which has this method findAll()
@EntityGraph(attributePaths = {"SalesOrderMaster"}, type = EntityGraph.EntityGraphType.FETCH)
List<SalesOrderInfo> findAll(@Nullable Specification<SalesOrderInfo> spec);
This is till now fetching the SalesOrderMaster
record and associated SalesOrderDetails
records. Now my requirement is in SalesOrderInfo
class , I have added a new property for showing the Customer Information like Name , country which are there in CustomerMaster table.
The customerMaster table is related to SalesOrderMaster by customerId column. How do I add CustomerMaster table in the existing EntityGraph so that I can get this info?