CMP 1.1 Deployment Settings
The Deployment Settings dialog box allows you to specify the deployment
settings for entity beans with version 1.1 of
container-managed persistence.
Note: For versions of the J2EE SDK later than 1.2.1, you should
use container-managed persistence version 2.0.
To enter deployment settings do the following:
-
In the Database JNDI Name field, enter the JNDI name of
the database that will store the state of the entity bean.
-
If the DBMS requires a user name and password for a connection,
enter them in the User Name and Password fields.
(If you are using the Cloudscape DBMS shipped with this release,
leave these fields empty.)
-
If you want the database table to be created automatically
during deployment, select the checkbox labelled "Create table
on deploy."
The table name will be the name of the entity bean class
plus the word Table, enclosed in quotes. For example,
for the AccountEJB class, the "AccountEJBTable" name
is used. Note that the quotes are part of the table name.
-
If you want the database table to be deleted automatically
when the application is undeployed, select the checkbox
labelled "Delete table
on undeploy."
-
Make sure the DBMS server is running and
click the Generate SQL Now button.
The tool generates the SQL statements for
the entity bean's methods.
-
Enter the WHERE clause for every finder method
except for the findByPrimaryKey method.
To enter the WHERE clause, choose the method from the
EJB Method list and
append the clause to the SELECT statement displayed
in the SQL Statement field.
To indicate an input parameter in the WHERE clause,
use ?1 for the first parameter, ?2 for the second, and
so forth. For example, for the
findByRange(double low, double high) method, the SELECT statement
might be:
SELECT "productid" FROM "ProductEJBTable"
WHERE "price " BETWEEN ?1 AND ?2
-
You may alter any of the generated SQL statements by choosing
a method from the EJB Method list and entering text in the SQL
Statement field.
By default, quotes are placed around
the names of tables, columns, and contraints.
These quotes are part of the names.
Copyright 1999-2001 Sun
Microsystems,
Inc. All Rights Reserved.