Enterprise JavaBean wizard

This is a feature of JBuilder Enterprise.

Use the Enterprise JavaBeans wizard to begin creating an Enterprise JavaBean. The wizard creates either a session or an entity bean. Once the wizard generates the code, you then use JBuilder's code editor to add the methods and fill in method implementations that your enterprise bean requires.

If you have one or more existing database tables you want to use to create entity enterprise beans, use the EJB Entity Bean Modeler.

To display the Enterprise JavaBean wizard, choose File|New to display the object gallery, click the Enterprise tab, then double-click the Enterprise JavaBean Wizard icon.

Step 1

Available EJB Groups

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

Step 2

Class Information

The class information identifies the new enterprise bean class your are creating and specifies the class you want to use as the base class for the bean.

Package

Specify the package you want the new enterprise bean class to become part of.

Class Name

Type in the name of bean class you are creating. JBuilder suggests a default name, but you probably want to specify a more descriptive name.

Base Class

Specify a base class you want to use for the new bean class. By default, JBuilder suggests the java.lang.Object class.

Options

You are building either a session enterprise bean or an entity enterprise bean. The Options group allows you to select between these two types of beans. If you are building a session bean, you must also choose between a stateless and stateful session bean. For more information about session beans, see Developing session beans.

If you are creating an entity enterprise bean, you must decide whether the persistence of the bean is managed by the bean code itself or by the container. For more information about entity beans, see Developing entity beans.

Stateless Session Bean

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

Stateful Session Bean

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

Session 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.

Bean Managed Persistence Entity Bean

If you are creating an entity bean, you can choose between a bean with bean-managed persistence or container-managed persistence. Select the Bean Managed Persistence Entity Bean option if you want to write the bean code to maintain the bean's persistence yourself.

Container Managed Persistence Entity Bean

Select this entity bean option if you want the container to manage the bean's persistence.

Primary Key Class

If you are creating an entity bean, you must specify a primary key class. Enter the class that will be the type of the primary key for the bean.

The primary key is represented by a Java class or primitive data type containing the unique data. This primary key class can be any class as long as that class is a legal value type in RMI_IIOP. This means the class must extend the java.io.Serializable interface, and it must implement the Object.equals(Other other) and Object.hashCode() methods, which all Java classes inherit.

The primary key class can be specific to a particular entity bean class. That is, each entity bean can define its own primary key class. Or multiple entity beans can share the same primary key class.

Step 3

Enterprise Bean Class

Displays the name of the bean class you are creating.

Home Interface Class

The name of the home interface for the bean you are creating. JBuilder suggests a default name based on the name you entered for your bean class. You can accept this suggested name, or enter a new name for the home interface.

Remote Interface Class

The name of the remote interface for the bean you are creating. JBuilder suggests a default name based on the name you entered for your bean class. You can accept this suggested name, or enter a new name for the remote interface.

Bean Home Name (JNDI)

The name JNDI uses to locate the enterprise bean. JBuilder suggests a default name based on the name you entered for your bean class. You can accept this suggested name, or enter a new name for the bean home name.

Generate Headers

Select this option if you want the name of the title, description, version number, company, author, and copyright labels to appear in a JavaDoc section at the top of the generated bean class file.