Hi Duc,
I have same problem while dealing with one to many relationship in service builder. Its solved for me.
I had the followed the below steps in LR-6.1
After you mentioned the mapping-key in service builder ,do ant-build-service,
It will a generate a method in persistence class of your entity related to your mapping-key.
Using the persistence method you can write the getters method in your implementation class and do ant build service before deploying it.
In your case:
you have to write a method to get the list of book associate with catalog id. Correct me if i wrong
Here is my example in localserviceimpl class for my scenario. it will list out the all employees associate to the department.
public class DepartmentLocalServiceImpl extends DepartmentLocalServiceBaseImpl {
public List<Employee> getDepartmentEmployees(long departmentId) throws SystemException, Exception {
List<Employee> employeeList = departmentPersistence.getEmployees(departmentId);
return employeeList;
}
}now then you can access the util class in your action file.
Example to get list of employees related to department.
List<Employee> employeeList = DepartmentLocalServiceUtil.getDepartmentEmployees(departmentId);Hope this step will give you some idea.
you can find my service builder in attachements
Regards,
Rizwan
Please sign in to flag this as inappropriate.