268 total views, 8 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

Pre-Requisite:

Version JDeveloper 12.1.3

Schema: HR Schema

Create Fusion Web Application

1. Go to File >> New >> ADF Fusion Web Application >> Click Ok

050316_1721_GenerateJav1 How to generate Java classes from ADF AppModule & Entity Objects

 

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

050316_1721_GenerateJav2 How to generate Java classes from ADF AppModule & Entity Objects

Create Entity and View Object for Country table

3. Right-click the Model >> Select Entity Object

050316_1721_GenerateJav3 How to generate Java classes from ADF AppModule & Entity Objects

4. Click + icon to create HR Schema connection >> Click Ok

050316_1721_GenerateJav4 How to generate Java classes from ADF AppModule & Entity Objects

5. Input Name CountryEO >> Choose Countries in the schema object >> Click Next

050316_1721_GenerateJav5 How to generate Java classes from ADF AppModule & Entity Objects

6. Click Next until you get the following screen >> Check both the check boxes and click Finish.

050316_1721_GenerateJav6 How to generate Java classes from ADF AppModule & Entity Objects

7. This will create Entity & View objects in the Model Project.

050316_1721_GenerateJav7 How to generate Java classes from ADF AppModule & Entity Objects

Create Java Class for App Module

8. Double click on the AppModule >> Select Java >> Click the Pencil Icon as shown below

050316_1721_GenerateJav8 How to generate Java classes from ADF AppModule & Entity Objects

9. Choose both the check boxes and click Ok

050316_1721_GenerateJav9 How to generate Java classes from ADF AppModule & Entity Objects

10. This will create two java classes under AppModule

050316_1721_GenerateJav10 How to generate Java classes from ADF AppModule & Entity Objects

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

050316_1721_GenerateJav11 How to generate Java classes from ADF AppModule & Entity Objects

Create Java class for Entity Objects

12. Double click on the CountryEO >> Click Java > Click the pencil icon

050316_1721_GenerateJav12 How to generate Java classes from ADF AppModule & Entity Objects

13. Select all the check boxes and click Ok

050316_1721_GenerateJav13 How to generate Java classes from ADF AppModule & Entity Objects

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

050316_1721_GenerateJav14 How to generate Java classes from ADF AppModule & Entity Objects

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.

050316_1721_GenerateJav15 How to generate Java classes from ADF AppModule & Entity Objects

govindan How to generate Java classes from ADF AppModule & Entity Objects
Connect me

Govind

Thank you for visiting my personal blog. Myself Govindan, Software Developer by profession since 2006 and hence I started this blog early in 2016 and ever since I've been writing about technologies experienced and learnings of everyday life.

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 šŸ™‚
govindan How to generate Java classes from ADF AppModule & Entity Objects
Connect me
By | 2017-06-11T13:15:48+00:00 May 3rd, 2016|Categories: ADF|Tags: , , , , , |0 Comments
Like us on Facebook.
Connect!