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
If you have a need to track the last update login like EBS also in addition to the above list, you can implement by using the custom code.
History and Geography is OK, how about implementing the same in your application?
Below are the high level steps:
Step 1: ADD the History columns to your table with the datatype like below
CREATE TABLE CHOLA.CHOLA_USERS
USER_NAME VARCHAR2(50 BYTE) NOT NULL ENABLE,
PASSWORD VARCHAR2(500 BYTE) NOT NULL ENABLE,
FIRST_NAME VARCHAR2(50 BYTE),
LAST_NAME VARCHAR2(50 BYTE),
ACTIVE VARCHAR2(20 BYTE),
CREATED_BY VARCHAR2(50 BYTE),
MODIFIED_BY VARCHAR2(50 BYTE),
TENANT_ID NUMBER NOT NULL ENABLE,
LDAP_SYNC VARCHAR2(1 BYTE) DEFAULT 'N',
CONSTRAINT CHOLA_USERS_PK PRIMARY KEY (USER_ID));
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.
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.