ADF MODEL - VIEW CRITERIA (VC)


ADF View Criteria:


VIEW CRITERIA is nothing but a "Where" clause to the SQL query with some special functions". It will be used to refine the query results.

View Criteria Types:
===============
1. Implicit View Criteria: Renders all the areas in the VO as a filter field. (Default)
2. Named View Criteria: Selected fields are participating in the filter fields section as per the configuration.
  
Key Technical Term:
--------------------------

What is RowMatch : 

           RowMatch is nothing but "in-memory row filtering" OR CACHE

What is Mode : [Filtering Option]

           Query/Database - Use query's where clause. [Default]
           Cache - In memory filtering
           Both  - Use query or memory filtering.

What is Bind Variables:

          Parameters applied to queries that are utilized to further fine-tune the outcomes.
          [We can configure the bind variable during design time itself.]

What is Criteria Item:

    Fields which are participating in the filter/search

Criteria Operators:

   Operators (between, contains, startWith )
         
Usage:
====
          - Apply view criteria to the interested instance of a VO @ run-time. 
          - Use View Critiera metadata for your coding as per your convinient.
          - Remove View Criteria 
          - Reset View Criteria

Important Note:
==========
 Things to remember while using Transient Attribute:

     1. If you add a transient attribute in the af: query panel, the framework will automatically change the query mode to "both" though you have picked out as "Database" during design time.

    2. We are not supporting transient attribute based on Entity Object in the table filter.

    
Examples (Design View):
-------------------------------










Examples (Programmatic)
--------------------------------

public static void ShowViewCriteriaExample(ApplicationModule appMod)
    {
        // Create and populate criteria rows to support query-by-example.
        ViewObject empView = 
           applicationModule.createViewObject("Emp", "dpalanis.EmployeesView");
        ViewCriteria vc = empView.createViewCriteria();
        ViewCriteriaRow vcRow = vc.createViewCriteriaRow();

       // ViewCriteriaRow attribute name is case-sensitive.
       // ViewCriteriaRow attribute value requires operator and value.
       // Note also single-quotes around string value.
       ViewCriteriaItem someItem = vcRow.ensureCriteriaItem("<attribute_name>");
       someItem.setOperator("=");
       someItem.getValues().get(0).setValue("<value>");
       vc.add(vcRow);

       vcRow = vc.createViewCriteriaRow();
       ViewCriteriaItem salItem = vcRow.ensureCriteriaItem("<attribute_name>");
       salItem.setOperator("<");
       salItem.getValues().get(0).setValue(new Integer(<value>));
       vc.add(vcRow);

       empView.applyViewCriteria(vc);

       // Multiple rows are OR-ed in WHERE clause.
       System.out.println("View Criteria");

       // Should print employees based on the above conditions
       printVO(empView); --> print using custom method
    }

Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. Our Oracle SOA Training would focus and ensure that the participants are comfortable using various SOA components/Adaptors. Upon completion of the training, you will be a confident Oracle SOA programmer. So, let us get started!!!

    ReplyDelete
  3. Our Oracle SOA Training would focus and ensure that the participants are comfortable using various SOA components/Adaptors. Upon completion of the training, you will be a confident Oracle SOA programmer. So, let us get started!!!

    Oracle SOA Training
    Oracle SOA 12c Training
    Oracle SOA 12c Training



    ReplyDelete

Post a Comment

Please add your comment

Popular posts from this blog

showRowKey functionality

Best Practices