Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Enterprise JavaBeans™ Specification, Version 2.0 - Sun Microsystems.pdf
Скачиваний:
14
Добавлен:
24.05.2014
Размер:
2.71 Mб
Скачать

Sun Microsystems Inc

EJB 1.1 Entity beans with container-managed persistenceEnterprise JavaBeans 2.0, Public Draft EJB 1.1 Entity Bean Component Con-

The entity Bean Provider can rely on the container’s having loaded the container-managed fields from the database just before the container invokes the ejbLoad() method. The entity bean can use the ejbLoad() method, for instance, to perform some computation on the values of the fields that were read by the container (for example, uncompressing text fields).

13.1.5 ejbStore

When the container needs to synchronize the state of the entity object in the database with the state of the enterprise bean instance, the container first calls the ejbStore() method on the instance, and then it extracts the container-managed fields and writes them to the database.

The entity Bean Provider should use the ejbStore() method to set up the values of the con- tainer-managed fields just before the container writes them to the database. For example, the ejbStore() method may perform compression of text before the text is stored in the database.

13.1.6 finder methods

The entity Bean Provider does not write the finder ( ejbFind<METHOD>(...)) methods.

The finder methods are generated at the entity bean deployment time using the container provider’s tools. The tools can, for example, create a subclass of the entity bean class that implements the ejbFind<METHOD>() methods, or the tools can generate the implementation of the finder methods directly in the class that implements the entity bean’s home interface.

Note that the ejbFind<METHOD> names and parameter signatures of EJB 1.1 entity beans do not provide the container tools with sufficient information for automatically generating the implementation of the finder methods for methods other than ejbFindByPrimaryKey. Therefore, the bean provider is responsible for providing a description of each finder method. The entity bean Deployer uses container tools to generate the implementation of the finder methods based in the description supplied by the bean provider.

The EJB1.1 component contract for container managed persistence does not specify the format of the finder method description. A Bean Provider of entity beans that needs this functionality should use the container managed persistence contract specified in Chapter 9 of this specification instead.

13.1.7 home methods

The EJB1.1 entity bean contract does not support ejbHome methods. A Bean Provider of entity beans that need the home method functionality should use the container managed persistence contracts specified in Chapter 9 of this specification instead.

13.1.8 create methods

The EJB1.1 entity bean contract does not support create<METHOD> methods. A Bean Provider of entity beans that needs the flexibility in method naming that create<METHOD> methods provide should use the container managed persistence contracts specified in Chapter 9 of this specification instead.

265

5/31/00