user manual

142 BES Developers Guide
Setting Properties
Container-managed field names
The Borland Container has changed the container-managed persistent field
names so that they are more Java friendly. SQL column names often prepend
a shortened form of the table name, followed by an underscore, to each
column name. For example, in the address table, there is a column for the city
called addr_city. The full reference to this column is address.addr_city. With the
Borland Container, this maps to the Java field Address.city, rather than the
more redundant and more awkward Address.addr_city.
You can achieve this Java-friendly column-to-field-name mapping using the
deployment descriptor. While this section shows you how to manually edit the
deployment descriptor, it is best to use the Deployment Descriptor Editor GUI
to accomplish this. See the Management Console Users Guide, Using the
Deployment Descriptor Editor section for instructions on using the GUI
screens.
Should you choose to manually edit the deployment descriptor, use the <env-
entry-name>, <env-entry-type>, and <env-entry-value> subtags within the <env-
entry> tag. Place the more friendly Java field name in the <env-entry-name> tag,
noting that it is referencing a JDBC column. Put the type of the field in the
<env-entry-type> tag. Lastly, place the actual SQL column name in the <env-
entry-value> tag. The following deployment descriptor code segment illustrates
this:
<env-entry>
<env-entry-name>ejb.cmp.jdbc.column:city</env-entry-name>
<env-entry-type>String</env-entry-type>
<env-entry-value>addr_city</env-entry-value>
</env-entry>
Setting Properties
Most properties for Enterprise JavaBeans can be set in their deployment
descriptors. The Borland Deployment Descriptor Editor (DDEditor) also allows
you to set properties and edit descriptor files. Use of the Deployment
Descriptor Editor is described in the Borland Enterprise Server User's Guide.
Use properties in the deployment descriptor to specify information about the
entity bean's interfaces, transaction attributes, and so forth, plus information
that is unique to an entity bean. In addition to the general descriptor
information for entity beans, here are also three sets of properties that can be
set to customize CMP implementations, entity properties, table properties, and
column properties. Entity properties can be set either by the EJB Designer
Tab in the Deployment Descriptor Editor or in the XML directly.
Using the Deployment Descriptor Editor
You can use the Deployment Descriptor Editor, which is part of the Borland
Enterprise Server AppServer Edition, to set up all of the container-managed
persistence information. You should refer to the Borland Enterprise Server