Hitachi

uCosminexus Application Server Application Setup Guide


9.6.2 Mapping CMP1.x and the database

This section explains the mapping of the fields of a CMP1.x Entity Bean to a table in the database.

Organization of this subsection

(1) Attribute file to be edited

Entity Bean attribute file

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

(3) Attribute settings to be edited

The following table describes the property settings for mapping the fields of CMP1.x Entity Bean to a table in the database (<cmp-map>):

Items

Mandatory

Corresponding tags

Display name of the resource adapter

Y

<datasource-name>

Catalog name of the database

O

<catalog-name>

Schema name of the database

O

<schema-name>

Table name of the database

Y

<table-name>

Permission or prohibition of writing to the database

Y

<read-only-access>

Transaction isolation level#1

O

<transaction-isolation>

Method of comparing the data by writing to the database

O

<concurrency-protection>

Information of mapping between the field and the table column#2

Y

<field-impl>

Search conditions of the finder method#3

Y

<finder-impl>

Legend:

Y: Mandatory

O: Optional

#1

The value of the transaction isolation level (<transaction-isolation>) that can be used differs based on the options supported in the database and the JDBC driver.

#2

Set a column of the database table for the primary key. This column is also used for mapping the fields of the same database table.

The value of the field name of the EntityBean (<field-name>) cannot be changed. Set a database column (<column-name>) for mapping the field name of the Entity Bean (<field-name>).

The information about the mapping between the fields and the table column (<field-impl>) consists of the following:

Items

Corresponding tags

Field name of the EntityBean

<field-name>

Column name of the table

<column-name>

#3

The value of the method name (<method-name>) of the finder method cannot be changed. Set the search condition (<where-clause>) for the method name table (<method-name>) in the finder method.

The finder method information in the Enterprise Bean (<finder-impl>) consists of the following:

Items

Corresponding tags

Method name of the finder method

<method-name>

Search condition for the table

<where-clause>

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

(4) Notes