Generating a top-down mapping
To generate a top-down mapping between enterprise beans and database
tables, you can generate a default schema and mapping from one or more existing
enterprise beans.
To generate a top-down mapping, run the ejbdeploy command
as follows:
Example
ejbdeploy input_JAR_name working_directory
output_JAR_name [
-cp classpath] [
-codegen][
-bindear:"options"]
[
-dbname name] [
-dbschema name]
[
-dbvendor name][
-debug][
-keep][
-ignoreErrors][
-quiet][
-nowarn][
-noinform][
-rmic "options"][
-35] [
-40]
[
-trace][
-sqlj]
Note:
- The -dbschema, -dbname, -dbvendor, -35, and -40 options are only
used when creating a database definition in the top-down mode of operation.
The database information is then saved in the schema document in the JAR or
EAR file, which means that the options do not need to be specified again.
It also means that when a JAR or EAR is generated, the correct database must
be defined at that point because it cannot be changed later.
- You can have only one backend defined this way (contrast to line 5 above).
If the JAR file already contains a DB2 backend, and you specify -dbvendor
ORACLE on the command line, rather than get a second backend, the dbvendor
specification is ignored.
- For CMP entity beans, the EJB deployment tool looks in the JAR or EAR
file for an existing schema and map to use when generating deployment code.
If no existing schema and map are found, a schema and map are created using
improved top-down mapping rules. If you want to use the same top-down mapping
rules for CMP entity beans that are used in the EJB deployment tool provided
with WebSphere Application Server, Version 3.5, then specify the -35 option.
This may be desirable in some situations. However, if you do not specify the
-35 option, a form of top-down mapping is used that is an improvement over
what has previously been available. Similarly for the -40 option. (In the
top-down mapping approach, you already have existing enterprise beans and
their design determines the database design. You generate a schema and map
and the generated schema contains one table for each entity bean with container-managed
persistence. In these tables, each column corresponds to a CMP field of the
enterprise bean, and the generated mapping maps the field to the column.)
For more information on the options used with the ejbdeploy command,
see the related reference The
ejbdeploy command..
Searchable topic ID:
tetdmap
Last updated: Jun 21, 2007 11:00:49 PM CDT
http://publib.boulder.ibm.com/infocenter/ws51help/index.jsp?topic=/