Monday, 30 April 2018

Step 2: Build the Business Services

connect to a database and build simple backend business components that access HR schema tables.
  1. In the CheckList Overview, click the Connect to a Database step.
    This screenshot shows the application overview page with a checklist on the right and the step-by-step instructions to build a Fusion Web Application, on the left.
  2. The step expands showing useful information such as prerequisites required for performing the task and detailed instructions on how to perform the task. Click the Create a Database Connection button.
    This screenshot shows an expanded Connect to a Database step. The expanded step details the prerequisites, step-by-step instructions on how to perform a task. It also displays the outcome of the performed task and link to the guide.
  3. Specify the properties for connecting to your HR schema.
    Enter the appropriate Oracle JDBC Settings to point to the right host, port and SID for your database. Click the Test Connection button to verify that you can connect successfully.
    Click OK to continue.
    This screenshot shows the properties page with credentials specified as mentioned in the previous paragrah to connect to the Oracle database. It also has the option to check if the connection is successful.
  4. Click the down arrow to shrink the Connect to a Database step.
    Then, in the Checklist, set the status of the Connect to a Database step to Done.
    This screenshot shows the statuses of the Connect to a Database task with Done as selected.
  5. Click the Build Business Services step to expand it, then click the Go to Substeps button.
    This screenshot shows an expanded step of the Build Business Services task that you need to perform. It also shows if this task involves multiple substeps.
  6. In the list of substeps, click the Create Entity Objects and Associations sub step.
    This screenshot shows the substeps that are involved in creating Business Services with Create Entity Objects and Associations step highlighted.
  7. In the Select Project for Action dialog, select the Model project and click OK.
    This screenshot shows the Model project selected for which you want to create entity objects. The Project drop-down lists all the projects that you have created for an application.
  8. The Create Business Components from Tables wizard launches. In the Entity Objects page, click the Query button to examine the data dictionary and see available tables.
    This screenshot shows the Create Business Components from Tables wizard where you can query a database schema to list the available tables.
  9. Select the EMPLOYEESJOBS and DEPARTMENTS tables in the Available list, and click the right arrow to move your selections to the Selected list. This step creates updatable entity objects based on the tables selected.
    Then, click Next.
    This screenshot shows the tables as specified in the previous paragraph selected, from the list of available tables.
  10. In the Entity-based View Objects page of the wizard, move DepartmentsView (Departments)JobsView (Jobs) and EmployeesView (Employees) to the Selected list. This step creates matching view objects DepartmentsView, JobsView and EmployeesView for performing queries on the entity objects you just created.
    Then, click Next and then Next again.
    This screenshot shows the view objects as specified in the previous paragraph selected.
  11. In the Application Module page, click Finish to create the business components in the Model project.
    This screenshot shows the default name of the Application Module and Add to Application Module checkbox selected by default.
  12. In the Checklist, set the status of the Create Entity Objects and Associations step to Done.
    This screenshot shows the Create Entity Objects and Associations statuses with Done as selected.
  13. Click the Close Step 3 button..
    this screenshot shows the substeps of the Build Business Services and Close Step 3 button highlighted to collapse the substeps.
  14. Set the status of the Build Business Services step to Done
    Save all your work
    This screenshot shows the statuses of the Build Business Services task with Done as selected.
  15. In the Applications window right-click AppModule and select Run to invoke the application module tester. This starts a small Swing-based application that allows you to test the ADF Business Components you have just created.
    This screenshot shows the right-click menu of the Application Module with Run option selected.
  16. In the Oracle ADF Model Tester window, double-click the EmpDeptFkLink1 node to show the department and employees data. Navigate between the records using the Next button and notice the automatic master-detail synchronization.
    This screenshot shows the ADF Model Tester for the application module you ran. On the left, the screen displays different views of the application module and their links and the right pane shows the data for the selected link. You can navigate through the records by using the buttons.
    This screenshot shows the master-detail synched records during navigation.
  17. Click the Specify View Criteria (binocular icon) button in the master toolbar, to enter search criteria for your data.
    This screenshot highlights the Specify View Criteria icon that opens a View Criteria dialog.
    Specify 1700 in the LocationId field and click the Find button to execute the query.
    This screenshot shows the criterion as specified in the previous paragraph, entered. You can specify your criteria to find or remove the records from a table. You can also select from the predefined criteria.
  18. The form now only shows departments in this location. Use the Next button to scroll through the departments at Location 1700, including Purchasing.
    This screenshot shows the master-detail synched records based on the specified criteria.
    You need to remove the parameter value of the search criteria to access all departments again.
  19. Close the Oracle ADF Model Tester window, and back in JDeveloper, click the Save All icon on JDeveloper main toolbar. icon on the JDeveloper menu bar, or select File > Save All from the menu.