Tools Guide



Chapter 9   Deployment Plan Designer

You use the SilverStream Deployment Plan Designer to perform all of the tasks associated with deploying Enterprise JavaBeans (EJBs).

NOTE   The deployment plan replaces the concept of the deployed JAR. Deployed JARs will continue to run in SilverStream as is. However, if you want to edit the deployment information for an existing deployed JAR, you first need to convert the JAR to a deployment plan. To do this, right-click the JAR in the SilverStream Designer and choose Convert to EJB JAR Deployment Plan. This will create a new deployment plan, leaving the old deployed JAR unchanged.

This page describes how to use the SilverStream Deployment Plan Designer. It includes the following topics:

About the Deployment Plan Designer   Top of page

SilverStream's Deployment Plan Designer allows you to:

Specifying deployment information for the EJB JAR   Top of page

Enabling the deployment

To enable the EJB deployment:

  1. Choose the Enterprise JavaBeans icon.

  2. Open the Property Inspector.

  3. Set the Enabled property to True.

You can only deploy an EJB JAR in the enabled state if the deployment information is complete. If the deployment information is not complete, SilverStream saves the deployment plan, but does not enable the JAR.

Mapping roles

To map security roles:

When the Deployment Descriptor defines roles, the Deployment Plan Designer displays those roles.

  1. Highlight a role and open the Property Inspector.

  2. In the Property Inspector, choose the ... button to open the Identity property dialog.

  3. In the Identity property dialog, open the appropriate security domain by clicking its + icon.

  4. Select the user or group you want from within the security domain and choose OK.

  5. Repeat this process for each of the displayed security roles.

  6. Close the Property Inspector.

Accessing classes in other JAR files

Sometimes the classes in JAR files include references to classes that reside in one (or more) other JAR files. In these situations, you must provide the class-path to the referenced JAR files. Here's what you have to do:

To make the referenced file available to an EJB deployment plan:

  1. From the Deployment Plan Designer main window, choose File> Jar files.

  2. Choose the referenced JARs from the dialog and add them to the list.

  3. Choose OK.

Specifying deployment information for each EJB   Top of page

To specify the bean's JNDI name:

  1. Highlight the bean and open the Property Inspector.

  2. Enter a JNDI deployment name.

This is the only property that you need to specify for a session bean.

Specifying entity bean information

To provide entity bean information:

  1. Highlight the entity bean, and open the Property Inspector.

  2. Choose a database table from the Table dropdown.

  3. To specify methods that modify no fields, choose Edit methods...

  4. In the Edit methods dialog, add (or remove) methods as appropriate using the < and > buttons.

  5. Click OK when you are done.

  6. To create a lazy bean, set Delay Instantiation to True.

        For more information on lazy beans and when it is appropriate to use them, see the chapter on entity beans in the Programmer's Guide in SilverStream help.

  7. Close the Property Inspector.

Mapping entity bean fields

To map a persistent field to a column in the primary table

  1. Highlight the name of the persistent field you want to map, and open the Property Inspector.

  2. Choose the ... button to open the Database Column dialog.

  3. Select a column from the drop down list box and click OK.

  4. Close the Property Inspector.

To map complex data types:

If your deployment descriptor includes a persistent field that is a complex data type (such as an object that represents an address), the Deployment pane allows you to map the constituent fields of the complex data type to columns in the primary database table. Follow these steps to map the complex data type:

  1. Highlight the name of the persistent field you want to map.

    NOTE   Choose the constituent fields of the complex data type, not the complex data type itself. You may need to click the + icon next to the complex data type to access the constituent fields.

  1. Open the Property Inspector and choose the ... button to open the Database Column dialog.

  2. Select a column from the drop down list box and click OK.

  3. Repeat these steps for each of the object's constituent fields.

To map persistent fields to columns in a related table:

  1. Highlight the name of the persistent field you want to map, and open the Property Inspector.

  2. Choose the ... button to open the Database Column dialog.

  3. Open the related table by clicking the + icon next to its name.

  4. Select the database column and click OK.

  5. Close the Property Inspector.

Mapping finder methods

You can map your finder methods to a SilverStream expression or a method.

To define expression-style finder methods:

  1. Highlight the name of the finder method you want to map, and open the Property Inspector.

  2. Make sure the Type is set to Expression.

  3. Choose the ... button to open the Expression Builder to define the Where clause.

  4. Create the appropriate expression and click OK.

  5. Close the Property Inspector.

About method-style finders

You can specify a method-style finder when an expression is not sufficient to define the Where clause for the bean. There are two ways that the method-style finder might be defined:

To define method-style finder methods:

  1. Highlight the name of the finder method you want to map, and open the Property Inspector.

  2. Make sure the Type is set to Method.

  3. Close the Property Inspector.

Mapping member variables to foreign beans

If your deployment descriptor includes a persistent field that has another bean's remote interface as its data type, the Deployment Plan Designer allows you to map the field to another bean. The Deployment Plan Designer allows you map to a single bean reference; therefore, it supports many-to-one and one-to-one relationships, but not one-to-many relationships.

To map member variables to foreign beans:

  1. Highlight the name of the persistent field that you want to map, and open the Property Inspector.

    Because a persistent field has another bean's remote interface as its data type, the Property Inspector displays the Foreign Bean field, which allows you to map the member variable to another bean instead of a table field.

  2. Choose the ... button to open the Foreign Bean dialog.

  3. Select another bean from the drop down list box and click OK.

  4. Highlight the name of each member variable in the foreign bean's primary key, and open the Property Inspector.

  5. Choose the ... button to open the Database Column dialog.

  6. Select a column from the drop down list box and click OK.

    The columns you can choose from are columns associated with the table for the bean for which you're specifying deployment information (not the table for the foreign bean). Bean references allow for read/write access. Therefore, if you set the the foreign bean reference to point to a bean other than the one originally loaded, SilverStream writes the new bean reference to the database.

  7. Close the Property Inspector.

NOTE   To map a member variable to a foreign bean, you need to have the foreign bean in the EJB JAR you are deploying.






Copyright © 2000, SilverStream Software, Inc. All rights reserved.