EJB Designer pane

This is a feature of JBuilder Enterprise.

The EJB Designer helps you create session beans, message-driven beans, and entity beans with container-managed persistence that comply with the Enterprise JavaBeans 2.0 specification.

To begin creating an enterprise bean, right-click the EJB Designer pane and choose New Session Bean, New Message-Driven Bean, or New Entity Bean. A bean representation appears in the EJB Designer along with an inspector. Use the bean's inspector to set and change property values.

Add fields and methods to a bean by right-clicking the top of a bean representation in the EJB Designer and choosing Add New Field and Add New Method. Each field and method of a bean also has an inspector. Click a field or method element in the bean to display its inspector. To complete a method, go your source code and write the appropriate logic.

As you work with the EJB Designer and its context menus and inspectors, the bean classes, interfaces, and deployment descriptors are being generated for you. You can modify your code directly in the code editor. The bean representation in the EJB Designer and your code remain synchronized.

EJB Designer pane menus

Right-clicking the EJB Designer panel displays a menu with these commands:

Command Description
Import Schema From ... Displays a submenu with a single Database command on it. Selecting Database displays a Database Schema Provider dialog box that allows you to specify the data source you want to import into the structure pane of the EJB Designer.
New Entity Bean Creates a entity bean representation in the EJB Designer and generates the bean class and interfaces for an entity bean. The generated classes appear in the project pane.
New Session Bean Creates a session bean representation in the EJB Designer and generates the bean class and interfaces for session bean. The generated classes appear in the project pane.
New Message-Driven Bean Creates a message-driven bean representation in the EJB Designer and generates the bean class for a message-driven bean. The generated classe appear in the project pane.
Remove Selected EJBs Removes all enterprise beans you have selected in the EJB Designer and removes their generated classes from the project. You can select multiple beans by Ctrl-clicking each one or by clicking and dragging a selection rectangle around the ones you want.

Right-clicking a bean representation in the EJB Designer displays a menu with these commands:

Command Description
Import Schema From ... Displays a submenu with a single Database command on it. Selecting Database displays a Database Schema Provider dialog box that allows you to specify the data source you want to import into the structure pane of the EJB Designer.
New Entity Bean Creates a entity bean representation in the EJB Designer and generates the bean class and interfaces for an entity bean. The generated classes appear in the project pane.
New Session Bean Creates a session bean representation in the EJB Designer and generates the bean class and interfaces for session bean. The generated classes appear in the project pane.
New Message-Driven Bean Creates a message-driven bean representation in the EJB Designer and generates the bean class for a message-driven bean. The generated classe appear in the project pane.
Remove Selected EJBs Removes all enterprise beans you have selected in the EJB Designer and removes their generated classes from the project. You can select multiple beans by Ctrl-clicking each one or by clicking and dragging a selection rectangle around the ones you want.
View Bean Source Displays the source code for the selected bean. You can edit directly in the source code.
Open DD Editor Displays the deployment description information for the selected bean in the Deployment Descriptor editor. You can modify this information using the Deployment Descriptor editor.
Add New Field Adds a new field to the bean and displays its field inspector.
Add New Method Adds a new method to the bean and displays its the method inspector.
Add New Finder Adds a new finder method to the bean and displays its finder inspector.
Add New Select Adds ejbSelect method to the bean and displays its inspector.
Create Relationship Adds a new field to the bean with a line protruding from it. Click another bean you want to create a relationship with and the line will join the two beans. Click the new field to display the the relationship inspector and use it to modify the relationship's attributes.

Structure pane

When you are using the EJB Designer, the structure pane displays any data sources you have imported or created. To modify the schema of these data sources right-click an element in the structure pane to display a menu and choose an appropriate menu command. You can use the schemas that appear in the structure pane as the foundation of entity beans you create when you right-click a table in the schema and choose Create Entity Bean.

Right-clicking the top DataSources node in the structure pane displays a menu with these commands:

Command Description
Import Schema From ... Displays a submenu with a single Database command on it. Selecting Database displays a Database Schema Provider dialog box that allows you to specify the data source you want to import into the structure pane of the EJB Designer.
Add DataSource Adds a new DataSource node. Right-click the new node to display a menu with commands to add tables or modify properties.

Right-clicking a data source node in the structure pane displays a menu with these commands:

Command Description
Export Schema To ... Displays a submenu with a single Complete SQL DLL command on it. Selecting this command displays a Save DDL dialog box that allows you to save the schema you have created to a SQL Data Definition Language file. You can then use this file to create a data source that uses the schema you modified or created.
Edit DataSource Properties Displays a dialog box you can use to edit the properties that establish a connection to a data source.
Add Table Creates a new table node in the data source.
Rename Renames the data source. Enter the new name in the structure pane.
Delete Deletes the data source from the schema.

Right-clicking a table node in the structure pane displays a menu with these commands:

Command Description
Create Entity Bean Creates an entity bean using the schema of the table for the bean. Choose this command when you are satisfied with your schema and are ready to use it to create an entity bean.
Add Column Adds a column to the table.
Edit Table CMP Properties... Displays a dialog box you can use to modify the settings of Borland-specific CMP properties for the table.
Rename Renames the table. Enter the new name in the structure pane.
Delete Deletes the table from the schema.

Right-clicking a column node in the structure pane displays a menu with these commands:

Command Description
Edit Column Properties... Displays a dialog box you can usse to modify the properties of the column.
Edit Column CMP Properties Displays a dialog box you can use to modify Borland-specific CMP properties of the column.
Rename Renames the column. Enter the new name in the structure pane.
Delete Deletes the column from the schema.