Create named criteria in EJB Data control

Posted by shantala.sankeshwar on Oracle Blogs See other posts from Oracle Blogs or by shantala.sankeshwar
Published on Mon, 27 Jun 2011 05:33:34 -0700 Indexed on 2011/06/27 16:28 UTC
Read the original article Hit count: 338

Filed under:

This article gives the detailed steps on creating named criteria in EJB Data control.Note that this feature is available in Jdev version 11.1.2.0.0

Use Case Description

Suppose we have defined an EJB Entity Object & we would like to filter the Entity object based on some criteria,then this filtering can be achieved by creating named criteria in EJB Data Control.

Implementation steps

Let us suppose that we have created Java EE Web Application with Entities from Emp table

EJB_Entities.JPG



Create session bean,generate data control for the same

sessionbean.jpeg







Edit empFindAll in DataControls.dcx file

datacontrols.JPG


Create simple Named Criteria: deptno>=20

ejb_namedcr1.JPG









Create on '+' icon to create Named Criteria:

ejb_namedcr2.JPG
Refresh the Data Controls & create a new jspx page.Drop EmpCriteria as ADF Query Panel with Table

adfquery.JPG




Run the page,click on search button & we will see that Emp table shows filtered records



© Oracle Blogs or respective owner

Related posts about /Oracle/EJB