In my one of the post https://www.techtravelhub.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.
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.
Step-3: Once you double click on the attribute or click pen symbol it will open up the Editor.
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
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.
This property talks about the mapping of the attribute with a particular column
Mandatory/Non Mandatory:
Thi
s 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
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.
Like!! I blog quite often and I genuinely thank you for your information. The article has truly peaked my interest.