Under classic Cúram, you would have created a call to the generated "entity" method as follows:
// ...
public SomeChildSummaryDetailsList listSomeChildDetails(
final SomeParentKey key)
throws AppException, InformationalException {
// create an instance of the return struct
final SomeChildSummaryDetailsList list =
new SomeChildSummaryDetailsList();
// objects for reading the database
final SomeChild someChildObj = SomeChildFactory.newInstance();
final SomeChildDtlsList someChildDtlsList;
// set up the key
final SomeParentKey someParentKey = new SomeParentKey();
someParentKey.someParentID = key.someParentID;
// do the read
someChildDtlsList =
someChildObj.searchBySomeParent(someParentKey);
// map the details returned
for (int i = 0; i < someChildDtlsList.dtls.size(); i++) {
final SomeChildSummaryDetails someChildSummaryDetails =
new SomeChildSummaryDetails();
someChildSummaryDetails.assign(
someChildDtlsList.dtls.item(i));
list.details.addRef(someChildSummaryDetails);
}
// return to the client
return list;
}
// ...
How do you list child rows for a given parent using a service-layer API (developed using the Persistence Infrastructure)?