Deployment Descriptors


The deployment descriptor has the name ejb-jar.xml . The XML tags in the deployment descriptor specify the following information for an entity EJB:

  • EJB name

  • EJB home interface

  • EJB remote interface

  • EJB class

  • Persistence type

  • CMP Fields

  • Primary key

  • Query methods

The following sections provide the definition and usage for each of these XML tags.

EJB Name Tag

The EJB name is the unique name that identifies the EJB. This is the name that is used by the client to locate the entity EJB through the Java Naming and Directory Interface (JNDI).

The session bean client must look up the home interface of the entity EJB using JNDI. This name is specified in the deployment descriptor file and is bound to the corresponding home interface by WebLogic Server in the JNDI tree during deployment of the EJB.

The XML tag for the EJB name is

 
 <ejb-name>  EntityBeanEJB  </ejb-name> 

Additional XML Tags in the Deployment Descriptor

In addition to the EJB name, the deployment descriptor specifies the names of the home interface, remote interface, EJB class, and persistence type. In the case of a CMP entity bean, the container-managed fields are also specified. A brief description of the XML tags with a sample of the tag follows . Examples of complete deployment descriptors are provided in "Creating the BMP Style Deployment Descriptor" and "Creating the CMP Style Deployment Descriptor" later in this chapter.

EJB Home Interface Tag

The XML tag for the EJB home interface is

 
 <home>package_name.EntityBeanHome</home> 
EJB Remote Interface Tag

The XML tag for the EJB remote interface is

 
 <remote>package_name.EntityBean</remote> 
EJB Class Tag

The XML tag for the EJB class is

 
 <ejb-class>package_name.EntityBeanEJB</ejb-class> 
Persistence Type Tag

The XML tag for the CMP persistence type is

 
 <persistence-type>Container</persistence-type> 

The XML tag for the BMP persistence type is

 
 <persistence-type>Bean</persistence-type> 
CMP Field Tags

The XML tags for the CMP fields are

 
 <cmp-field> <field-name>  field1_name  </field-name> </cmp-field> 
EJB Primary Key Field

The XML tag for the EJB primary key field is

 
 <primkey-field>  prim_key_field_name  </primkey-field> 

When using CMP, the primary key must be a cmp-field :

 
 <cmp-field> <field-name>myPrimaryKey</field-name> </cmp-field> <primkey-field>myPrimaryKey</primkey-field> 
Query Tag

The XML tag for the query is

 
 <query> <description>  brief description  </description> <query-method> <method-name>  queryMethodName  </method-name> <method-params> <method-param>  first_param_type  </method-param> <method-param>  second_param_type  </method-param> <method-params> </query-method> </query> 


BEA WebLogic Platform 7
BEA WebLogic Platform 7
ISBN: 0789727129
EAN: 2147483647
Year: 2003
Pages: 360

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net