Synchronizing Entity Objects with Database Changes

Share and Enjoy !

In my previous posts
I have described how to create Entity Objects in ADF using JDeveloper. In this post I would like to venture how to synchronize the Entity Object with Database. 
As we know EO creation is an wizard based technique which is provided by JDeveloper. link talks about the EO creation from database.
What is EO?-An entity object is a cache for holding records from an underlying database table.
An EO is having six parameters
Business Rules
Business Events
View Assessors
The rule of thumb is what ever there in the database table can be captured by JDeveloper while dragging as a component.
So after successful creation of EO all these six parameters are set and corresponding backend use case and code is generated.
Now say due to some reason your database got changed. The table it was connected was changed . The EO becomes invalid or out of Sync with data table.
Below are the two ways how to make it sync with data table again.
Process 1: Delete the EO and create one new…this is applicable if the project is new or in an early stage of the development.
Step-1. Right click on the effected EO and click on Delete. It will check the usage and will delete the same
Process-2: Say the project is bit older and the EO is having lot more usage in different areas. Now deleting the same will create a lot of problems.Now we need a shortcut way to rectify the same.
Step-1. Right click on the effected EO and click on synchronize with database.
Step-2: This will open up a pop up. Now to synchronize all click on the corresponding button. The focus has to be in root level.
If you want to synchronize in child level …select the child level node. The corresponding Synchronize button will be enabled and click on that.
Step-3: Write this change log to a file(.txt). Click on Write to file button
Step-4: On click Save the change log is created
Step-5: Open the txt file this will give you the structure of change.
Entity :EmployeeEO
|__Attribute :DepartmentId
|____Change Mandatory to:false
|__Remove Key Constraint: EmployeesDepartmentIdCheck
This is the way how you can synchronize the EO with the data table. 
There are cases when this method will not work properly…Please go through 

See also  How to Create Entity Objects Diagram in ADF

Share and Enjoy !

4 thoughts on “Synchronizing Entity Objects with Database Changes

  1. For me, "Synchronize with database" is greyed out. I have my database connections right and i am getting success when testing the connection. Do you know why?

  2. Thank you for another fantastic article. Where else could anybody
    get that kind of info in such a perfect approach of writing?
    I’ve a presentation subsequent week, and I’m at the look for such info.

Leave a Reply

Your email address will not be published. Required fields are marked *