Chapter 7 Creating J2EE Applications for IBM WebSphere 5.0


Defining Classes and Database Schema

If you have an existing database, you can reverse engineer the database to create a Physical Data Model (PDM), generate an Object-Oriented Model (OOM) from the PDM and generate the default O/R mapping, then convert classes to EJBs.

For a new application, you can create a class diagram in an OOM, generate the PDM from the OOM and generate the default O/R mapping, then convert classes to EJBs.

If you already have a database schema and an Object Model but they do not match, you can manually define the O/R mapping, then convert classes to EJBs.

The following diagram shows an example of PDM:


The following diagram shows the OOM generated from the PDM.


The class and attribute names can be changed to respect Java naming conventions. When you rename classes, attributes, tables or columns, the O/R mapping is automatically updated if it is not user-defined.

Note: We recommend that you first create a package in the OOM, then define classes inside the package. The package is used to create the JAR and WAR files. Without a package, you may not be able to deploy EJBs into WebSphere Application Server.

 


Copyright (C) 2006. Sybase Inc. All rights reserved.