Generating J2EE code

Step 1: General Settings

To generate code for Java 2 Standard Edition, choose the "Generate J2EE DAO Tier" menu option under the "Generate" menu. You are presented with the following dialog:

Java Generation

Application Name

The application name is used within the generated build script to determine the name of the JAR file to create. The application name has no impact on the generated Java code.

Package Name

Enter the package name that you wish to use for the generated code. Multiple packages are created within this package. For example, choosing the default package name of com.mycompany.myapp results in the following packages being generated:

com.mycompany.myapp.dao
com.mycompany.myapp.dto
com.mycompany.myapp.exception
com.mycompany.myapp.factory
com.mycompany.myapp.jdbc

Output Directory

It is recommended that you choose an output directory that is separate from other source code in your Java project. For example, if your hand-written code is under a "src" directory, it is recommended that you generate your DAO code to a "dao" directory at the same level as the "src" directory.

Delete Files

It is recommended that the "delete files" options remains checked. This will cause FireStorm/DAO™ to delete files in the output directory before generating code and therefore ensures a clean build each time. FireStorm/DAO™ will not CVS or Subversion version control files (FireStorm/DAO™ will not delete folders named "CVS" or ".svn", or files named ".cvsignore".

Logging

FireStorm/DAO™ supports three options for generating logging code: log4, stdout, and none.


Step 2: Choose J2EE Application Server

Select the target application server from this list. If your application server is not listed, choose the Generic J2EE server. FireStorm/DAO™ generates standard J2EE deployment descriptors as well as proprietary deployment descriptors required by most application servers.

J2EE Application Server


Step 3: Choose a Persistence Strategy

Choose between JDBC, Enterprise JavaBeans (CMP), or Java Data Objects as the persistence mechanism. If CMP is selected, Entity Beans and appropriate deployment descriptors are generated for each table, but JDBC code is still generated for views and Custom DAOs.

J2EE Code Generation


Step 4: JDBC Connection Settings

Choose between using hard-coded JDBC connection details (during development) or JNDI (for live deployment). FireStorm/DAO™ will generate a ResourceManager.java based on the selection. This ResourceManager.java file can be customized.

J2EE Code Generation

Use JNDI

Select this option to generate a ResourceManager.java source file that uses JNDI to connect to the database. If this option is not selected, the generated ResourceManager uses JDBC to connect to the database.


Step 5: J2EE Preferences

J2EE Code Generation

J2EE Application Name

The application name is used within the generated deployment descriptors and build scripts.

Session Bean Facade

Select this option to generate a stateless session bean facade for the generated DAO tier. This makes it easy to expose the DAO tier as a Web Service.

Web Application

FireStorm/DAO™ can generate a complete web application based on JSP pages or Struts.

Dynamic Update Methods

If this option is selected, the generated DAO update() method dynamically constructs the UPDATE statement so that only modified columns are updated. The default implementation updates all columns every time.


Return to Tutorial Index