Header Ads

How to work with Entity Object Attributes

ADF
In my one of the post http://www.askqtp.com/2012/04/synchronizing-entity-objects-with.html I have described how to synchronize EO with the data tale changes.But that will not work if the datatable itself got dropped or a column is dropped or data type is modified. In this post I would like to go deep into the concept.
To solve this type of problem, we need to work manually to make it a change at attribute level.
Step-1. Double click on the Entity object(EO) to get the graphical UI of the same. Select Attribute tab from middle pane.
image
Step-2: Select the row which you want to modify.Double click on the row or select the row and click on edit(pen) symbol above.You can add more attributes or delete attributes by clicking on + green symbol and red X symbol respectively.
image
Step-3: Once you double click on the attribute or click pen symbol  it will open up the Editor.
image
Here we can change the type or modify according to our data base design.
Property inspector will help to check and update the attribute properties. For this case--
Attribute
SQL Data Column
Java Type
Empld             NUMBER(6,0)   oracle.jbo.domain.Number
EmpFirstName       VARCHAR2(20) Java.lang.String
DateOfBirth                DATE oracle.jbo.domain.Date
EmpPhoneNumbers  PHONE_LIST_TYP  oracle.jbo.domain.Array
EmpAddress EMP_ADDRESS_TYP   model.common.EmpAddressTyp
Persistent /transient attribute :
This property talks about the mapping of the attribute with a particular column image in the database. if this field is unchecked then it is transient attribute.These are not based on any database columns. These are used for holding derived or calculated data.
 Mandatory/Non Mandatory:
Thiimages property automatically sets a null constraint at database level for that particular column. This is bit advanced version of coding where through UI we want to restrict a field to be not null. May be for this case the corresponding data base column does not have a null constraint. Based on the on off of the checkbox this is going to select.
 Primary key/Non Primary key: 
This property sets a primary key for the working table even if it does not have image a primary key. JDeveloper will automatically does that. It is must that an EO will have a primary key to proceed. This on/off only talks about which field will be a primary key.  
Queryable:Selected if this attribute can occur in a view objects WHERE clause. Selected image by default except for LOBs.
UpdatableThis property talks about  when an entity object attribute can be updated: image Always, While New, or Never.









Powered by Blogger.