Pages - Menu

Friday, September 13, 2013

How to Search in Views - Part 2 || Oracle ADF

After my first Topic about "How to Search in Views - Part 1", today, we need to include using findByAltKey built in function, but before that, we need to know what is the meaning of Alternate Key ?
- Alternate Key definition exist in Entity Object.
- if you need a unique Key but no need to be in db Level.
- Enhance performance of Direct Look up.
Note : The difference between the primary key attributes and the alternate key attributes is that, primary key attributes cannot be null and the alternate key attributes can be null.
Finally : what is the Structure & defination of findByAltKey ..
findByAltKey(java.lang.String keyName,
                         Key key,
                         int maxNumOfRows,
                         boolean skipWhere)
  • Define Alternate Key with name “test” in EO of Employees based on 2 Attributes (Employee Id & Manager Id).
  • choose this Alt Key to be used in VO now as  below.
  • Define impl Class of AM.
  • Build Method to use findByAltKey to get your result & please define it as a client Interface.

  • Define RowIterator to save the result, passing test Key Name and Object of Two Values (as Alternate Key consist of 2 columns), Expecting Returning Unlimited No of Rows (-1), but we know that expected value is only one & activating using skipwhere to skip using where clause of VO.
  • Let us Check Now the Result, Perfect one ..
- Next topic, we will increase our knowledge with ViewCriteria Search Ways.

7 comments: