Skip to Main Content
Enterprise JavaBeans, Fourth Edition
book

Enterprise JavaBeans, Fourth Edition

by Sacha Labourey, Bill Burke, Richard Monson-Haefel
June 2004
Intermediate to advanced content levelIntermediate to advanced
792 pages
23h 17m
English
O'Reilly Media, Inc.
Content preview from Enterprise JavaBeans, Fourth Edition

The Deployment Descriptor

With a complete definition of the Ship EJB, including the remote interface, remote home interface, and primary key, we are ready to create a deployment descriptor. XML deployment descriptors for bean-managed entity beans are a little different from the descriptors we created for the container-managed entity beans in Chapter 6 and Chapter 7. In this deployment descriptor, the <persistence-type> is Bean and there are no <container-managed> or <relationship-field> declarations. We also must declare the DataSource resource factory that we use to query and update the database.

Here is the deployment descriptor for EJB 2.1:

<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1"> <enterprise-beans> <entity> <description> This bean represents a cruise ship. </description> <ejb-name>ShipEJB</ejb-name> <home>com.titan.ship.ShipHomeRemote</home> <remote>com.titan.ship.ShipRemote</remote> <ejb-class>com.titan.ship.ShipBean</ejb-class> <persistence-type>Bean</persistence-type> <prim-key-class>java.lang.Integer</prim-key-class> <reentrant>False</reentrant> <security-identity><use-caller-identity/></security-identity> <resource-ref> <description>DataSource for the Titan database</description> <res-ref-name>jdbc/titanDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Enterprise JavaBeans, Third Edition

Enterprise JavaBeans, Third Edition

Richard Monson-Haefel
Enterprise JavaBeans 3.1, 6th Edition

Enterprise JavaBeans 3.1, 6th Edition

Andrew Lee Rubinger, Bill Burke
Enterprise JavaBeans 3.0, 5th Edition

Enterprise JavaBeans 3.0, 5th Edition

Richard Monson-Haefel, Bill Burke

Publisher Resources

ISBN: 059600530XSupplemental ContentCatalog PageErrata