Oracle ADF Newbie — Designing and Building the Database Objects
The first thing you need to think about when developing applications is how your tables will look like. JDeveloper allows you to create a diagram for your database objects from which you can automatically create the script for deploying the objects in any computer (or server).
Considerations when designing a database model for an ADF application
When designing the database model you should always consider the rules of the business process that you will try to resolve with your application. You can add rules at Database level but with ADF you can also add them at the Business Components (BC) level. Coming from a technical background in Oracle Applications there are a few things that I suggest to consider when designing the database model for your ADF Application:
- All the tables should be created with a unique primary key.
- Use the “Foreign Key” Component from JDeveloper to create your the relationships between your tables
- Consider adding sequences to your primary IDs though you can also do this from ADF BC.
- Although you can create views to be part of your database model I recommend designing them from ADF. This will give you more flexibility for creating List of Values, Reports and even Read/Write forms or tables.
- Use the option “Generate to SQL Script” from the Offline Database Source option in JDeveloper. You can then copy and paste it in SQL Developer for testing it and share it with other people in the project that are working on local XE Databases.
Create a New Application and Project
Create Database Diagram
Under the Component Pallet section you should be able to see the Database Objects components that will be used for designing the database for your application.
Now you can drag a Table component to the Diagram section and you will be prompt to create an Offline Database (Select Oracle 11g Express Edition Release 2 if you are testing your application in a laptop or private network)
If your JDeveloper looks like the screenshot below then you are ready to start designing your database
For a complete list of steps and things that you can do with JDeveloper for creating your database model I’d recommend this link. Though not all the steps may apply for developing ADF Applications.
This blog reflects my experience creating an ADF application for the first time. Comments, corrections, clarifications, tips, etc. are welcome.