Thursday, December 23, 2010

ADF Model: Creating Date Effective EO

Date-effectivity is an excellent feature available in Jdeveloper 11g. To learn the basics of date-effectivity in ADF, please go through my post Learning basic of Date Effectivity in ADF. With Jdev 11g, we can create date-effective objects and do date-effective operations using simple API calls. Before going into all those details, the first requirement would be creating Date-Effective EO.

The first requirement to create a DE-EO based on a table, the table should have two date columns to represent Effective Start Date(ESD) and Effecitve End Date(EED) of the record and these columns should be marked as primary keys along with id column. In other words, we need to define a composite key based on the id column and ESD and EED columns.

Creating Date Effective EO is same as creating normal EO. In addition, we need to do the following steps to make it date-effective.
1. Mark the EO as Date Effective by specifying the attribute Effective Date Type = 'EffectiveDated'. You can find this property in 'General' tab property inspector.

This will generate a new transient attributte called 'SysEffectiveDate' in the EO. Please find the screenshot below:

2. We need to specify which columns represent effective-date columns by checking the Check 'Effective Date' check box and selecting 'Start' and 'End' radio buttons for the effective-date columns which represent Effective Start Date and Effective End Date. Find the screen shots below:

3. Optional: Change the data type of SysEffectiveDate attribute to 'java.sql.Date' from 'oracle.jbo.domain.Number'. We'll often find it easier with native Java sql data types instead of using Oracle's jbo datatypes. It is recommended to use java native sql type(java.sql.Date) for all date type attributes in the EO.

That's it. Now, your EO is date-effective and supports date-effective operations on it's rows.


  1. Hi there, thanks for article. Could you provide any insight into why when I try this, the efffective date radio box (in the property inspector of the attribute) is greyed and not selectable?

    1. Great Article. Looking great work dear, I really appreciated to you on this quality work. I would like say thanks for this post. Here are some useful links for stdudents all across the globe. These tips may help me in the future. A high-standard post with all imperative information.
      Final Year Project Domains for CSE
      IEEE Project Centers in Chennai

      JavaScript Training in Chennai
      JavaScript Training in Chennai

  2. Ok just worked out this is because I am doing it with a view object rather than an Entity Objects. This raises the next question (and it might sound very stupid) why do you need entity objects?

  3. @Simon: Entity Objects represent to tables in database. And, the core of ADF is based on EOs and VOs. Whatever the operations(create, update, etc.,) you perform will finally commit to DB via entity objects. You can go through for more info in Entity Objects.

  4. Hi Murali,

    I have a simple query.
    When a new row is created, I understand framework is creating new duplicate row with updated fields. My requirement is to create the new row with just updated attribute values & not every value from base row.
    Is there a way to customize this ?
    Please let me know.


  5. Sapiens IAS offers flexible and results-oriented Best Anthropology Coaching Coaching for UPSC and IAS students through an online and offline training program by well known IAS trainer Mr. Pradip Sarkar.

    Call: 8700922126 || 011-2875 6962 || 9718354962
    Address: 17A/44, W.E.A. 3rd Floor, Near Karol Bagh Metro Station (Pillar No. 99), New Delhi- 110005.

    Read More at:

  6. Wethecoders is one of the leading online assignment help services. always take step towards your satisfaction. We work hard so that you can get good grades. Our prime motto is to help you to get good grades in your assignment, project and homework. Our team is professional and knowledgeable. We are here to help you 24/7. Try once to take the advantage of our services and we assure you that you will get surely the best result.

    Read More:


Related Posts with Thumbnails