Jonas Database Mapping (Specific Deployment Descriptor) - Red Hat APPLICATION SERVER - JONAS Manual

Jonas
Hide thumbs Also See for APPLICATION SERVER - JONAS:
Table of Contents

Advertisement

Chapter 8. Developing Entity Beans
# mappers for entity CMP2
mapper.names
8.11. JOnAS Database Mapping (Specific Deployment Descriptor)
You can specify the mapping to the database of Entity Beans and their relationships in the
JOnAS-specific deployment descriptor, in
elements. Since JOnAS is able to generate the database mapping, all the elements of the
JOnAS-specific deployment descriptor defined in this section (which are sub-elements of
or
jonas-entity
jonas-ejb-relation
and the initialization mode (that is, the
values of these mapping elements, provided in this section, define the JOnAS-generated database
mapping.
8.11.1. Specifying and Initializing the Database
To specify the database within which a CMP 2.0 Entity Bean is stored, use the
of the
jdbc-mapping
the Entity Bean.
jdbc-mapping
jndi-name jdbc_1 /jndi-name
/jdbc-mapping
For a CMP 2.0 Entity Bean, the JOnAS-specific deployment descriptor contains an additional element,
, to be specified before the
cleanup
the following values:
removedata
At bean loading time, delete the content of the tables storing the bean data
removeall
At bean loading time, drop the tables storing the bean data (if they exist) and re-create them
none
Do nothing
create
Default value (if the element is not specified). At bean loading time, create the tables for storing
the bean data (if they do not exist).
It may be useful for testing purposes to delete the database data each time a bean is loaded. To do
this, the part of the JOnAS-specific deployment descriptor related to the Entity Bean may look like
the following:
cleanup removedata /cleanup
jdbc-mapping
jndi-name jdbc_1 /jndi-name
/jdbc-mapping
rdb.oracle,rdb.postgres
jonas-entity
jndi-name
. This is the JNDI name of the DataSource representing the database storing
jdbc-mapping
elements, and in
) are optional, except those for specifying the datasource
of
jdbc-mapping
element. The
jonas-ejb-relation
and
). The default
cleanup
jndi-name
element can have one of
cleanup
97
element

Advertisement

Table of Contents
loading

This manual is also suitable for:

Application server

Table of Contents