uCosminexus Application Server, Application Setup Guide

[Contents][Index][Back][Next]

9.6.1 CMP settings

Organization of this subsection
(1) Attribute file to be edited
(2) Acquiring the attribute file to be edited and setting the attributes
(3) Attribute settings to be edited

(1) Attribute file to be edited

Entity Bean attribute file

(2) Acquiring the attribute file to be edited and setting the attributes

Acquiring the attribute file

Execute the following command to acquire an Entity Bean attribute file:

Execution format
 
cjgetappprop [server-name] [-nameserver provider-URLL] -name J2EE application-name -type ejb -resname EJB-JAR-display-name/Entity-Bean-display-name -c <path-of-the-Entity-Bean-attribute-file
 

Example of execution
cjgetappprop MyServer -name adder -type ejb -resname account/MyAccoub -c C:\home\adder_ejb.xml
 
Setting the attributes

Execute the following command to apply the values of the Entity Bean attribute file:

Execution format
 
cjsetappprop [server-name] [-nameserver provider-URL] -name J2EE application-name -type ejb -resname EJB-JAR-display-name/Entity-Bean-display-name-c path-of-the-Entity-Bean-attribute-file
 

Example of execution
cjsetappprop MyServer -name adder -type ejb -resname account/MyAccoub -c C:\home\adder_ejb.xml
 

(3) Attribute settings to be edited

The method of defining CMP differs based on whether the primary key is a single primary key or a compound primary key.

(a) Setting the attributes for a single primary key

You set the properties for a single primary key.

Check the persistence management type (<persistence-type>). In the case of CMP Entity Bean, 'Container' is set.

The following table describes the property settings for a single primary key:

Items Mandatory Corresponding tags
Primary key class#1 Y <prim-key-class>
Scope of reentrant Y <reentrant>
Description of the persistence management field O <cmp-field> - <description>
Field name of the persistence management field#2 O <cmp-field> - <field-name>
Field name of the primary key field O <primkey-field>

Legend:
Y: Mandatory
O: Optional

#1
Enter a class or interface that contains the primary key of this Entity Bean. The primary key class must be either a java.lang.Object class or a class or an interface in the same container-managed field.

#2
Normally, the field name is not required. If you want to add a field name, the field name also needs to be added in the class definition of the Entity Bean beforehand.

For details on the property settings, see 3.5.1 Contents of the Entity Bean property file in the uCosminexus Application Server Application and Resource Definition Reference Guide.

(b) Setting the attributes for a compound primary key

You set the properties for a compound primary key.

Check the persistence management type (<persistence-type>). In the case of a CMP Entity Bean, 'Container' is set.

The following table describes the property settings for a compound primary key:

Items Mandatory Corresponding tags
Primary key class#1 Y <prim-key-class>
Scope of reentrant Y <reentrant>
Description of the persistence management field O <cmp-field> - <description>
Field name of the persistence management field#2 O <cmp-field> - <field-name>

Legend:
Y: Mandatory
O: Optional

#1
Enter a class or an interface that contains the primary key of this Entity Bean. The primary key class must be either a java.lang.Object class or a class or an interface in the same container-managed field.

#2
Normally, the field name is not required.
If you want to add a field name, the field name also needs to be added in the class definition of the Entity Bean beforehand.

For details on the property settings, see 3.5.1 Contents of the Entity Bean property file in the uCosminexus Application Server Application and Resource Definition Reference Guide.