Wednesday, 13 July 2016

How to use History columns in Oracle ADF for mini auditing

History columns in Oracle ADF is a very convenient builtin functionality which takes out a little bit pain out of the developers to maintain the who columns.It is very simple to implement and have to be done at the Entity Object level.Below are the list of History or WHO columns available in Oracle ADF.


1) created on -- TimeStamp
2) modified on -- TimeStamp
3) created by -- VARCHAR2
4) modified by -- VARCHAR2
5) version number – LONG



Below are the high level steps:
Step 1: ADD the History columns to Employees table of HR Schema

  created_on        TIMESTAMP(6),
  created_by        VARCHAR2(40),
  modified_on       TIMESTAMP(6),
  modified_by       VARCHAR2(40),
  version_number    LONG

Step 2: Create an Entity Object for the EO and for each of the history column attributes, map the track change history.

Step 3: Repeat the steps for Modified on,created by, modified by and version number
Step 4: On the version number field, you need to additionally select the checkbox for change indicator.

TIP 2:
Version number is used as a record change indicator
 Step 4: Thats it, everything else will be taken care by the framework itself when you create a new record or update an existing record.


Now you know how to enable mini audit for your ADF application.

No comments:

Post a Comment

Contact Me

Name

Email *

Message *