Wednesday, September 7, 2011

ADF Calling a Find on your service based AM

So I struggled a bit to do this code because I was unfamiliar with eclipselink SDO stuff so hope this saves you some time.

I just wanted to call the AM service find from my backing bean.
The first parameter of the defineSchema method is the fully qualified path to your Application Module xsd.
The second parameter is your xsd name.

import oracle.jbo.common.sdo.SDOHelper; import oracle.jbo.common.service.types.FindControl; import oracle.jbo.common.service.types.FindCriteria; ...
  SDOHelper.INSTANCE.defineSchema(     "za/co/transcode/adf/mdm/model/common/serviceinterface/",      "MDMAppModuleService.xsd");   FindControl fci =     (FindControl)DataFactory.INSTANCE.create(FindControl.class);   fci.setRetrieveAllTranslations(false);   FindCriteria fcrit =     (FindCriteria)DataFactory.INSTANCE.create(FindCriteria.class);  
  Map paramMap = new HashMap();   fcrit.setFetchSize(1);   fcrit.setFetchStart(0);   paramMap.put("findCriteria", fcrit);   paramMap.put("findControl", fci);
  //normal execute operation just move it into a util class   ADFUtils.executeOperationBindingWithoutException(
    "findYourVO", paramMap);

The next thing I need to do is get this to work as I expect and to populate the Find Criteria from a query component - I will post this once I am done.

No comments:

Post a Comment