With WebLogic Workshop you can easily create a container-managed persistence
entity bean from a table in a database. The database must be available
from the domain you are using. To examine the datasources beforehand, go
to the
Tools menu and choose WebLogic
Server-->Data Viewer.
To generate a CMP entity bean from a database table, you
must have an EJB Project. For more information, see How
Do I Create an EJB Project?
To Generate an Entity Bean from a Database Table
- Make sure WebLogic Server is started.
- In the Application pane, right-click the EJB project
and choose New-->Entity
bean from database table. The select a datasource... dialog
appears.
- Select the datasource containing the table you want to use from the left-hand
panel, verify the connection settings in the read-only right-hand panel,
and click Next.
The select a table... dialog appears.
- Select the table from the left-hand panel. Its columns will
be displayed in the right-hand panel. Click Next.
- Select the table's columns to include in the entity bean. Click Next.
- Enter a bean name and package name. Click Finish to generate the bean.
Note. If you have configured your
server to use com.pointbase.xa.xaDataSource as
your JDBC driver, you will have to add the attribute SupportsLocalTransaction="true" to
the JDBCConnectionPool element in your domain's
config.xml file.
Related Topics
How Do I: Create an Enterprise JavaBean?
Developing Enterprise JavaBeans