Display root node of Hierarchical Tree using ADF - EJB DC

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




Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Tips and Tricks from Oracle's JDeveloper & ADF QA

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today