Skip Headers

# Configuring Persistence Type

Previous

Next

You can configure your project persistence type only when using TopLink Workbench.

Using TopLink Workbench, you can specify the persistence type to use with the project. For example, your TopLink project may use plain Java objects, entity beans with container-managed persistence, or entity beans with bean-managed persistence (BMP).

Table: Project Support for Persistence Type summarizes which projects support a persistence type configuration.

Project Support for Persistence Type

Descriptor | Using TopLink Workbench | Using Java
--- | --- | ---
Relational Projects |  |
EIS Projects |  |
XML Projects |  |

To create a TopLink descriptor for a persistent class, TopLink Workbench reads a compiled Java `.class` file to read its attributes and relationships. See "Descriptors" for more information on TopLink descriptors.

For EJB projects, you can specify an `ejb-jar.xml` file from which TopLink will read and to which it will write the necessary persistence information. You use the `ejb-jar.xml` file to map the virtual fields of the entity beans with container-managed persistence (called container-managed fields, defined by `<cmp-field>` tag) or relationships (called container-managed relationship, defined by `<cmr-field>` tag) to a data source.

TopLink Workbench defines all descriptors for entity classes (as defined in the `ejb-jar.xml` file) as EJB descriptors. TopLink Workbench does not create (or remove) descriptors for the interfaces and primary key class for the entity when refreshing from the `ejb-jar.xml` file.

Note: TopLink Workbench creates class descriptors for entity classes not defined in the `ejb-jar.xml` file. You must manually change the descriptor type (see "Configuring a Descriptor With EJB Information").

To update your project from the XML file, right-click an EJB descriptor and select Update Descriptors from ejb-jar.xml. You can also update the project by choosing Selected > Update Descriptors from ebj-jar.xml from the menu.

For more information on creating and using deployment files such as the `ejb-jar.xml` file, see the following:

- "Understanding TopLink Deployment File Creation"

- Integrating TopLink With an Application Server

- Packaging a TopLink Application

- Deploying a TopLink Application