Showing posts with label Entity. Show all posts
Showing posts with label Entity. Show all posts

Thursday, September 9, 2010

ADF Model: Creating Entity Association

An Entity Association defines the relationship between two entities or EOs. Follow the below steps to create an entity association.

1. In Model project, right click on any package, select 'New Association'.

2. Now, 'Create Association' wizard appears -> In the 'Name' stop, Give Name for the Association, select/give package for the Association. The Association Name is generally follows the convention <SourceEO>To<DestinationEO>. E.g., DeptEOToEmpEO.

3. Click 'Next' -> In the 'Entity Objects' section, select the Source and Destination EOs and the attributes in Source and Destination EOs on which you want define the association.

4. Click 'Next' -> In the 'Assocation Properties' section, specify the properties if applies. For e.g., if the assocation is composite, check the box 'Composite Association'.

5. Click 'Next' -> In the 'Edit Assocation Query' section, verify if the where clause for the association generated is right. You can modify the query where clause if needed.

6. Click 'Next' -> 'Summary' displays the summary of the created association -> Click 'Finish'.

7. Now, you'll find the newly created Association in model project under the specified package.

8. Once, you create the association between EmpEO and DeptEO, Jdeveloper will add the association accessors in each of the EOs.

Wednesday, September 9, 2009

How to skip entity level validations until the transaction is submtted?

When there are entity level validations in your EO, those validations get fired in your pages for every action say for example, on switching a tab or clicking on a button etc. But, many times you want to prevent these validations until you submit the transaction. i.e., you want to get these validations only when you're submitting/committing the transaction.

For that, you need to goto the page definition of main jspx page(if you're having jsff pages, there will be one main jspx that contains the template i.e, that accommodates these jsffs) and then, in the main tag, add property skipValidation='true'. This will suppress all entity level validations until u submit the transaction. And, all attribute level validations will be working as it is. Example pageDefinition tag is given below:

<pagedefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"> version="11.1.1.54.7" id="CarDecorsHomePageDef" Package="com.mpapana.cardecors.ui.page" SkipValidation="true"> </pagedefinition>
Related Posts with Thumbnails