Next ADF Training
Join Demo Session
Toggle Bar
  • Home
    Home This is where you can find all the blog posts throughout the site.
  • Categories
    Categories Displays a list of categories from this blog.
  • Tags
    Tags Displays a list of tags that have been used in the blog.
  • Bloggers
    Bloggers Search for your favorite blogger from this site.
  • Team Blogs
    Team Blogs Find your favorite team blogs here.
  • Archives
    Archives Contains a list of blog posts that were created previously.
  • Login
    Login Login form

How to use History columns in Oracle ADF for mini auditing

Posted by on in ADF BC
  • Font size: Larger Smaller
  • Hits: 8220
  • 0 Comments
  • Subscribe to this entry
  • Print
  • Report this post

b2ap3_thumbnail_image_20130304-162011_1.png

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

 

TIP 1:

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_ID NUMBER, 

 

  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), 

 

  START_DATE DATE, 

 

  END_DATE DATE, 

 

  CREATED_ON TIMESTAMP, 

 

  CREATED_BY VARCHAR2(50 BYTE), 

 

  MODIFIED_ON TIMESTAMP, 

 

  MODIFIED_BY VARCHAR2(50 BYTE), 

 

  LAST_UPDATE_LOGIN NUMBER(38,0), 

 

  VERSION_NUMBER LONG, 

 

  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.

image

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.

y5jneqpk

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.

ilf2uucq

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

© Creative Commons Attribution Assurance 3.0 License.
0
  • No comments found

Login