To learn the basics of date-effectivity in ADF, please go through my post Learning basics of Date Effectivity in ADF. To learn how to create date-effective EO, please go through my post Creating Date Effective EO.
Creating Date Effective Association:
To have the basic idea of association between EOs, please go through my post ADF Model: Creating Entity Association. But, by default the association created is not date-effective. But, if you're creating association between two EOs in which at least on of them is effective-dated, then you should mark the association as 'Effective Dated'. To make the association date-effective,
1. Open Association -> Goto 'Relationship' tab -> Behavior -> Check 'Effective Dated Association' checkbox.
Marking the association 'Effective Dated Association' will take effective date into consideration while searching, inserting and updating the records.
Creating Date Effective VO:
Creating date effective VO is same as creating normal VO. In addition, we need to
1. Mark the VO as date-effective by setting EffectiveDated='true' for the VO. You can find this property in 'General' tab property inspector.
Specifying the above property for the VO will generate a new transient attribute called SysEffectiveDate in the VO.
2.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.
Marking the VO effective dated, will support date-effective updates for a single record.
Showing posts with label VO. Show all posts
Showing posts with label VO. Show all posts
Sunday, December 26, 2010
Thursday, September 9, 2010
ADF Model: Creating View Object (VO)
View Object (VO) is build on one or more entity objects. Please follow the below steps to create VO.
1. In Model project, right click on any package, select 'New View Object..'
2. Now, 'Create View Object' wizard appears -> In the 'Name' stop, Give Name for the VO, select/give correct package for the VO. The VO Name is generally follows the convention <objectname>VO. For e.g., EmpVO
3. Click 'Next' -> In the 'Entity Objects' section, select the EOs on which you want create the VO and shuffle to the right side.
4. Click 'Next' -> In the 'Attributes' section, select the EO attributes you want to include in the VO and shuffle them to the right side.
5. Click 'Next' -> In the 'Attribute Settings' section, you can give settings for each of the VO attributes.
6. Click 'Next' -> The 'Query' section displays the VO query along with the generated Where clause.
7. You can add 'Order By' clause to the query in 'Order By' filed. You can 'Edit..' and select the 'Order By' attribute'
8. Click 'Next' -> In the 'Bind Variables' section, you can add one or more bind variables. Bind variables are used to form parameterized queries.
9. Click 'Next' -> In 'Java' section, you can opt to select ViewObject class and VO row class etc.
10. Click 'Next' -> In the 'Application Module' section, you can check 'Application Module' check box and create application module to add this VO.
11. Click 'Next' to see the summary of the VO and then click 'Finish'.
12. Now, you'll find the newly created Association in model project under the specified package.
1. In Model project, right click on any package, select 'New View Object..'
2. Now, 'Create View Object' wizard appears -> In the 'Name' stop, Give Name for the VO, select/give correct package for the VO. The VO Name is generally follows the convention <objectname>VO. For e.g., EmpVO
3. Click 'Next' -> In the 'Entity Objects' section, select the EOs on which you want create the VO and shuffle to the right side.
4. Click 'Next' -> In the 'Attributes' section, select the EO attributes you want to include in the VO and shuffle them to the right side.
5. Click 'Next' -> In the 'Attribute Settings' section, you can give settings for each of the VO attributes.
6. Click 'Next' -> The 'Query' section displays the VO query along with the generated Where clause.
7. You can add 'Order By' clause to the query in 'Order By' filed. You can 'Edit..' and select the 'Order By' attribute'
8. Click 'Next' -> In the 'Bind Variables' section, you can add one or more bind variables. Bind variables are used to form parameterized queries.
9. Click 'Next' -> In 'Java' section, you can opt to select ViewObject class and VO row class etc.
10. Click 'Next' -> In the 'Application Module' section, you can check 'Application Module' check box and create application module to add this VO.
11. Click 'Next' to see the summary of the VO and then click 'Finish'.
12. Now, you'll find the newly created Association in model project under the specified package.
Subscribe to:
Posts (Atom)


