Display root node of Hierarchical Tree using ADF - EJB DC

Posted by arul.wilson(at)oracle.com on Oracle Blogs See other posts from Oracle Blogs or by arul.wilson(at)oracle.com
Published on Tue, 08 Feb 2011 13:07:04 +0530 Indexed on 2011/02/08 23:31 UTC
Read the original article Hit count: 423

Filed under:
|

Displaying Employee (HR schema) records in Hierarchical Tree can be achieved in ADF-BC by creating custom VO and a Viewlink for displaying root node. This can be more easily done using  EJB-DC by just introducing a NamedQuery to get the root node.

Here you go to get this scenario working.

  • Create DB connection based on HR schema.
  • Create Entity Bean from Employees Table.
  • Add custom NamedQuery to Employees.java bean, this named query is responsible for fetching the root node (King in this example).
@NamedQueries({
  @NamedQuery(name = "Employees.findAll", query = "select o from Employees o"),
  @NamedQuery(name = "Employees.findRootEmp", query = "select p from Employees p where p.employees is null")
})

  • Create Stateless Session Bean and expose the Named Queries through the Session Facade.

EJBDC-HierarchicalTree_SessionFacade.JPG



  • Create Datacontrol from SessionBean local interface.

EJBDC-HierarchicalTree_Datacontrol_Contextmenu.JPG


EJBDC-HierarchicalTree_Datacontrol_LocalInterface.JPG


  • Create jspx page in ViewController project.
  • Drop employeesFindRootEmp from Data Controls Palette as ADF Tree.

EJBDC-HierarchicalTree_Datacontrol_ADFTree.JPG


  • Add employeesList as Tree level rule.

EJBDC-HierarchicalTree_EditTreeBinding.JPG


  • Run page to see the hierarchical tree with root node as 'King'

EJBDC-HierarchicalTree_Runtime.JPG




© Oracle Blogs or respective owner

Related posts about adf

Related posts about ejb