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
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.
- Create Datacontrol from SessionBean local interface.
- Create jspx page in ViewController project.
- Drop employeesFindRootEmp from Data Controls Palette as ADF Tree.
- Add employeesList as Tree level rule.
- Run page to see the hierarchical tree with root node as 'King'
© Oracle Blogs or respective owner