What's the difference between View Criteria and Where clause?

Posted by frank.nimphius on Oracle Blogs See other posts from Oracle Blogs or by frank.nimphius
Published on Fri, 14 Jan 2011 06:53:07 +0000 Indexed on 2011/01/14 7:56 UTC
Read the original article Hit count: 417

Filed under:

A View Criteria is a filter that you apply programmatically or by definition to a View Object instance. It augments the WHERE clause in a View Object query. Named View Criteria are defined in the Query panel of the View Object and are used

·         In combination with the af:query component to build search forms. To do this, you drag and drop the View Criteria from the Named View Criteria node of the View Object in the Data Controls Panel. In the context menu, you then select the Query component - optionally with a result table

·         To restrict a View Object instance in the Application Module model. For this, select a View object instance in the right hand list of the ADF Business Component Data Model panel. Use the Edit button to add a View Criteria to the View Object instance. This ensures that the View Object instance also runs with a query filter applied.

View Criteria use bind variables for query conditions that you want to pass in dynamically at runtime. Beside of the ability to apply View Criteria declaratively, you can apply them programmatically in Java.

A WHERE clause, if added to a View Object query by design restricts all instances of this View Object, which usually is not what developers want. Because of the benefits - and the configuration options not explained above but in the product documentation referenced below - the recommendation is to use View Criteria.

The product documentation explains View Criteria in chapter 5 of the Developer Guide:

http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcquerying.htm#BCGIFHHF

© Oracle Blogs or respective owner

Related posts about ADFm