Skip Headers

# Working With the ejb-jar.xml File

Previous

Next

For TopLink Workbench relational projects that use EJB 2.0 CMP, use the `ejb-jar.xml` file to store persistence information for the application server. With TopLink Workbench, you can import information from an existing `ejb-jar.xml` file into your project, or you can create and update the `ejb-jar.xml` file from your project.

Each TopLink Workbench project uses a single `ejb-jar.xml` file. For each entity bean in the file, you should have an EJB descriptor in the project. All entity beans must use the same persistence type.

As you make changes in your project, you can update the `ejb-jar.xml` file to reflect your project. Additionally, if you edit the `ejb-jar.xml` file outside TopLink Workbench, you can update your project to reflect the current file.

Table: ejb-jar.xml Fields and TopLink Workbench describes how fields in the `ejb-jar.xml` file correspond to specific functions in TopLink Workbench.

ejb-jar.xml Fields and TopLink Workbench

ejb-jar.xml Fields | TopLink Workbench
--- | ---
`primkey` | Bean attribute mapped to the primary key in the database table (see "Configuring Primary Keys").
`ejb-name, prim-key-class, local, local-home, remote, home, and ejb-class` | EJB descriptor information on the EJB Info tab (see "Configuring a Descriptor With EJB Information").
`abstract-schema-name` | Descriptor Alias field (see "Configuring Descriptor Alias").
`cmp-field` | Direct (non-relationship) attributes on the Descriptor Info tab (see "Configuring Common Descriptor Options").
`cmp-version` | Persistence Type field on the General tab (see "Configuring Persistence Type"). The `persistence-type` is set to `container.`
`query` | Queries listed in Queries tab (see "Configuring Named Queries at the Descriptor Level"). Note: The `findByPrimaryKey` query is not in the `ejb-jar.xml` file as per the EJB 2.0 specification.
`relationships` | One-to-one, one-to-many, and many-to-many mappings (see Relational Mappings).

See Also

  Writing to the ejb-jar.xml File
  Reading From the ejb-jar.xml File
  Working With Projects