javaspring-bootspring-data-jpaquerydslblaze-persistence

Passing param to subquery Blaze persistence


How can I pass BranchId into SumQuantity? Here my view: enter image description here

This is subQueryProvider: enter image description here

This is my query: enter image description here How can I pass the branchId to SumQuantity?


Solution

  • You can inject optional parameters into your SubqueryProvider i.e.

    public class SumQuantity extends SubqueryProvider {
      public SumQuantity(@MappingParameter("branchId") Long branchId) {}
      //..
    }
    

    You can then supply that to the EntityViewSetting via EntityViewSetting.create(MedicalSuppliesView.class).withOptionalParameter("branchId", 123L)