You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by km...@apache.org on 2011/06/11 23:33:39 UTC
svn commit: r1134776 [2/26] - in /openejb/trunk/website/html/old-site: ./
html/ html/images/ html/spec/ images/
Added: openejb/trunk/website/html/old-site/html/cmp-mapping.html
URL: http://svn.apache.org/viewvc/openejb/trunk/website/html/old-site/html/cmp-mapping.html?rev=1134776&view=auto
==============================================================================
--- openejb/trunk/website/html/old-site/html/cmp-mapping.html (added)
+++ openejb/trunk/website/html/old-site/html/cmp-mapping.html Sat Jun 11 21:33:33 2011
@@ -0,0 +1,526 @@
+<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>OpenEJB CMP Mapping</title><link href="default.css" rel="stylesheet"><link href="/images/favicon.ico" rel="SHORTCUT ICON"></head><body marginwidth="0" marginheight="0" leftmargin="0" bottommargin="0" topmargin="0" vlink="#6763a9" link="#6763a9" bgcolor="#ffffff"><a name="top"></a><table height="400" width="712" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#7270c2" align="left" valign="top" width="20"><img border="0" height="1" width="1" src="images/dotTrans.gif"></td><td bgcolor="#7270c2" align="left" valign="top" width="95"><img border="0" height="1" width="1" src="images/dotTrans.gif"></td><td align="left" valign="top" width="7"><img height="1" width="1" border="0" src="images/dotTrans.gif"></td><td align="left" valign="top" width="40"><img border="0" height="6" width="40" src="images/dotTrans.gif"></td><td bgcolor="#5A5CB8" align="left" valign="top" width="430"><img border
="0" height="6" width="430" src="images/top_2.gif"></td><td bgcolor="#E24717" align="left" valign="top" width="120"><img src="images/top_3.gif" width="120" height="6" border="0"></td></tr><tr><td align="left" valign="top" bgcolor="#7270c2" width="20"><img height="1" width="1" border="0" src="images/dotTrans.gif"></td><td align="left" valign="top" bgcolor="#7270c2" width="95"><img height="1" width="1" border="0" src="images/dotTrans.gif"></td><td align="left" valign="top" bgcolor="#ffffff" width="7"></td><td align="left" valign="top" width="40"><img border="0" height="1" width="1" src="images/dotTrans.gif"></td><td align="left" valign="middle" width="430"><a href="faq.html"><span class="menuTopOff">[ f a q ]</span></a> <a href="http://wiki.codehaus.org/openejb"><span class="menuTopOff">[ w i k i ]</span></a> <a href="http://archive.openejb.codehaus.org/user/"><span class="menuTopOff">[ l i s t s ]</span></a>  
; <a href="http://cvs.openejb.org/"><span class="menuTopOff">[ c v s ]</span></a> <a href="http://jira.codehaus.org/secure/BrowseProject.jspa?id=10401"><span class="menuTopOff">[ b u g s ]</span></a> <br><img border="0" height="2" width="1" src="images/dotTrans.gif"></td><td align="left" valign="top" height="20" width="120"> </td></tr><tr><td align="left" valign="top" bgcolor="#7270c2" width="20"><img border="0" height="3" width="20" src="images/dotTrans.gif"></td><td align="left" valign="top" bgcolor="#7270c2" width="95"><img border="0" height="3" width="105" src="images/line_sm.gif"></td><td align="left" valign="top" bgcolor="#a9a5de" width="7"><img border="0" height="3" width="7" src="images/line_sm.gif"></td><td align="left" valign="top" width="40"><img border="0" height="3" width="40" src="images/line_light.gif"></td><td align="left" valign="top" width="430"><img border="0" height="3" width=
"430" src="images/line_light.gif"></td><td align="left" valign="top" width="120"><img height="1" width="1" border="0" src="images/dotTrans.gif"></td></tr><tr><td align="left" valign="top" bgcolor="#7270c2"><img border="0" height="10" width="20" src="images/dotTrans.gif"></td><td align="left" valign="top" bgcolor="#7270c2" width="95"><img border="0" height="2" width="1" src="images/dotTrans.gif"><br><table cellspacing="0" cellpadding="0" border="0"><tr><td align="left" valign="top"><span class="subMenuOn">Main</span></td></tr><tr><td align="left" valign="top"><a href="index.html"><span class="subMenuOff">
+ Welcome!</span></a></td></tr><tr><td align="left" valign="top"><a href="download.html"><span class="subMenuOff">
+ Download</span></a></td></tr><tr><td align="left" valign="top"><a href="lists.html"><span class="subMenuOff">
+ Mailing Lists</span></a></td></tr><tr><td align="left" valign="top"><a href="cvs.html"><span class="subMenuOff">
+ Source Code</span></a></td></tr><tr><td align="left" valign="top"><a href="contributors.html"><span class="subMenuOff">
+ The Team</span></a></td></tr><tr><td align="left" valign="top"><a href="status.html"><span class="subMenuOff">
+ Status</span></a></td></tr></table><table cellspacing="0" cellpadding="0" border="0"><tr><td align="left" valign="top"><span class="subMenuOn">Users</span></td></tr><tr><td align="left" valign="top"><a href="quickstart.html"><span class="subMenuOff">
+ Quickstart</span></a></td></tr><tr><td align="left" valign="top"><a href="hello-world.html"><span class="subMenuOff">
+ Hello World!</span></a></td></tr><tr><td align="left" valign="top"><a href="cmp_entity_postgresql.html"><span class="subMenuOff">
+ CMP Example</span></a></td></tr><tr><td align="left" valign="top"><a href="cmp_guide.html"><span class="subMenuOff">
+ CMP Guide</span></a></td></tr><tr><td align="left" valign="top"><a href="deploy.html"><span class="subMenuOff">
+ Deploy</span></a></td></tr><tr><td align="left" valign="top"><a href="start-command.html"><span class="subMenuOff">
+ Startup</span></a></td></tr><tr><td align="left" valign="top"><a href="validate.html"><span class="subMenuOff">
+ Validation</span></a></td></tr><tr><td align="left" valign="top"><a href="config_containers.html"><span class="subMenuOff">
+ Configuration</span></a></td></tr><tr><td align="left" valign="top"><a href="properties.html"><span class="subMenuOff">
+ Properties</span></a></td></tr></table><table cellspacing="0" cellpadding="0" border="0"><tr><td align="left" valign="top"><span class="subMenuOn">Servers</span></td></tr><tr><td align="left" valign="top"><a href="embedded.html"><span class="subMenuOff">
+ Local Server</span></a></td></tr><tr><td align="left" valign="top"><a href="remote-server.html"><span class="subMenuOff">
+ Remote Server</span></a></td></tr><tr><td align="left" valign="top"><a href="tomcat.html"><span class="subMenuOff">
+ Tomcat</span></a></td></tr><tr><td align="left" valign="top"><a href="geronimo.html"><span class="subMenuOff">
+ Geronimo</span></a></td></tr></table><table cellspacing="0" cellpadding="0" border="0"><tr><td align="left" valign="top"><span class="subMenuOn">Integrators</span></td></tr><tr><td align="left" valign="top"><a href="whyopenejb.html"><span class="subMenuOff">
+ Why OpenEJB</span></a></td></tr><tr><td align="left" valign="top"><a href="containersystem.html"><span class="subMenuOff">
+ Overview</span></a></td></tr><tr><td align="left" valign="top"><a href="design_openejb.html"><span class="subMenuOff">
+ Design</span></a></td></tr><tr><td align="left" valign="top"><a href="OpenEJB_presentaion.ppt"><span class="subMenuOff">
+ Presentation</span></a></td></tr></table><img border="0" height="15" width="1" src="images/dotTrans.gif"><br><img border="0" height="3" width="105" src="images/line_sm.gif"><br><A href="http://codehaus.org"><IMG alt="The Codehaus" border="0" height="17" width="88" src="http://www.openejb.org/codehaus-smaller.png"></A></td><td align="left" valign="top" bgcolor="#a9a5de" width="7"> </td><td align="left" valign="top" width="40"> </td><td valign="top" width="430" rowspan="4"><table width="430" cellspacing="0" cellpadding="0" border="0" rows="2" cols="1"><tr><td align="left" valign="top"><br><img width="200" vspace="0" src="./images/logo_ejb2.gif" hspace="0" height="55" border="0"><br><img src="images/dotTrans.gif" hspace="0" height="7" border="0"><br><span class="pageTitle">OpenEJB CMP Mapping</span><br><img src="images/dotTrans.gif" hspace="0" height="1" border="0"></td></tr></table><p></p><p></p><br><span class="toc"><a href="#Preface">Preface</a><br>
</span><span class="toc"><a href="#Introduction">Introduction</a><br></span><span class="toc"><a href="#The Mapping File">The Mapping File</a><br></span><span class="toc"><img border="0" height="1" width="15" src="images/dotTrans.gif"><a href="#The <class> element ">The <class> element </a><br></span><span class="toc"><img border="0" height="1" width="15" src="images/dotTrans.gif"><a href="#The <map-to> element">The <map-to> element</a><br></span><span class="toc"><img border="0" height="1" width="15" src="images/dotTrans.gif"><a href="#The <field> element">The <field> element</a><br></span><span class="toc"><img border="0" height="1" width="15" src="images/dotTrans.gif"><a href="#The <sql> element">The <sql> element</a><br></span><span class="toc"><a href="#Usage Pattern">Usage Pattern</a><br></span><br><a name="Preface"><h2>Preface</h2></a>
+
+ <p><span class="bodyBlack">
+ The OpenEJB CMP Container is no simple container. Unlike most CMP 1.1
+ containers, which simply generate BMP code for you and cannot handle
+ complex object-to-relational (O/R) mapping, the OpenEJB CMP Container
+ does all of that and more. It supports very complicated O/R mapping
+ and can map an entity bean across several tables and dependent objects.
+ It also supports the OMG's Object Query Language (OQL) which gives your
+ ejbFind methods added power.
+ </span></p>
+
+ <p><span class="bodyBlack">
+ All of this is done through the power of Castor JDO, a project that has been
+ developed since day one to be the most sophisticated CMP Container ever created.
+ Castor fulfills that role in spades and has become one of the most popular
+ object-to-relational and object-to-xml tools in the commercial or open source
+ world.
+ </span></p>
+
+ <p><span class="bodyBlack">This document details the full syntax of Castor's O/R mapping ability, it is
+ not for the weak of heart. For a simple introduction to OpenEJB CMP and the
+ related Castor mapping.xml files, see this wonderful doc written by Jacek Laskowski,
+ <a href="cmp_entity_postgresql.html">CMP Hello World.</a>
+ </span></p>
+
+ <p><span class="bodyBlack">OpenEJB would like to thank the whole Castor team for their great work and to
+ <a href="mailto:ferret@frii.com">Bruce Snyder</a> for writing this very thorough
+ doc on the syntax of the mapping.xml file used for entity-to-relational mapping.
+ </span></p>
+
+ <a name="Introduction"><h2>Introduction</h2></a>
+ <p><span class="bodyBlack">
+ Castor mapping files are used by the OpenEJB CMP Container to provide a mechanism
+ for binding a Java object model (an EntityBean and it's Java objects) to a
+ relational database model. This is usually referred to as object-to-relational
+ mapping (O/R mapping). O/R mapping bridges the gap between an object model and a
+ relational model.
+ </span></p>
+
+ <p><span class="bodyBlack">
+ The following is a high-level example of a mapping file:
+ </span></p>
+
+ <table width="440" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#e0e0e0"><span class="code-block"><pre>
+ <mapping>
+ <class>
+ <map-to />
+ <field>
+ <sql />
+ </field>
+ ...
+ </class>
+ </mapping>
+ </pre></span></td></tr></table>
+
+ <p><span class="bodyBlack">
+ Each EntityBean and dependent Java object is represented by a <class> element
+ composed of attributes, a <map-to> element and <field> elements. The <map-to> element
+ contains a reference to the relational table to which the EntityBean maps.
+ Each <field> element represents either a public class variable or a the
+ variable's accessor/mutator methods (depending upon the mapping info). Each
+ <field> element is composed of attributes and one <sql> element.
+ The <sql> element represents the field in the relational table to which
+ the <field> element maps.
+ </span></p>
+
+ <a name="The Mapping File"><h2>The Mapping File</h2></a>
+
+ <a name="The <class> element "><h3>The <class> element </h3></a>
+
+<table width="440" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#e0e0e0"><span class="code-block"><pre>
+<!ELEMENT class ( description?, cache-type?, map-to?, field+ )>
+<!ATTLIST class
+ name ID #REQUIRED
+ extends IDREF #IMPLIED
+ depends IDREF #IMPLIED
+ auto-complete ( true |false ) "false"
+ identity CDATA #IMPLIED
+ access ( read-only | shared | exclusive | db-locked ) "shared"
+ key-generator IDREF #IMPLIED >
+</pre></span></td></tr></table>
+
+
+ <p><span class="bodyBlack">
+ The <class> element contains all the information used to map a EntityBean
+ to a relational database. The content of <class> is mainly used to describe
+ the fields that will be mapped.
+ </span></p>
+
+ <p><span class="bodyBlack">
+ Description of the attributes:
+ </span></p>
+
+ <table cellspacing="2" cellpadding="2" border="0"><tr><td height="5" colspan="2"></td></tr><span class="bodyGrey">
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>name:</b> The fully qualified package name of the EntityBean or dependent Java object to map to.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>extends:</b> Should be used _only_ if this EntityBean or dependent Java object extends another Java
+ object for which mapping information is provided. It should _not_ be used if the
+ extended Java object is not referenced in the mapping file.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>depends:</b> For more information on this field, please see
+ <a href="http://castor.exolab.org/castor-one.html#Dependent-and-related-relationships">
+ Dependent and related relationships</a>.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>identity:</b> For more information on this field, please see
+ <a href="http://castor.exolab.org/design-persist.html#Persistence">Design -> Persistence</a>.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>access:</b> For more information on this field, please see
+ <a href="http://castor.exolab.org/locking.html#Locking-Modes">Locking Modes</a>.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>key-generator</b>: For more information on this field, please see
+ <a href="http://castor.exolab.org/key-generator.html">KeyGen</a>.</span></td></tr>
+ </span></table>
+
+ <p><span class="bodyBlack">Description of the elements:</span></p>
+
+ <table cellspacing="2" cellpadding="2" border="0"><tr><td height="5" colspan="2"></td></tr><span class="bodyGrey">
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b><description></b>: An optional description.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b><cache-type></b>: For more information on this field please see
+ <a href="http://castor.exolab.org/long-transact.html#Bounded-dirty-checking">Bounded Dirty Checking</a>
+ and <a href="http://castor.exolab.org/castor-one.html#LRU-Cache">LRU Cache</a>.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b><map-to></b>: Used to tell the CMP Container the name of the relational
+ table to which to map.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b><field></b>: Zero or more <field> elements are used to describe properties
+ of each EntityBean or dependent Java object.</span></td></tr>
+ </span></table>
+
+
+
+ <a name="The <map-to> element"><h3>The <map-to> element</h3></a>
+
+<table width="440" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#e0e0e0"><span class="code-block"><pre>
+<!ELEMENT map-to EMPTY>
+<!ATTLIST map-to
+ table NMTOKEN #IMPLIED
+ xml NMTOKEN #IMPLIED
+ ns-uri NMTOKEN #IMPLIED
+ ns-prefix NMTOKEN #IMPLIED
+ ldap-dn NMTOKEN #IMPLIED
+ ldap-oc NMTOKEN #IMPLIED>
+</pre></span></td></tr></table>
+
+ <p><span class="bodyBlack"><map-to> is used to specify the name of the item that should be associated
+ with the given EntityBean or dependent Java object. The <map-to> element is only used for the root
+ Java object.</span></p>
+
+ <p><span class="bodyBlack">Description of the attributes:</span></p>
+
+ <table cellspacing="2" cellpadding="2" border="0"><tr><td height="5" colspan="2"></td></tr><span class="bodyGrey">
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>table:</b> The name of the relational database table to which the
+ EntityBean or dependent Java object is associated.</span></td></tr>
+ </span></table>
+
+
+
+
+ <a name="The <field> element"><h3>The <field> element</h3></a>
+
+<table width="440" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#e0e0e0"><span class="code-block"><pre>
+<!ELEMENT field ( description?, sql?, xml?, ldap? )>
+<!ATTLIST field
+ name NMTOKEN #REQUIRED
+ type NMTOKEN #IMPLIED
+ required ( true | false ) "false"
+ direct ( true | false ) "false"
+ lazy ( true | false ) "false"
+ transient ( true | false ) "false"
+ get-method NMTOKEN #IMPLIED
+ set-method NMTOKEN #IMPLIED
+ create-method NMTOKEN #IMPLIED
+ collection ( array | vector | hashtable | collection | set | map ) #IMPLIED>
+</pre></span></td></tr></table>
+
+ <p><span class="bodyBlack">The <field> element is used to describe a property of a EntityBean or dependent Java object. It provides:</span></p>
+ <table cellspacing="2" cellpadding="2" border="0"><tr><td height="5" colspan="2"></td></tr><span class="bodyGrey">
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack">the object's identity ('name')</span></td></tr>
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack">the object's type (inferred from 'type' and 'collection')</span></td></tr>
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack">the object's access method (inferred from 'direct', 'get-method', 'set-method')</span></td></tr>
+ </span></table>
+
+ <p><span class="bodyBlack">From this information, the CMP Container is able to access a given property in the EntityBean or dependent Java
+ object.</span></p>
+
+ <p><span class="bodyBlack">In order to determine the signature that the CMP Container expects, there are two easy
+ rules to apply.</span></p>
+
+ <p><span class="bodyBlack"><b>1. Determine <type>.</b></span></p>
+
+ <table cellspacing="2" cellpadding="2" border="0"><tr><td height="5" colspan="2"></td></tr><span class="bodyGrey">
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><p><span class="bodyBlack"><b>If there is no 'collection' attribute</b>, the object type is the the value
+ of the 'type' attribute. The value of the type attribute can be a fully qualified Java
+ object like 'java.lang.String' or one of the allowed aliases:</span></p>
+
+ <table border="1" cellpadding="4">
+ <tr><th>short name</th><th>Primitive type?</th><th>Java Class</th></tr>
+ <tr><td><span class="bodyGrey">other</span></td><td><span class="bodyGrey">N</span></td><td><span class="bodyGrey">java.lang.Object</span></td></tr>
+ <tr><td><span class="bodyGrey">string</span></td><td><span class="bodyGrey">N</span></td><td><span class="bodyGrey">java.lang.String</span></td></tr>
+ <tr><td><span class="bodyGrey">integer</span></td><td><span class="bodyGrey">Y</span></td><td><span class="bodyGrey">java.lang.Integer.TYPE</span></td></tr>
+ <tr><td><span class="bodyGrey">long</span></td><td><span class="bodyGrey">Y</span></td><td><span class="bodyGrey">java.lang.Long.TYPE</span></td></tr>
+ <tr><td><span class="bodyGrey">boolean</span></td><td><span class="bodyGrey">Y</span></td><td><span class="bodyGrey">java.lang.Boolean.TYPE</span></td></tr>
+ <tr><td><span class="bodyGrey">double</span></td><td><span class="bodyGrey">Y</span></td><td><span class="bodyGrey">java.lang.Double.TYPE</span></td></tr>
+ <tr><td><span class="bodyGrey">float</span></td><td><span class="bodyGrey">Y</span></td><td><span class="bodyGrey">java.lang.Float.TYPE</span></td></tr>
+ <tr><td><span class="bodyGrey">big-decimal</span></td><td><span class="bodyGrey">N</span></td><td><span class="bodyGrey">java.math.BigDecimal</span></td></tr>
+ <tr><td><span class="bodyGrey">byte</span></td><td><span class="bodyGrey">Y</span></td><td><span class="bodyGrey">java.lang.Byte.TYPE</span></td></tr>
+ <tr><td><span class="bodyGrey">date</span></td><td><span class="bodyGrey">N</span></td><td><span class="bodyGrey">java.util.Date</span></td></tr>
+ <tr><td><span class="bodyGrey">short</span></td><td><span class="bodyGrey">Y</span></td><td><span class="bodyGrey">java.lang.Short.TYPE</span></td></tr>
+ <tr><td><span class="bodyGrey">char</span></td><td><span class="bodyGrey">Y</span></td><td><span class="bodyGrey">java.lang.Character.TYPE</span></td></tr>
+ <tr><td><span class="bodyGrey">bytes</span></td><td><span class="bodyGrey">N</span></td><td><span class="bodyGrey">byte[]</span></td></tr>
+ <tr><td><span class="bodyGrey">chars</span></td><td><span class="bodyGrey">N</span></td><td><span class="bodyGrey">char[]</span></td></tr>
+ <tr><td><span class="bodyGrey">strings</span></td><td><span class="bodyGrey">N</span></td><td><span class="bodyGrey">String[]</span></td></tr>
+ <tr><td><span class="bodyGrey">locale</span></td><td><span class="bodyGrey">N</span></td><td><span class="bodyGrey">java.util.Locale</span></td></tr>
+ </table>
+
+ <p><span class="bodyBlack">the CMP Container will try to cast the data in the mapping file to the proper Java
+ type.</span></p></span></td></tr>
+
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><p><span class="bodyBlack"><b>If there is a collection attribute</b>, the items in the following table can be
+ used:</span></p>
+
+ <table border="1" cellpadding="4">
+ <tr><th>name</th><th>type</th><th>default implementation</th></tr>
+ <tr><td><span class="bodyGrey">array</span></td><td><span class="bodyGrey"><type_attribute>[]</span></td><td><span class="bodyGrey"><type_attribute>[]</span></td></tr>
+ <tr><td><span class="bodyGrey">vector</span></td><td><span class="bodyGrey">java.util.Vector</span></td><td><span class="bodyGrey">java.util.Vector</span></td></tr>
+ <tr><td><span class="bodyGrey">hashtable</span></td><td><span class="bodyGrey">java.util.Hashtable</span></td><td><span class="bodyGrey">java.util.Hashtable</span></td></tr>
+ <tr><td><span class="bodyGrey">collection</span></td><td><span class="bodyGrey">java.util.Collection</span></td><td><span class="bodyGrey">java.util.Arraylist </span></td></tr>
+ <tr><td><span class="bodyGrey">arraylist</span></td><td><span class="bodyGrey">java.util.ArrayList</span></td><td><span class="bodyGrey">java.util.Arraylist </span></td></tr>
+ <tr><td><span class="bodyGrey">set</span></td><td><span class="bodyGrey">java.util.Set</span></td><td><span class="bodyGrey">java.util.Hashset</span></td></tr>
+ <tr><td><span class="bodyGrey">map</span></td><td><span class="bodyGrey">java.util.Map</span></td><td><span class="bodyGrey">java.util.Hashmap</span></td></tr>
+ </table>
+
+ <p><span class="bodyBlack">The type of the object inside the collection is the 'type' attribute. The 'default
+ implementation' is the type used if the object holding the collection is found
+ to be null and needs to be instantiated.</span></p>
+
+ <p><span class="bodyBlack">For hashtable and map, the CMP Container will add an object using the put(object, object)
+ method - the object is both the key and the value. This will be improved in the future.</span></p></span></td></tr>
+ </span></table>
+
+ <p><span class="bodyBlack">It is necessary to use a collection when the content model of the element expects more
+ than one element of the specified type. This is how the 'to-many' portion of a relationship
+ is described.</span></p>
+
+
+ <p><span class="bodyBlack"><b>2. Determine the signature of the method</b></span></p>
+
+ <li><p><span class="bodyBlack"><b>If 'direct' is set to true</b>, the CMP Container expects to find a public EntityBean or dependent Java
+ object variable with the given signature:</span></p>
+
+ <table width="440" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#e0e0e0"><span class="code-block"><pre>
+ public <type> <name>;
+ </pre></span></td></tr></table>
+
+ <li><p><span class="bodyBlack"><b>If 'direct' is set to false or omitted</b>, the CMP Container will access the property
+ though accessor methods. the CMP Container determines the signature of the accessors and mutators
+ as follows: If the 'get-method' or 'set-method' attributes are supplied, it will
+ try to find a function with the following signature:</span></p>
+
+ <table width="440" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#e0e0e0"><span class="code-block"><pre>
+ public <type> <get-method>();
+ </pre></span></td></tr></table>
+ or
+ <table width="440" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#e0e0e0"><span class="code-block"><pre>
+ public void <set-method>(<type> value);
+ </pre></span></td></tr></table>
+
+ <p><span class="bodyBlack">If 'get-method' or 'set-method' attributes are not provided, the CMP Container will try to
+ find the following function:</span></p>
+
+ <table width="440" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#e0e0e0"><span class="code-block"><pre>
+ public <type> get<capitalized-name>();
+ </pre></span></td></tr></table>
+ or
+ <table width="440" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#e0e0e0"><span class="code-block"><pre>
+ public void set<capitalized-name>(<type> value);
+ </pre></span></td></tr></table>
+
+ <p><span class="bodyBlack"><capitalized-name> means that the CMP Container uses the <name> attribute by changing its first
+ letter to uppercase without modifying the other letters.</span></p>
+
+ <p><span class="bodyBlack">The content of the <field> element will contain the information about how to map
+ this field to the relational table.</span></p>
+ </li>
+ </li>
+
+ <p><span class="bodyBlack">Description of the attributes: </span></p>
+
+ <table cellspacing="2" cellpadding="2" border="0"><tr><td height="5" colspan="2"></td></tr><span class="bodyGrey">
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>name:</b> If 'direct' access is used, 'name' should be the name of a public
+ variable in the object we are mapping (the field must be public, not
+ static and not transient). If no direct access and no 'get-/set-method'
+ is specified, this name will be used to infer the name of the accessor and
+ mutator methods.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>type:</b> The Java type of the field. This is used to access the
+ field. The CMP Container will use this information to cast the data type(e.g. string
+ into integer). It is also used to define the signature of the accessor and
+ mutator methods. If a collection is specified, this is used to specify the
+ type of the object inside the collection. See description above for more
+ details.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>required:</b> If true, the field is not optional.</span></td></tr>
+
+
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>direct:</b> If true, the CMP Container expects a public variable in the object
+ and will modify it directly.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>collection:</b> If a parent object expects more than one occurrence of
+ one of its fields, it is necessary to specify which collection type the CMP Container will
+ use to handle them. The type specified is used to define the type of the
+ content inside the collection.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>get-method:</b> An optional name of the accessor method the CMP Container should
+ use. If this attribute is not set, the CMP Container will try to guess the name with the
+ algorithm described above.</span></td></tr>
+
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>set-method:</b> An optional name of the mutator method the CMP Container should
+ use. If this attribute is not set, the CMP Container will try to guess the name with the
+ algorithm described above.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>create-method:</b> Factory method for instantiation of the object.</span></td></tr>
+ </span></table>
+
+
+
+ <a name="The <sql> element"><h3>The <sql> element</h3></a>
+
+ <p><span class="bodyBlack">
+<table width="440" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#e0e0e0"><span class="code-block"><pre>
+<!ELEMENT sql EMPTY>
+<!ATTLIST sql
+ name NMTOKENS #IMPLIED
+ type NMTOKENS #IMPLIED
+ many-key NMTOKENS #IMPLIED
+ many-table NMTOKEN #IMPLIED
+ read-only ( true | false ) "false"
+ dirty ( check | ignore ) "check">
+
+</pre></span></td></tr></table>
+ </span></p>
+
+ <p><span class="bodyBlack">
+ The <sql> element is used to denote information about the relational
+ database table to which a EntityBean and dependent Java object is mapped.
+ It should be declared
+ for all <field> elements. Each <field> element contains one <sql>
+ element. The <sql> element pertains directly to the the <map-to>
+ element for the containing <class> element. The <sql> elements
+ contains the following attributes:
+
+ <table cellspacing="2" cellpadding="2" border="0"><tr><td height="5" colspan="2"></td></tr><span class="bodyGrey">
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>name:</b> The column name in the relational database table.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>type:</b> The column type in the relational database table.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>many-key:</b> Specifies the name of the column that holds the
+ foreign key of the containing object. Used _only_ for 'to-many' relations.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>many-table:</b> Specifies the name of the bridge table that contains
+ the primary keys of the object on each side of the relationship.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>read-only:</b> If true, the column in the relational database
+ table will only be read, not updated or deleted.</span></td></tr>
+
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack"><b>dirty:</b> If the value is 'ignore', the field will not be checked
+ against the database for modification.</span></td></tr>
+ </span></table>
+ </span></p>
+
+
+
+ <a name="Usage Pattern"><h2>Usage Pattern</h2></a>
+
+ <p><span class="bodyBlack">Here is an example of a mapping file and the corresponding EntityBean and dependent Java object and
+ DDL for the databse table.</span></p>
+
+ <p><span class="bodyBlack">The following is an example Java object:</span></p>
+
+ <table border="1" cellpadding="4">
+ <tr>
+ <td BGCOLOR="#CCCCCC"><span class="bodyGrey" BGCOLOR="#CCCCCC">
+ <table width="440" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#e0e0e0"><span class="code-block"><pre>
+package myapp;
+
+public class Product implements javax.ejb.EntityBean
+{
+ private int _id;
+
+ private String _name;
+
+ private float _price;
+
+ private ProductGroup _group;
+
+
+ public int getId()
+ ...
+
+ public void setId( int anId )
+ ...
+
+ public String getName()
+ ...
+
+ public void setName( String aName )
+ ...
+
+ public float getPrice()
+ ...
+
+ public void setPrice( float aPrice )
+ ...
+
+ public ProductGroup getProductGroup()
+ ...
+
+ public void setProductGroup( ProductGroup aProductGroup )
+ ...
+}
+ </pre></span></td></tr></table>
+ </span></td>
+ </tr>
+ </table>
+
+ <p><span class="bodyBlack">The following is the relational database table:</span></p>
+
+ <table border="1" cellpadding="4">
+ <tr>
+ <td BGCOLOR="#CCCCCC"><span class="bodyGrey" BGCOLOR="#CCCCCC">
+ <table width="440" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#e0e0e0"><span class="code-block"><pre>
+create table prod
+(
+ id int not null,
+ name varchar(200) not null,
+ price numeric(18,2) not null,
+ group_id int not null
+);
+ </pre></span></td></tr></table>
+ </span></td>
+ </tr>
+ </table>
+
+ <p><span class="bodyBlack">The following is the mapping file for the example EntityBean:</span></p>
+
+ <table border="1" cellpadding="4">
+ <tr>
+ <td BGCOLOR="#CCCCCC"><span class="bodyGrey" BGCOLOR="#CCCCCC">
+ <table width="440" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#e0e0e0"><span class="code-block"><pre>
+<?xml version="1.0"?>
+<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Object Mapping DTD Version 1.0//EN"
+ "http://castor.exolab.org/mapping.dtd">
+<mapping>
+
+ <class name="myapp.Product" identity="id">
+
+ <map-to table="prod" />
+
+ <field name="id" type="integer">
+ <sql name="id" type="integer" />
+ </field>
+
+ <field name="name" type="string">
+ <sql name="name" type="char" />
+ </field>
+
+ <field name="price" type="float">
+ <sql name="price" type="numeric" />
+ </field>
+
+ <field name="group" type="myapp.ProductGroup" >
+ <sql name="group_id" />
+ </field>
+
+ </class>
+
+</mapping>
+
+ </pre></span></td></tr></table>
+ </span></td>
+ </tr>
+ </table>
+
+ </td><td align="left" valign="top" height="5" width="120">
+
+
+
+ </td></tr><tr height="5"><td align="left" valign="top" bgcolor="#7270c2" height="5" width="20"> </td><td valign="top" bgcolor="#7270c2" height="5" width="95"> </td><td align="left" valign="top" bgcolor="#a9a5de" height="5" width="7"> </td><td align="left" valign="top" height="5" width="40"> </td><td align="left" valign="top" height="5" width="120"> </td></tr><tr><td align="left" valign="top" bgcolor="#7270c2" height="5" width="20"> </td><td align="left" valign="top" bgcolor="#7270c2" width="95"> </td><td align="left" valign="top" bgcolor="#a9a5de" width="7"><img border="0" height="25" width="1" src="images/dotTrans.gif"></td><td align="left" valign="top" width="40"><img border="0" height="25" width="1" src="images/dotTrans.gif"></td><td align="left" valign="top" width="120"> </td></tr><tr height="5"><td align="left" valign="bottom" bgcolor="#7270c2" height="100%" rowspan="2" width="20"><img border="0" height="125" width="20" sr
c="images/stripes1.gif"></td><td align="left" valign="bottom" bgcolor="#7270c2" height="100%" rowspan="2" width="95"><img border="0" height="125" width="105" src="images/stripe105.gif"></td><td align="left" valign="top" bgcolor="#a9a5de" height="100%" rowspan="2" width="7"> </td><td align="left" valign="top" height="100%" width="40"> </td><td align="left" valign="top" height="100%" width="120"> </td></tr><tr height="5"><td align="left" valign="top" height="25" width="40"> </td><td align="left" valign="bottom" height="25" width="430"><br><br><img height="3" width="430" border="0" src="images/line_light.gif"><br><p></p><span class="bodyGrey"><small><notice>
+ OpenEJB is a trademark of the OpenEJB Group.
+ Java, EJB, JDBC, JNDI, JTA, Sun, Sun Microsystems are trademarks or registered
+ trademarks of Sun Microsystems, Inc. in the United States and in other
+ countries. XML, XML Schema, XSLT and related standards are trademarks or registered
+ trademarks of MIT, INRIA, Keio or others, and a product of the World Wide Web
+ Consortium. All other product names mentioned herein are trademarks of their respective
+ owners.
+ </notice><br> <br></small></span><p></p>
+
+ </td><td align="left" valign="top" height="25" width="120"> </td></tr></table></body></html>
\ No newline at end of file
Added: openejb/trunk/website/html/old-site/html/cmp_dbfiles.html
URL: http://svn.apache.org/viewvc/openejb/trunk/website/html/old-site/html/cmp_dbfiles.html?rev=1134776&view=auto
==============================================================================
--- openejb/trunk/website/html/old-site/html/cmp_dbfiles.html (added)
+++ openejb/trunk/website/html/old-site/html/cmp_dbfiles.html Sat Jun 11 21:33:33 2011
@@ -0,0 +1,97 @@
+<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>CMP Database Files</title><link href="default.css" rel="stylesheet"><link href="/images/favicon.ico" rel="SHORTCUT ICON"></head><body marginwidth="0" marginheight="0" leftmargin="0" bottommargin="0" topmargin="0" vlink="#6763a9" link="#6763a9" bgcolor="#ffffff"><a name="top"></a><table height="400" width="712" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#7270c2" align="left" valign="top" width="20"><img border="0" height="1" width="1" src="images/dotTrans.gif"></td><td bgcolor="#7270c2" align="left" valign="top" width="95"><img border="0" height="1" width="1" src="images/dotTrans.gif"></td><td align="left" valign="top" width="7"><img height="1" width="1" border="0" src="images/dotTrans.gif"></td><td align="left" valign="top" width="40"><img border="0" height="6" width="40" src="images/dotTrans.gif"></td><td bgcolor="#5A5CB8" align="left" valign="top" width="430"><img border=
"0" height="6" width="430" src="images/top_2.gif"></td><td bgcolor="#E24717" align="left" valign="top" width="120"><img src="images/top_3.gif" width="120" height="6" border="0"></td></tr><tr><td align="left" valign="top" bgcolor="#7270c2" width="20"><img height="1" width="1" border="0" src="images/dotTrans.gif"></td><td align="left" valign="top" bgcolor="#7270c2" width="95"><img height="1" width="1" border="0" src="images/dotTrans.gif"></td><td align="left" valign="top" bgcolor="#ffffff" width="7"></td><td align="left" valign="top" width="40"><img border="0" height="1" width="1" src="images/dotTrans.gif"></td><td align="left" valign="middle" width="430"><a href="faq.html"><span class="menuTopOff">[ f a q ]</span></a> <a href="http://wiki.codehaus.org/openejb"><span class="menuTopOff">[ w i k i ]</span></a> <a href="http://archive.openejb.codehaus.org/user/"><span class="menuTopOff">[ l i s t s ]</span></a>
<a href="http://cvs.openejb.org/"><span class="menuTopOff">[ c v s ]</span></a> <a href="http://jira.codehaus.org/secure/BrowseProject.jspa?id=10401"><span class="menuTopOff">[ b u g s ]</span></a> <br><img border="0" height="2" width="1" src="images/dotTrans.gif"></td><td align="left" valign="top" height="20" width="120"> </td></tr><tr><td align="left" valign="top" bgcolor="#7270c2" width="20"><img border="0" height="3" width="20" src="images/dotTrans.gif"></td><td align="left" valign="top" bgcolor="#7270c2" width="95"><img border="0" height="3" width="105" src="images/line_sm.gif"></td><td align="left" valign="top" bgcolor="#a9a5de" width="7"><img border="0" height="3" width="7" src="images/line_sm.gif"></td><td align="left" valign="top" width="40"><img border="0" height="3" width="40" src="images/line_light.gif"></td><td align="left" valign="top" width="430"><img border="0" height="3" width="
430" src="images/line_light.gif"></td><td align="left" valign="top" width="120"><img height="1" width="1" border="0" src="images/dotTrans.gif"></td></tr><tr><td align="left" valign="top" bgcolor="#7270c2"><img border="0" height="10" width="20" src="images/dotTrans.gif"></td><td align="left" valign="top" bgcolor="#7270c2" width="95"><img border="0" height="2" width="1" src="images/dotTrans.gif"><br><table cellspacing="0" cellpadding="0" border="0"><tr><td align="left" valign="top"><span class="subMenuOn">Main</span></td></tr><tr><td align="left" valign="top"><a href="index.html"><span class="subMenuOff">
+ Welcome!</span></a></td></tr><tr><td align="left" valign="top"><a href="download.html"><span class="subMenuOff">
+ Download</span></a></td></tr><tr><td align="left" valign="top"><a href="lists.html"><span class="subMenuOff">
+ Mailing Lists</span></a></td></tr><tr><td align="left" valign="top"><a href="cvs.html"><span class="subMenuOff">
+ Source Code</span></a></td></tr><tr><td align="left" valign="top"><a href="contributors.html"><span class="subMenuOff">
+ The Team</span></a></td></tr><tr><td align="left" valign="top"><a href="status.html"><span class="subMenuOff">
+ Status</span></a></td></tr></table><table cellspacing="0" cellpadding="0" border="0"><tr><td align="left" valign="top"><span class="subMenuOn">Users</span></td></tr><tr><td align="left" valign="top"><a href="quickstart.html"><span class="subMenuOff">
+ Quickstart</span></a></td></tr><tr><td align="left" valign="top"><a href="hello-world.html"><span class="subMenuOff">
+ Hello World!</span></a></td></tr><tr><td align="left" valign="top"><a href="cmp_entity_postgresql.html"><span class="subMenuOff">
+ CMP Example</span></a></td></tr><tr><td align="left" valign="top"><a href="cmp_guide.html"><span class="subMenuOff">
+ CMP Guide</span></a></td></tr><tr><td align="left" valign="top"><a href="deploy.html"><span class="subMenuOff">
+ Deploy</span></a></td></tr><tr><td align="left" valign="top"><a href="start-command.html"><span class="subMenuOff">
+ Startup</span></a></td></tr><tr><td align="left" valign="top"><a href="validate.html"><span class="subMenuOff">
+ Validation</span></a></td></tr><tr><td align="left" valign="top"><a href="config_containers.html"><span class="subMenuOff">
+ Configuration</span></a></td></tr><tr><td align="left" valign="top"><a href="properties.html"><span class="subMenuOff">
+ Properties</span></a></td></tr></table><table cellspacing="0" cellpadding="0" border="0"><tr><td align="left" valign="top"><span class="subMenuOn">Servers</span></td></tr><tr><td align="left" valign="top"><a href="embedded.html"><span class="subMenuOff">
+ Local Server</span></a></td></tr><tr><td align="left" valign="top"><a href="remote-server.html"><span class="subMenuOff">
+ Remote Server</span></a></td></tr><tr><td align="left" valign="top"><a href="tomcat.html"><span class="subMenuOff">
+ Tomcat</span></a></td></tr><tr><td align="left" valign="top"><a href="geronimo.html"><span class="subMenuOff">
+ Geronimo</span></a></td></tr></table><table cellspacing="0" cellpadding="0" border="0"><tr><td align="left" valign="top"><span class="subMenuOn">Integrators</span></td></tr><tr><td align="left" valign="top"><a href="whyopenejb.html"><span class="subMenuOff">
+ Why OpenEJB</span></a></td></tr><tr><td align="left" valign="top"><a href="containersystem.html"><span class="subMenuOff">
+ Overview</span></a></td></tr><tr><td align="left" valign="top"><a href="design_openejb.html"><span class="subMenuOff">
+ Design</span></a></td></tr><tr><td align="left" valign="top"><a href="OpenEJB_presentaion.ppt"><span class="subMenuOff">
+ Presentation</span></a></td></tr></table><img border="0" height="15" width="1" src="images/dotTrans.gif"><br><img border="0" height="3" width="105" src="images/line_sm.gif"><br><A href="http://codehaus.org"><IMG alt="The Codehaus" border="0" height="17" width="88" src="http://www.openejb.org/codehaus-smaller.png"></A></td><td align="left" valign="top" bgcolor="#a9a5de" width="7"> </td><td align="left" valign="top" width="40"> </td><td valign="top" width="430" rowspan="4"><table width="430" cellspacing="0" cellpadding="0" border="0" rows="2" cols="1"><tr><td align="left" valign="top"><br><img width="200" vspace="0" src="./images/logo_ejb2.gif" hspace="0" height="55" border="0"><br><img src="images/dotTrans.gif" hspace="0" height="7" border="0"><br><span class="pageTitle">CMP Database Files</span><br><img src="images/dotTrans.gif" hspace="0" height="1" border="0"></td></tr></table><p></p><p></p><br><span class="toc"><a href="#Database files">Database
files</a><br></span><span class="toc"><img border="0" height="1" width="15" src="images/dotTrans.gif"><a href="#Local TX database file">Local TX database file</a><br></span><span class="toc"><img border="0" height="1" width="15" src="images/dotTrans.gif"><a href="#Global TX database file">Global TX database file</a><br></span><span class="toc"><a href="#Setting the 'engine' attribute">Setting the 'engine' attribute</a><br></span><br><a name="Database files"><h2>Database files</h2></a>
+ <p><span class="bodyBlack">
+ Each CMP Container you declare in your openejb.conf file requires two Castor JDO <a href="http://www.castor.org/database-conf.html">database files</a> to be created.
+ <table cellspacing="2" cellpadding="2" border="0"><tr><td height="5" colspan="2"></td></tr><span class="bodyGrey">
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack">A Local_TX_Database file</span></td></tr>
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack">A Global_TX_Database file</span></td></tr>
+ </span></table>
+ </span></p>
+
+
+ <a name="Local TX database file"><h3>Local TX database file</h3></a>
+ <p><span class="bodyBlack">
+ Each CMP container will need a Local_TX_Database file. This file
+ specifies the configuration for
+ <table cellspacing="2" cellpadding="2" border="0"><tr><td height="5" colspan="2"></td></tr><span class="bodyGrey">
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack">Obtaining <b>direct</b> database connections</span></td></tr>
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack">Any number of mapping.xml schema files</span></td></tr>
+ </span></table>
+ </span></p>
+ <p><span class="bodyBlack">
+ This file is used when non-transactional connections are needed to the database.
+ This is when the TransactionManager is not managing the transaction,
+ such as when the tx attribute of the EntityBean method is Supports
+ (with no client tx), NotSupported, or Never.
+ </span></p>
+ <p><span class="bodyBlack">
+ Supports, NotSupported and Never refer to the container-managed
+ transaction attributes defined be the EJB specification.
+ </span></p>
+
+ <a name="Global TX database file"><h3>Global TX database file</h3></a>
+ <p><span class="bodyBlack">
+ Each CMP container will need a Global_TX_Database file. This file
+ specifies the configuration for
+ <table cellspacing="2" cellpadding="2" border="0"><tr><td height="5" colspan="2"></td></tr><span class="bodyGrey">
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack">Obtaining <b>managed</b> database connections</span></td></tr>
+ <tr><td width="10" valign="top" align="left"><img src="images/grayDot.gif"></td><td valign="top" align="left"><span class="bodyBlack">The same mapping files as the Local_TX_Database file</span></td></tr>
+ </span></table>
+ </span></p>
+ <p><span class="bodyBlack">
+ This file is used when transactional connections are needed to the database.
+ This is when the TransactionManager is managing the transaction,
+ such as when the tx attribute of the EntityBean method is Supports (client has tx),
+ RequiresNew, Required or Manditory.
+ </span></p>
+ <p><span class="bodyBlack">
+ Supports, RequiresNew, Required and Manditory refer to the
+ container-managed transaction attributes defined be the EJB specification.
+ </span></p>
+
+ <a name="Setting the 'engine' attribute"><h2>Setting the 'engine' attribute</h2></a>
+ <p><span class="bodyBlack">In both these files there is an <b>engine</b> attribute which tells
+ Castor JDO what database you are working with. This allows
+ it to take care of database specific aspects of persisting data to the database.
+ </span></p>
+ <p><span class="bodyBlack">
+ See this doc for a of supported databases.<br>
+<a href="http://www.castor.org/database-conf.html">http://www.castor.org/database-conf.html</a>
+ </span></p>
+ </td><td align="left" valign="top" height="5" width="120">
+
+
+
+ </td></tr><tr height="5"><td align="left" valign="top" bgcolor="#7270c2" height="5" width="20"> </td><td valign="top" bgcolor="#7270c2" height="5" width="95"> </td><td align="left" valign="top" bgcolor="#a9a5de" height="5" width="7"> </td><td align="left" valign="top" height="5" width="40"> </td><td align="left" valign="top" height="5" width="120"> </td></tr><tr><td align="left" valign="top" bgcolor="#7270c2" height="5" width="20"> </td><td align="left" valign="top" bgcolor="#7270c2" width="95"> </td><td align="left" valign="top" bgcolor="#a9a5de" width="7"><img border="0" height="25" width="1" src="images/dotTrans.gif"></td><td align="left" valign="top" width="40"><img border="0" height="25" width="1" src="images/dotTrans.gif"></td><td align="left" valign="top" width="120"> </td></tr><tr height="5"><td align="left" valign="bottom" bgcolor="#7270c2" height="100%" rowspan="2" width="20"><img border="0" height="125" width="20" sr
c="images/stripes1.gif"></td><td align="left" valign="bottom" bgcolor="#7270c2" height="100%" rowspan="2" width="95"><img border="0" height="125" width="105" src="images/stripe105.gif"></td><td align="left" valign="top" bgcolor="#a9a5de" height="100%" rowspan="2" width="7"> </td><td align="left" valign="top" height="100%" width="40"> </td><td align="left" valign="top" height="100%" width="120"> </td></tr><tr height="5"><td align="left" valign="top" height="25" width="40"> </td><td align="left" valign="bottom" height="25" width="430"><br><br><img height="3" width="430" border="0" src="images/line_light.gif"><br><p></p><span class="bodyGrey"><small><notice>
+ OpenEJB is a trademark of the OpenEJB Group.
+ Java, EJB, JDBC, JNDI, JTA, Sun, Sun Microsystems are trademarks or registered
+ trademarks of Sun Microsystems, Inc. in the United States and in other
+ countries. XML, XML Schema, XSLT and related standards are trademarks or registered
+ trademarks of MIT, INRIA, Keio or others, and a product of the World Wide Web
+ Consortium. All other product names mentioned herein are trademarks of their respective
+ owners.
+ </notice><br> <br></small></span><p></p>
+
+ </td><td align="left" valign="top" height="25" width="120"> </td></tr></table></body></html>
\ No newline at end of file