C M P 2 . 0
is declared, the other must also be declared. The read only and read time out elements are
described in Chapte 4 of the JBossCMP Documentation.
R e l a t i o n s h i p R o l e M a p p i n g
Each of the two ejb relationship role elements contains mapping information specific to an
entity in the relationship. A detailed description of the main elements follows:
Table 9 3, ejb relationship role Tags
Tag Name
Description
Required
ejb relationship role This is the name of the role to which this configuration Yes
name
applies. This element must match the name of one of
the roles declared for this query in the ejb jar.xml file.
fk constraint
If true, JBossCMP will add a foreign key constraint to
No, default is
the tables. JBossCMP will only add the constraint if
false
both the primary table and the related table were
created by JBossCMP during deployment.
key fields
This specifies the mapping of the primary key fields of
No, default
the current entity. This element is only necessary if
depends on
exact field mapping is desired. Otherwise, the key fields mapping type
element must
4
contain a key field element for each
primary key field of the current entity. The details of
this element are described below.
read ahead
This controls the caching of this relationship. This
No, see Chapter
option is discussed in Chapter 6 of the JBossCMP
6 of the
Documentation.
JBossCMP
Documentation.
As noted in Table 9 3 the key fields element contains a key field for each primary key field of
the current entity. The key field element uses the same syntax as the cmp field element of
the entity, except that key field does not support the not null option. Key fields of a
relation table are automatically not null, because they are the primary key of the table. On
4
Note that with foreign key mapping this element can be empty; this means that there will be not be a foreign key for the current entity.
This is required for the many side of a one to many relationship, such a Gangster in the Organization Gangster example.
91
footer
Our partners:
PHP: Hypertext Preprocessor Cheap Web Hosting
JSP Web Hosting
Ontario Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Java Hosting
Cheapest Hosting
Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved