Java Reference
In-Depth Information
The chapter is about converting an EJB 2 entity to EJB 3.0. We are not migrating,
which would have involved taking sections of the EJB 2 entity and creating the
corresponding EJB 3 entity. We are converting using an XSLT transformation and we
need to modify slightly the starting deployment descriptor ejb-jar.xml . The EJB
2.0 entity ejb-jar.xml deployment descriptor does not include enough information
to generate an EJB 3.0 entity from. Modify the ejb-jar.xml deployment descriptor
for the example entity to include elements for the table name, field type, and EJB
QL query collection type for multi-entity return values. Add the <table-name/> ,
<field-type/> , and <collection-type/> elements to ejb-jar.xml . The modified
ejb-jar.xml deployment descriptor for the example entity bean is as follows:
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<entity>
<table-name>Catalog</table-name>
<ejb-name>Catalog</ejb-name>
<local-home>CatalogHome</local-home>
<local>Catalog</local>
<ejb-class>CatalogBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>CatalogPK</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>CatalogBean</abstract-schema-name>
<cmp-field>
<field-name>catalogId</field-name>
<field-type>String</field-type>
</cmp-field>
<cmp-field>
<field-name>journal</field-name>
<field-type>String</field-type>
</cmp-field>
<cmp-field>
<field-name>publisher</field-name>
<field-type>String</field-type>
</cmp-field>
<primkey-field>catalogId</primkey-field>
<query>
<query-method>
 
Search WWH ::




Custom Search