Skip navigation links
Oracle Fusion Middleware Java API Reference for Oracle ADF Model Business Editor Objects
12c (12.2.1.2.0)

E76715-01

@Exported

Package oracle.adf.businesseditor.objects

Contains public APIs that are used to create, update, and delete business objects.

See: Description

Package oracle.adf.businesseditor.objects Description

Contains public APIs that are used to create, update, and delete business objects.

Once an object is read from the APIs, any change made to the object by another process is not read until commit or rollback is called.

Examples

Example 1

 
 BusinessEditorManager manager = new BusinessEditorManager();
 // Get the emp business object
 BusinessObject emp = manager.findBusinessObject(EMP_VIEW);
 emp.setDisplayLabel("Employee");
 emp.setDisplayNamePlural("Employees");
 emp.setDescription("Employee");
 // Get the ename attribute from emp business object
 Attribute ename = emp.findAttribute("Ename");
 ename.setRequired(true);
 ename.setDisplayLabel("Employee Name);
 // Create new custom attributes in emp business object
 CustomAttribute jobTitle = emp.createAttribute("JobTitle");
 CustomAttribute email = emp.createAttribute("Email");
 // Create custom business object
 BusinessObject trainingCourse = manager.createBusinessObject("TrainingCourse");
 CustomAttribute courseCode = trainingCourse.createAttribute("Code");
 CustomAttribute courseName = trainingCourse.createAttribute("Name");
 // commit
 manager.commit();
 
 

Example 2

Assuming code from Example1.java was executed, the following example illustrates how to modify custom business objects and attributes.

 
 BusinessEditorManager manager = new BusinessEditorManager();
 // Retrieve custom attribute from emp and modify
 BusinessObject emp = manager.findBusinessObject(EMP_VIEW);
 Attribute jobTitle = emp.findAttribute("JobTitle");
 jobTitle.setDisplayLabel("Job Title");
 Attribute email = emp.findAttribute("Email");
 email.setRequired(true);
 // Retrieve custom attribute from custom business objects and modify
 BusinessObject trainingCourse = manager.findBusinessObject("TrainingCourse");
 CustomAttribute courseCode = (CustomAttribute)trainingCourse.findAttribute("Code");
 courseCode.setRequired(true);
 courseCode.setMinLength(4);
 Attribute courseName = trainingCourse.findAttribute("Name");
 courseName.setRequired(true);
 // commit
 manager.commit();
 
 

Example 3

The following example illustrates how to retrieve existing lookup code.

 
 LookupManager lkManager = new LookupManager();
 LookupType autoLK = lkManager.findLookupType("AUTO_MAKE");
 Collection<LookupCode> codes = autoLK.getLookupCodes();
 for (LookupCode code : codes)
 {
 System.out.println("Code       : " + code.getCode());
 System.out.println("Meaning    : " + code.getMeaning());
 System.out.println("Description: " + code.getDescription());
 }

 

Example 4

The following example illustrates how to create lookup code.

 
 LookupManager lkManager = new LookupManager();
 LookupType countriesLK = lkManager.findLookupType("COUNTRY");
 countriesLK = lkManager.createLookupType("COUNTRY", "Country", null);
 Collection countries = countriesLK.getLookupCodes();
 LookupCode lk1 = countriesLK.addLookup("CA", "Canada", "HR");
 lk1.setEnabled(false);
 LookupCode lk2 = countriesLK.addLookup("USA", "United States of America", "HQ");
 lk2.setDisplaySequence(1.0);
 LookupCode lk3 = countriesLK.addLookup("MEX", "Mexico", null);
 // commit
 lkManager.commit();

 

Example 5

The following example illustrates how to create cascading picklist.

 
 BusinessEditorManager manager = new BusinessEditorManager();
 BusinessObject bo = manager.findBusinessObject(EMP_VIEW);
 // create parent picklist
 CustomAttribute parentPL = bo.createAttribute("ParentPL", FieldTypes.FIXED_CHOICE_LIST);
 parentPL.setFixedChoiceListLookupType("AUTO_MAKE");
 // Create value mapping for cascading picklist
 List childCodesForVW = new ArrayList();
 childCodesForVW.add("GLF");
 childCodesForVW.add("BTL");
 List childCodesForAudi = new ArrayList();
 childCodesForAudi.add("A4");
 childCodesForAudi.add("A5");
 List childCodesForToyota = new ArrayList();
 childCodesForToyota.add("RAV");
 childCodesForToyota.add("CMY");
 Map<String, List> valueMap = new HashMap<String, List>();
 valueMap.put("VW", childCodesForVW);
 valueMap.put("AU", childCodesForAudi);
 valueMap.put("TY", childCodesForToyota);
 // create child picklist
 CustomAttribute childPL = bo.createAttribute("ChildPL", FieldTypes.FIXED_CHOICE_LIST);
 childPL.setFixedChoiceListLookupType("AUTO_MODEL");
 childPL.setParentChoiceList(parentPL, valueMap);
 // commit
 manager.commit();

 

Example 6

The following example illustrates how to create dynamic choice list.

 
 BusinessEditorManager manager = new BusinessEditorManager();
 BusinessObject bo = manager.findBusinessObject(EMP_VIEW);
 Attribute empno = emp.findAttribute("Empno");
 Attribute ename = emp.findAttribute("Ename");
 Attribute comm = emp.findAttribute("Comm");
 Attribute sal = emp.findAttribute("Sal");

 BusinessObject bo = manager.createBusinessObject("EmpComp");
 CustomAttribute attr = bo.createAttribute("EmpAttr", FieldTypes.DYNAMIC_CHOICE_LIST);
 attr.setListDisplayAttribute(empno);
 attr.addDisplayAttribute(ename);
 attr.addDisplayAttribute(comm);
 attr.addDisplayAttribute(sal);
 attr.addSearchAttribute(comm);
 attr.addSearchAttribute(sal);
 // commit
 manager.commit();

 
Skip navigation links
Oracle Fusion Middleware Java API Reference for Oracle ADF Model Business Editor Objects
12c (12.2.1.2.0)

E76715-01

Copyright © 1997, 2016, Oracle. All rights reserved.