Entity

The Entity tabbed pane allows you to edit the settings of an entity bean.

  1. Choose the type of management for your entity bean, either or , by selecting the appropriate radio button.

    Because version 2.0 of container-managed persistence supports relationships, you should select it instead of version 1.1. (Version 1.1 is offered only to maintain forward compatibility with applications created with version 1.2 of the J2EE SDK.)

    If you selected bean-managed persistence, you should skip the following steps, except for those regarding the Primary Key Class field and the Reentrant checkbox.

  2. In the Fields To Be Persisted area, check the boxes next to the instance fields that the container will save in the data store. These fields must be either primitive types, Serializable objects, or Remote reference types.
  3. In the Abstract Schema Name field enter the name of the entity bean's . This name may be referenced in an statement.
  4. To specify the bean's queries, click Finder/Select Methods.
  5. To define the bean's relationships with other entity beans, select the bean's EJB Jar in the DeployTool file view (to the left in the primary window) and select the Relationships tab.
  6. To further specify the bean's persistence, click Deployment Settings.
  7. In the Primary Key Class field, enter the class of the entity bean's . For example, if the data contained in your primary key field is of type String, enter java.lang.String in the Primary Key Class field.
  8. Select a variable name from the combo box labelled Primary Key Field Name.
  9. If you want your entity bean to be select the Reentrant checkbox. If your entity bean does not need callbacks, keep the default setting of .


Copyright 1999-2001 Sun Microsystems, Inc. All Rights Reserved.