+

Search Tips   |   Advanced Search

 

Develop enterprise beans

 

In selecting a tool for developing enterprise beans, there are two basic approaches, with or without an IDE. The steps in this article explain development without an IDE. Design a J2EE application and the enterprise beans that it needs.

 

Overview

There are two basic approaches to selecting tools for developing enterprise beans:

The following steps primarily support the second approach, development without an IDE.

 

Procedure

  1. If necessary, migrate any pre-existing code to the required version of the Enterprise JavaBeans (EJB) specification.

  2. Write and compile the components of the enterprise bean.

  3. For each entity bean, complete work to handle persistence operations.

    • Create a database schema for the entity bean's persistent data.

      • For entity beans with container-managed persistence (CMP), store the bean's persistent data in one of the supported databases. The Application Service Toolkit automatically generates SQL code for creating database tables for CMP entity beans. If your CMP beans require complex database mappings, it is recommended that you use the IBM Rational Application Developer product to generate code for the database tables.

      • For entity beans with bean-managed persistence (BMP), you can create the database and database table by using the database tools or use an existing database and database table.

      For more information on creating databases and database tables, consult your database documentation.

       

    • (CMP entity beans for EJB 2.x only) Define finder queries with EJB Query Language (EJB QL).With EJB QL, you define finders in terms of CMP fields and container-managed relationships, as follows:

      • Public finders are visible in the bean's home interface. Implemented in the bean class, they return only remote interfaces and collection types.

      • Private finders, expressed as SELECT statements, are used only within the bean class. They can return both local and remote interfaces, dependent values, other CMP field types, and collection types.

       

    • (CMP entity beans for EJB 1.1 only: an IBM extension) Create a finder helper interface for each CMP entity bean that contains specialized finder methods (other than the findByPrimaryKey method).The following logic is required for each finder method (other than the findByPrimaryKey method) contained in the home interface of an entity bean with CMP:

      • The logic must be defined in a public interface named NameBeanFinderHelper, where Name is the name of the enterprise bean (for example, AccountBeanFinderHelper).

      • The logic must be contained in a String constant named findMethodName WhereClause, where findMethodName is the name of the finder method. The String constant can contain zero or more question marks (?) that are replaced from left to right with the value of the finder method's arguments when that method is called.

 

What to do next

Assemble the beans in one or more EJB modules.



Developing read-only entity beans

Migrating enterprise bean code to the supported specification

WebSphere extensions to the Enterprise JavaBeans specification

Best practices for developing enterprise beans

Setting the run time for batched commands with JVM arguments

Setting the run time for batched commands with the assembly tools

Setting the run time for deferred create with JVM arguments

Setting the run time for deferred commands with the assembly tools

Setting partial update for container-managed persistent beans

Setting Persistence Manager Cache invalidation

Setting the system property to enable remote EJB clients to receive nested or root-cause exceptions

Unknown primary-key class

Configure a Timer Service

Developing Enterprise JavaBeans 2.1 for the timer service

Web service support

Binding Web modules to virtual hosts

Binding EJB and resource references

Defining data sources for entity beans

Lightweight local operational mode for entity beans

Applying lightweight local mode to an entity bean

 

Related concepts


Enterprise beans
Concurrency control

 

Related tasks


Developing applications that use JNDI

 

Related Reference


Enterprise beans: Resources for learning