- Follow the post "How to create an Oracle ADF Fusion Web Application?", to create an application, change Application name to "SampleEntityObjectCreationApp" and suffix to "sampleEO".
- Following screen appears with a project structure on left hand side of the screen.
- Project is created, now start creating the Entity Object.
Right click on the model project from the project explorer window and select new -> Entity Object.
- Following screen appears. Oracle has default HR database, lets work on this database.
Specify the name of entity object.
- Click on Browse button to select the schema object/table.
Let select Employee schema and click ok.
- Click Next.
- Following screen appears. Here you will find all the table attributes/columns.which will be the entity attributes.
Here we can also add new transient attributes at entity level by clicking on New button. Click next.
- Here for every entity attribute specify the constraints like mandatory, unique, primary key used for entity level validations. By default it picks the constraints defined on database tables, but we can change at entity level based on the requirement.and click next.
- Following screen appears with an option:-
Generate Entity Object Impl checkbox :- If we want to customize DML operation such as perform some logic at entity level then select this checkbox. It will create EntityImpl.java class.
Entity Collection Class :- It will create EntityCollImpl.java
Entity Definition Class :- It will create EntityDefImpl.java
But we are not performing any custom logic at entity side.So leave it as default and
click next.
- Now in the next screen it will ask to create view Object on basis of this entity object.
As we are focusing on entity object on this post. So leave unchecked the checkbox and click next.
0 comments:
Post a Comment