EJB 1.x Bean Generator wizard

This is a feature of JBuilder Enterprise.

The EJB 1.x Bean Generator generates a skeleton enterprise bean class based on a specified existing remote interface. Once the skeleton is created, you must edit the generated code to fill in the empty method bodies with the code you want to fully implement the methods. The methods to implement are marked with comments to show you what needs to be done.

The EJB 1.x Bean Generator also creates a home interface if none exists, or it asks your permission to overwrite an existing one.

To use the wizard, open the remote interface in JBuilder's code editor, then choose Wizards|EJB|EJB 1.x Bean Generator.



Select EJB module

This is a feature of JBuilder Enterprise.

Use this option to specify the EJB module the enterprise bean you are creating will belong to.

Available EJB Modules

Displays a list of EJB modules that are defined in your current project. Select the EJB module you want this new enterprise bean to belong to. If no EJB modules are listed or you want to create a new EJB module for the enterprise bean, click the New button to start the Empty EJB Module wizard; once the Empty EJB Module wizard finishes, the Enterprise JavaBean 1.x wizard resumes.



EJB type

This is a feature of JBuilder Enterprise.

Use this step to specify the type of enterprise bean you are creating.

Stateful Session Bean

Select this option is you are creating a stateful session bean.

Synchronization

Select this option to have your stateful session bean class implement the SessionSynchronization interface. For information about using this interface, see The SessionSynchronization interface.

Stateless Session Bean

Select this option if you are creating a stateless session bean.

BMP Entity Bean

Select the BMP Entity Bean option if you want to create an entity bean with bean-managed persistence. An entity bean with bean-managed persistence contains the code to access and update a database. That is, you, as the bean provider, write database access calls directly in the entity bean or its associated classes.

CMP EJB 1.1 Entity Bean

Select the Container Managed Persistence EJB 1.1 Entity Bean option if you want to create an entity bean with container-managed persistence. You don't have to write code that accesses and updates databases for entity beans with container-managed persistence. Instead, the bean relies on the container to access and update the database. The bean generated conforms to the EJB 1.1 specification. This option is not available if the target application server is WebSphere 3.5.



EJB bean options

This is a feature of JBuilder Enterprise.

Use these options to name and specify the components of the enterprise bean you are creating.

Remote Class

Displays the name of the remote interface you are using to generate the bean class.

Bean Class

Specifies the name of the bean class to generate. The wizard suggests a default name based on the name of the remote interface. If you want a different name, type it in here.

Bean Name

Specifies the name of the bean. The wizard suggests a default name based on the name of the remote interface. If you want a different name, type it in here.

Home Class

Specifies the name of the home class to generate or overwrite. The wizard suggests a default name for the home interface based on the name of the bean class. If you want a different name, type it in here.

JNDI Name

The JNDI name is how the enterprise bean is identified through JNDI. The wizard suggests a default name for the JNDI name based on the name of the bean class. If you want a different name, type it in here.

Primary Key Class

Specifies the class used as the primary key. This option is available for entity beans only.

Persistent Fields

Lists the fields defined in the remote interface. Check each field you want to be persistent. By default, all are checked. This option is available only for entity beans.

Finish

Clicking the Finish button generates the bean class. View the generated source code and add the code necessary to implement the skeleton methods. Comments placed in the generated source code will help you see where code is needed.