7 total views, 1 views today
How to generate Java classes from ADF AppModule & Entity Objects
In this section, we have described an example of how to create anF AppModuleImpl and EntityImpl Java classes from ADF AppModule and EO object
Version JDeveloper 12.1.3
Schema: HR Schema
Create Fusion Web Application
1. Go to File >> New >> ADF Fusion Web Application >> Click Ok
2. Input Application Name >> then Input Project Name for Model >> then Input Package Name for Model >> then Input Project Name for ViewController >> then Input package name for ViewController >> Next >> Finish
The Application and two projects get created in JDeveloper as shown below
Create Entity and View Object for Country table
3. Right-click the Model >> Select Entity Object
4. Click + icon to create HR Schema connection >> Click Ok
5. Input Name CountryEO >> Choose Countries in the schema object >> Click Next
6. Click Next until you get the following screen >> Check both the check boxes and click Finish.
7. This will create Entity & View objects in the Model Project.
Create Java Class for App Module
8. Double click on the AppModule >> Select Java >> Click the Pencil Icon as shown below
9. Choose both the check boxes and click Ok
10. This will create two java classes under AppModule
11. Double click on the AppModuleImpl.java class. Most of the time, we use this class for exposing our custom Java methods or edit existing methods because this class can access all view objects registered with the AppModule
Create Java class for Entity Objects
12. Double click on the CountryEO >> Click Java > Click the pencil icon
13. Select all the check boxes and click Ok
14. This will generate Java class for the entity object. We use Entity Java classes for entity level operation, for example, we need a validation before inserting/updating any record in the country table
15. Open the CountryEOImpl.java; there are three methods at the bottom of the line. The methods are for create records (), remove records and commit the transaction in Country table. Add your java rule in this method for further customization to the entity object.
The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.
Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂
Latest posts by Govind
- JSF Login Logout Form Authentication Example - October 16, 2017
- How to Bookmark URL in JSF using GET method and ViewParam – example - October 14, 2017
- JSF Dynamic Navigation and how to use wildcard in navigation - October 12, 2017