cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r405581 [5/14] - in /incubator/cayenne/main/trunk/cayenne/cayenne-other: docs/ docs/images/ wiki-docs/ wiki-docs/Documentation/ wiki-docs/Documentation/Modeler Guide/ wiki-docs/Documentation/Modeler Guide/Cayenne Project Structure/ wiki-doc...
Date Wed, 10 May 2006 01:11:01 GMT
Added: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Access Stack Internals/Extended Types/index.html
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/Access%20Stack%20Internals/Extended%20Types/index.html?rev=405581&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Access Stack Internals/Extended Types/index.html (added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Access Stack Internals/Extended Types/index.html Tue May  9 18:10:42 2006
@@ -0,0 +1,66 @@
+<html>
+  <head>
+    <title>Cayenne Documentation - Extended Types</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">Extended Types</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Generating Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Access Stack Internals/index.html">Access Stack Internals</a><ul>
+<li><a href="../../../../Documentation/User Guide/Access Stack Internals/Extended Types/index.html">Extended Types</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Access Stack Internals/Writing Custom DbAdapter/index.html">Writing Custom DbAdapter</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>JDBC specification defines a set of "standard" database column types (defined in java.sql.Types class) and a very specific mapping of these types to Java Object Types, such as java.lang.String, java.math.BigDecimal, etc. Sometimes there is a need to use a custom Java type not known to JDBC driver. CayenneModeler allows to configure an arbitrary Java class as an <span class="nobr"><a href="http://objectstyle.org/cayenne/api/cayenne/org/objectstyle/cayenne/map/ObjAttribute.html" title="Visit page outside Confluence" rel="nofollow">ObjAttribute<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> type by simply entering a fully-qualified name such class in the type column of an ObjAttribute. However there is more to it than just that. Cayenne needs to know how to instantiate this type from a database "primitive" value, and conversly, how to transform an object
  of the custom type to a JDBC-compatible object.</p>
+
+<h3><a name="ExtendedTypes-SupportingNonStandardTypes"></a>Supporting Non-Standard Types</h3>
+
+<p><span class="nobr"><a href="http://objectstyle.org/cayenne/api/cayenne/org/objectstyle/cayenne/access/types/ExtendedType.html" title="Visit page outside Confluence" rel="nofollow">ExtendedType<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> interface serves to integrate a custom attribute type to Cayenne. An implementation must provide <tt>ExtendedType.getClassName()</tt> method that returns a fully qualified Java class name for the supported custom type, and a number of methods that convert data between JDBC and custom type. Installing an ExtendedType currently has to be done in the code, some time during Cayenne startup (modeler support will be added in the future). The following code sample demonstrates this procedure:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-comment">// create custom ExtendedType instance
+</span>ExtendedType customType = <span class="code-keyword">new</span> MyCustomType();
+
+<span class="code-comment">// Find DataNode
+</span>DataDomain domain = Configuration.getSharedConfiguration().getDomain();
+DataNode node = domain.getNode(<span class="code-quote">"node_name_from_the_project"</span>);
+
+<span class="code-comment">// install ExtendedType
+</span>node.getAdapter().getExtendedTypes().registerType(customType);</pre>
+</div></div>
+
+<h3><a name="ExtendedTypes-DbAdaptersandExtendedTypes"></a>DbAdapters and Extended Types</h3>
+
+<p>As shown in the example above, ExtendedTypes are stored by <span class="nobr"><a href="http://objectstyle.org/cayenne/api/cayenne/org/objectstyle/cayenne/dba/DbAdapter.html" title="Visit page outside Confluence" rel="nofollow">DbAdapter<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>. In fact DbAdapters often install their own extended types to address incompatibilities, incompletness and differences between JDBC drivers in handling "standard" JDBC types. For instance some drivers support reading large character columns (CLOB) as java.sql.Clob, but some other - as "character stream", etc. Adapters provided with Cayenne override <tt>configureExtendedTypes()</tt> method to install their own types, possibly substituting Cayenne defaults. Custom DbAdapters can use the same technique.</p></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 ObjectStyle Group and content authors
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Access Stack Internals/Extended Types/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Access Stack Internals/Writing Custom DbAdapter/index.html
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/Access%20Stack%20Internals/Writing%20Custom%20DbAdapter/index.html?rev=405581&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Access Stack Internals/Writing Custom DbAdapter/index.html (added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Access Stack Internals/Writing Custom DbAdapter/index.html Tue May  9 18:10:42 2006
@@ -0,0 +1,47 @@
+<html>
+  <head>
+    <title>Cayenne Documentation - Writing Custom DbAdapter</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">Writing Custom DbAdapter</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Generating Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Access Stack Internals/index.html">Access Stack Internals</a><ul>
+<li><a href="../../../../Documentation/User Guide/Access Stack Internals/Extended Types/index.html">Extended Types</a></li>
+<li><a href="../../../../Documentation/User Guide/Access Stack Internals/Writing Custom DbAdapter/index.html">Writing Custom DbAdapter</a><ul>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>To Be Done...</p></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 ObjectStyle Group and content authors
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Access Stack Internals/Writing Custom DbAdapter/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Access Stack Internals/index.html
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/Access%20Stack%20Internals/index.html?rev=405581&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Access Stack Internals/index.html (added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Access Stack Internals/index.html Tue May  9 18:10:42 2006
@@ -0,0 +1,45 @@
+<html>
+  <head>
+    <title>Cayenne Documentation - Access Stack Internals</title>
+    <style type="text/css">@import "../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img src="../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">Access Stack Internals</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../Documentation/User Guide/Generating Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../Documentation/User Guide/Access Stack Internals/index.html">Access Stack Internals</a><ul>
+<li><a href="../../../Documentation/User Guide/Access Stack Internals/Extended Types/index.html">Extended Types</a></li>
+<li><a href="../../../Documentation/User Guide/Access Stack Internals/Writing Custom DbAdapter/index.html">Writing Custom DbAdapter</a></li>
+</ul>
+</li>
+<li><a href="../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>"Access stack" is a term used for the runtime engine in the heart of Cayenne. Its operation conditions are defined by the object-relational mapping and deployment information built using CayenneModeler. As mentioned <a href="../../../Documentation/User Guide/Design/Access Classes/index.html" title="Access Classes">before</a>, "stack" is composed of a number of layers working on top of each other: Application API Layer, Query Routing Layer and Access Layer. Part of the Application API Layer most visible to a user is of course the DataContext that was discussed earlier. The goal of this chapter is to demonstrate a number of advanced customization features that involve other classes participating in the access stack.</p></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 ObjectStyle Group and content authors
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Access Stack Internals/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cdataport/index.html
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/Ant%20Tasks/cdataport/index.html?rev=405581&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cdataport/index.html (added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cdataport/index.html Tue May  9 18:10:42 2006
@@ -0,0 +1,105 @@
+<html>
+  <head>
+    <title>Cayenne Documentation - cdataport</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">cdataport</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Generating Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a><ul>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cdataport/index.html">cdataport</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cdbgen/index.html">cdbgen</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cdeploy/index.html">cdeploy</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cgen/index.html">cgen</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Access Stack Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>Sometimes it is necessary to recreate a database, copying data from another existing database. For instance, recreating development database instance from production data, etc. While most RDBMS provide data import/export tools, they normally require advanced DBA skills to use and are most often not portable across database engines. Cayenne will provide a lightweight ant task to do data porting between the databases with identical schema, using DataMap information.</p>
+
+<p><tt>cdataport</tt> is an Ant task that takes a Cayenne project (cayenne.xml) with at least one DataMap and two DataNodes and ports data from source DataNode to a destination DataNode. All DataMaps linked to either the source or the target DataNode will be considered for porting.</p>
+
+<h5><a name="cdataport-Parameters"></a>Parameters</h5>
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Attribute</th>
+<th class='confluenceTh'>Description</th>
+<th class='confluenceTh'>Required</th>
+</tr>
+<tr>
+<td class='confluenceTd'>projectFile</td>
+<td class='confluenceTd'>Location of Cayenne project file containing mapping.</td>
+<td class='confluenceTd'>Yes</td>
+</tr>
+<tr>
+<td class='confluenceTd'>maps</td>
+<td class='confluenceTd'>A comma-separated list of DataMap names within the project, whoose entities data needs to be ported. If ommitted, all DataMaps in the project will be ported.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>srcNode</td>
+<td class='confluenceTd'>Source DataNode name.</td>
+<td class='confluenceTd'>Yes</td>
+</tr>
+<tr>
+<td class='confluenceTd'>destNode</td>
+<td class='confluenceTd'>Destination DataNode name.</td>
+<td class='confluenceTd'>Yes</td>
+</tr>
+<tr>
+<td class='confluenceTd'>cleanDest</td>
+<td class='confluenceTd'>If false, will skip deleting data from the destination tables. True is default.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>includeTables</td>
+<td class='confluenceTd'>Comma-separated list of tables to include in the port. If ommitted, all mapped DbEntities will be used. It is possible to use "*" to indicate name patterns.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>excludeTables</td>
+<td class='confluenceTd'>Comma-separated list of tables to exclude from the port. If ommitted, all mapped DbEntities will be used. It is possible to use "*" to indicate name patterns.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+</tbody></table>
+
+<h5><a name="cdataport-Examples"></a>Examples</h5>
+<p>Here is an example of using <tt>cdataport</tt> to port data using all source DataMaps, excluding DBEntities with name matching "BILL_*":</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;taskdef name=<span class="code-quote">"cdataport"</span> classname=<span class="code-quote">"org.objectstyle.cayenne.tools.DataPortTask"</span>&gt;</span>
+     <span class="code-tag">&lt;classpath refid=<span class="code-quote">"classpath"</span>/&gt;</span>
+<span class="code-tag">&lt;/taskdef&gt;</span>
+<span class="code-tag">&lt;cdataport projectFile=<span class="code-quote">"subdir/cayenne.xml"</span> srcNode=<span class="code-quote">"ProductionNode"</span> destNode=<span class="code-quote">"DevNode"</span> excludeTables=<span class="code-quote">"BILL_*"</span>/&gt;</span></pre>
+</div></div></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 ObjectStyle Group and content authors
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cdataport/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cdbgen/index.html
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/Ant%20Tasks/cdbgen/index.html?rev=405581&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cdbgen/index.html (added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cdbgen/index.html Tue May  9 18:10:42 2006
@@ -0,0 +1,130 @@
+<html>
+  <head>
+    <title>Cayenne Documentation - cdbgen</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">cdbgen</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Generating Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a><ul>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cdataport/index.html">cdataport</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cdbgen/index.html">cdbgen</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cdeploy/index.html">cdeploy</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cgen/index.html">cgen</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Access Stack Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p><tt>cdbgen</tt> is an Ant task that uses Cayenne DataMap to drop and/or generate schema objects of a specified database.</p>
+
+<h3><a name="cdbgen-Parameters"></a>Parameters</h3>
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Attribute</th>
+<th class='confluenceTh'>Description</th>
+<th class='confluenceTh'>Required</th>
+</tr>
+<tr>
+<td class='confluenceTd'>map</td>
+<td class='confluenceTd'>DataMap XML file to use as a schema descriptor.</td>
+<td class='confluenceTd'>Yes</td>
+</tr>
+<tr>
+<td class='confluenceTd'>adapter</td>
+<td class='confluenceTd'>Java class implementing org.objectstyle.cayenne.dba.DbAdapter. While this attribute is optional (a generic JdbcAdapter is used if not set), it is highly recommended to specify correct target adapter.</td>
+<td class='confluenceTd'>No (but strongly recommended)</td>
+</tr>
+<tr>
+<td class='confluenceTd'>driver</td>
+<td class='confluenceTd'>A class of JDBC driver to use for the target database.</td>
+<td class='confluenceTd'>Yes</td>
+</tr>
+<tr>
+<td class='confluenceTd'>url</td>
+<td class='confluenceTd'>JDBC connection URL of a target database.</td>
+<td class='confluenceTd'>Yes</td>
+</tr>
+<tr>
+<td class='confluenceTd'>username</td>
+<td class='confluenceTd'>Database user name.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>password</td>
+<td class='confluenceTd'>Database user password.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>droptables</td>
+<td class='confluenceTd'>Defines whether cdbgen should drop the tables before attempting to create new ones. Default is "No".</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>droppk</td>
+<td class='confluenceTd'>Defines whether cdbgen should drop Cayenne primary key support objects. Default is "No".</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>createtables</td>
+<td class='confluenceTd'>Defines whether cdbgen should create new tables. Default is "Yes".</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>createpk</td>
+<td class='confluenceTd'>Defines whether cdbgen should create Cayenne-specific auto PK objects. Default is "Yes".</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>createfk</td>
+<td class='confluenceTd'>Defines whether cdbgen should create foreign key copnstraints. Default is "Yes".</td>
+<td class='confluenceTd'>No</td>
+</tr>
+</tbody></table>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Driver Classpath</b><br />Support for "classpath" or "classpathref" attributes is pending. To work around this limitation, JDBC driver (and custom DbAdapter) classpath can be appended to the classpath used to load the task via "taskdef".</td></tr></table>
+
+<h3><a name="cdbgen-Example"></a>Example</h3>
+<p>Here is an example of using <tt>cdbgen</tt> to create DB schema objects on a local HSQLDB.</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;taskdef name=<span class="code-quote">"cdbgen"</span> classname=<span class="code-quote">"org.objectstyle.cayenne.tools.DbGeneratorTask"</span>&gt;</span>
+    <span class="code-tag">&lt;classpath refid=<span class="code-quote">"classpath"</span>/&gt;</span>
+<span class="code-tag">&lt;/taskdef&gt;</span>
+
+&lt;cdbgen map=<span class="code-quote">"${context.dir}/WEB-INF/DefaultMap.map.xml"</span> 
+    adapter=<span class="code-quote">"org.objectstyle.cayenne.dba.hsqldb.HSQLDBAdapter"</span>
+    driver=<span class="code-quote">"org.hsqldb.jdbcDriver"</span> 
+    url=<span class="code-quote">"jdbc:hsqldb:hsql://localhost/bookmarker"</span> 
+    username=<span class="code-quote">"sa"</span>/&gt;</pre>
+</div></div></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 ObjectStyle Group and content authors
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cdbgen/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cdeploy/index.html
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/Ant%20Tasks/cdeploy/index.html?rev=405581&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cdeploy/index.html (added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cdeploy/index.html Tue May  9 18:10:42 2006
@@ -0,0 +1,131 @@
+<html>
+  <head>
+    <title>Cayenne Documentation - cdeploy</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">cdeploy</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Generating Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a><ul>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cdataport/index.html">cdataport</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cdbgen/index.html">cdbgen</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cdeploy/index.html">cdeploy</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cgen/index.html">cgen</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Access Stack Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p><tt>cdeploy</tt> is an Ant task that configures Cayenne connection information in existing jar files that contain Cayenne project information. It is useful for the automation of deployment of Cayenne-based frameworks in different environments.</p>
+
+<h3><a name="cdeploy-Parameters"></a>Parameters</h3>
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Attribute</th>
+<th class='confluenceTh'>Description</th>
+<th class='confluenceTh'>Required</th>
+</tr>
+<tr>
+<td class='confluenceTd'>src</td>
+<td class='confluenceTd'>Source jar file that contains Cayenne project files among other things.</td>
+<td class='confluenceTd'>Yes</td>
+</tr>
+<tr>
+<td class='confluenceTd'>dest</td>
+<td class='confluenceTd'>Destination jar file that should be generated as a result of this task execution. If omitted, src is used.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>altProjectFile</td>
+<td class='confluenceTd'>An alternative location of cayenne.xml file. User can specify an arbitrary file. This file will be used as the main project file, replacing any existing cayenne.xml in the source jar. This gives the users an ultimate flexibility in configuring deployment libraries. For instance this feature can be used to deploy standalone DataMaps.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+</tbody></table>
+
+<h3><a name="cdeploy-NestedElements%3A"></a>Nested Elements:</h3>
+
+<h5><a name="cdeploy-node"></a>node</h5>
+<p>One or more nested "node" elements specify connection information for the named nodes. All nested nodes must exist in the project, or otherwise they will be ignored.<br/>
+Nested node Parameters:</p>
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Attribute</th>
+<th class='confluenceTh'>Description</th>
+<th class='confluenceTh'>Required</th>
+</tr>
+<tr>
+<td class='confluenceTd'>name</td>
+<td class='confluenceTd'>DataNode name</td>
+<td class='confluenceTd'>Yes</td>
+</tr>
+<tr>
+<td class='confluenceTd'>domain</td>
+<td class='confluenceTd'>Parent DataDomain of this node. If omitted, project must have only a single domain (very common case).</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>adapter</td>
+<td class='confluenceTd'>DataNode adapter.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>dataSource</td>
+<td class='confluenceTd'>DataSource name to use for this node.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>driverFile</td>
+<td class='confluenceTd'>File that contains driver information.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+</tbody></table>
+
+<p>"dataSource" and "driverFile" are mutually exclusive, but none of them are required.</p>
+
+<h3><a name="cdeploy-Examples"></a>Examples</h3>
+
+<p>Here is an example of using <tt>cdeploy</tt> to regenerate a jar file called "business.jar" with connection info located in "alt.driver.xml":</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;taskdef name=<span class="code-quote">"cdeploy"</span> classname=<span class="code-quote">"org.objectstyle.cayenne.tools.DeploymentConfigurator"</span>/&gt;</span>
+<span class="code-tag">&lt;cdeploy src=<span class="code-quote">"business.jar"</span>&gt;</span>
+    <span class="code-tag">&lt;node name=<span class="code-quote">"main-node"</span> driverFile=<span class="code-quote">"alt.driver.xml"</span>/&gt;</span>
+<span class="code-tag">&lt;/cdeploy&gt;</span></pre>
+</div></div>
+
+<p>An example of using <tt>cdeploy</tt> to redeploy a 3rd party library that contains DataMaps, but may not contain cayenne.xml:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;taskdef name=<span class="code-quote">"cdeploy"</span> classname=<span class="code-quote">"org.objectstyle.cayenne.tools.DeploymentConfigurator"</span>/&gt;</span>
+<span class="code-tag">&lt;cdeploy src=<span class="code-quote">"business.jar"</span> altProjectFile=<span class="code-quote">"my-cayenne.xml"</span>/&gt;</span></pre>
+</div></div></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 ObjectStyle Group and content authors
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cdeploy/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cgen/index.html
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/Ant%20Tasks/cgen/index.html?rev=405581&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cgen/index.html (added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cgen/index.html Tue May  9 18:10:42 2006
@@ -0,0 +1,229 @@
+<html>
+  <head>
+    <title>Cayenne Documentation - cgen</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">cgen</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Generating Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a><ul>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cdataport/index.html">cdataport</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cdbgen/index.html">cdbgen</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cdeploy/index.html">cdeploy</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/cgen/index.html">cgen</a><ul>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Access Stack Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p><tt>cgen</tt> is an Ant task that generates and maintains DataObjects source files based on Cayenne DataMap. If "makepairs" is set to "true" (default), this task will generate a pair of classes (superclass/subclass) for each ObjEntity in the DataMap. Superclasses should not be changed manually, since they are always overwritten. Subclasses are never overwritten and may be later customized by the user. If "makepairs" is set to "false", a single class will be generated for each ObjEntity.</p>
+
+<p>By creating custom templates, Cgen can also be used to generate other output (such as web pages, reports, specialized code templates) based on DataMap information.</p>
+
+<h3><a name="cgen-Parameters"></a>Parameters</h3>
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Attribute</th>
+<th class='confluenceTh'>Description</th>
+<th class='confluenceTh'>Required</th>
+</tr>
+<tr>
+<td class='confluenceTd'>map</td>
+<td class='confluenceTd'>DataMap XML file to use as a base for class generation.</td>
+<td class='confluenceTd'>Yes</td>
+</tr>
+<tr>
+<td class='confluenceTd'>additionalMaps</td>
+<td class='confluenceTd'>Path to additional DataMap XML files to use for class generation.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>destDir</td>
+<td class='confluenceTd'>Destination directory for Java classes (ignoring their package names).</td>
+<td class='confluenceTd'>Yes</td>
+</tr>
+<tr>
+<td class='confluenceTd'>overwrite</td>
+<td class='confluenceTd'>If set to "true", will overwrite older versions of generated classes. Ignored unless makepairs is set to "false".</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>makepairs</td>
+<td class='confluenceTd'>If set to "true", will generate subclass/superclass pairs, with all generated code included in superclass (default is "true").</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>template</td>
+<td class='confluenceTd'>Location of Velocity template file for Java class generation. If omitted, default template is used.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>supertemplate</td>
+<td class='confluenceTd'>Location of Velocity template file for Java superclass generation. Ignored unless "makepairs" set to "true". If omitted, default template is used.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>superpkg</td>
+<td class='confluenceTd'>Java package name of generated superclasses. Ignored unless "makepairs" set to "true". If omitted, each superclass will be assigned the same package as subclass. Note that having superclass in a different package would only make sense when "usepkgpath" is set to "true". Otherwise classes from different packages will end up in the same directory.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>usepkgpath</td>
+<td class='confluenceTd'>If set to "true" (default), a directory tree will be generated in "destDir" corresponding to the class package structure, if set to "false", classes will be generated in "destDir" ignoring their package.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>encoding</td>
+<td class='confluenceTd'>Specify generated file encoding if different from the default on current platform. Target encoding must be supported by the JVM running Ant build. Standard encodings supported by Java on all platforms are US-ASCII, ISO-8859-1, UTF-8, UTF-16BE, UTF-16LE, UTF-16. See Sun Java Docs for java.nio.charset.Charset for more information.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>version</td>
+<td class='confluenceTd'>Specifies template location and generator behavior. "1.1" is the old behavior, with templates located in "dotemplates" and "classgen" as the only velocity context attribute. "1.2" is the new behavior, with templates located in "dotemplates/v1.2" and "objEntity", "entityUtils", "stringUtils", and "importUtils" in the velocity context. (Default is "1.1")</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>excludeEntities</td>
+<td class='confluenceTd'>Entities (expressed as a perl5 regex) to exclude from template generation. (Default is to include all entities in the DataMap)</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>includeEntities</td>
+<td class='confluenceTd'>Entities (expressed as a perl5 regex) to include in template generation. (Default is to include all entities in the DataMap)</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>outputPattern</td>
+<td class='confluenceTd'>Name of file for generated output. (Default is "*.java")</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>mode</td>
+<td class='confluenceTd'>Specifies generator iteration target. "entity" performs one iteration for each selected entity. "datamap" performs one iteration per datamap (This is always one iteration since cgen currently supports specifying one-and-only-one datamap). (Default is "entity")</td>
+<td class='confluenceTd'>No</td>
+</tr>
+<tr>
+<td class='confluenceTd'>client</td>
+<td class='confluenceTd'>Whether we are generating classes for the client tier in a <a href="../../../../Documentation/Remote Object Persistence Guide/index.html" title="Remote Object Persistence Guide">Remote Object Persistence</a> application. Default is "false"</td>
+<td class='confluenceTd'>No</td>
+</tr>
+</tbody></table>
+
+<h3><a name="cgen-Parametersspecifiedasnestedelements"></a>Parameters specified as nested elements</h3>
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'>Attribute</th>
+<th class='confluenceTh'>Description</th>
+<th class='confluenceTh'>Required</th>
+</tr>
+<tr>
+<td class='confluenceTd'>config</td>
+<td class='confluenceTd'>CGen with version="1.2" also supports <span class="nobr"><a href="http://vpp.sourceforge.net/" title="Visit page outside Confluence" rel="nofollow">VPP<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> config nested elements for configuring the velocity template engine and adding objects to the velocity template. You can also reference a vppconfig element declared outside of the CGen task, but you'll need to insure that both <tt>vppconfig</tt> and <tt>cgen</tt> have been loaded with the same classloader by using the same ant taskdef loaderRef value for both tasks. See the <span class="nobr"><a href="http://vpp.sourceforge.net/manual/vppconfig.html" title="Visit page outside Confluence" rel="nofollow">VPP VPPConfig Manual<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>
  page for complete information.</td>
+<td class='confluenceTd'>No</td>
+</tr>
+</tbody></table>
+
+<h3><a name="cgen-Examples"></a>Examples</h3>
+
+<p>Here is an example of using CGen to generate DataObject subclass/superclass pairs from DataMap located in "src/datamap.xml". All generated subclasses and superclasses will be saved in the same directory "src/java/dobj" regardless of their package names:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;taskdef name=<span class="code-quote">"cgen"</span> classname=<span class="code-quote">"org.objectstyle.cayenne.tools.CayenneGenerator"</span>&gt;</span>
+    <span class="code-tag">&lt;classpath refid=<span class="code-quote">"classpath"</span>/&gt;</span>
+<span class="code-tag">&lt;/taskdef&gt;</span>
+<span class="code-tag">&lt;cgen map=<span class="code-quote">"src/datamap.xml"</span> destDir=<span class="code-quote">"src/java/dobj"</span> usepkgpath=<span class="code-quote">"false"</span>/&gt;</span></pre>
+</div></div>
+<p>Here is an example of using CGen to generate html pages for all entities starting with "Artist" in the DataMap:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;taskdef name=<span class="code-quote">"cgen"</span> classname=<span class="code-quote">"org.objectstyle.cayenne.tools.CayenneGenerator"</span>&gt;</span>
+    <span class="code-tag">&lt;classpath refid=<span class="code-quote">"classpath"</span>/&gt;</span>
+<span class="code-tag">&lt;/taskdef&gt;</span>
+&lt;cgen map=<span class="code-quote">"src/datamap.xml"</span> destDir=<span class="code-quote">"src/doc/web"</span> makepairs=<span class="code-quote">"false"</span> usepkgpath=<span class="code-quote">"false"</span>
+    template=<span class="code-quote">"EntityReport.vm"</span> includeEntities=<span class="code-quote">"Artist*"</span> outputPattern=<span class="code-quote">"*Report.html"</span>/&gt;</pre>
+</div></div>
+
+<p>Here is an example of using CGen with a nested config element:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-xml">&lt;typedef
+    resource=<span class="code-quote">"org/objectstyle/cayenne/tools/antlib.xml"</span>&gt;
+    <span class="code-tag">&lt;classpath refid=<span class="code-quote">"aclasspath"</span>/&gt;</span>
+<span class="code-tag">&lt;/typedef&gt;</span>
+
+&lt;cgen map=<span class="code-quote">"src/datamap.xml"</span>
+    destDir=<span class="code-quote">"src/doc/web"</span>
+    makepairs=<span class="code-quote">"false"</span>
+    usepkgpath=<span class="code-quote">"false"</span>
+    template=<span class="code-quote">"EntityReport.vm"</span>
+    includeEntities=<span class="code-quote">"Artist*"</span>
+    outputPattern=<span class="code-quote">"*Report.html"</span>&gt;
+    <span class="code-tag">&lt;config&gt;</span>
+        <span class="code-tag">&lt;context&gt;</span>
+            <span class="code-tag">&lt;property key=<span class="code-quote">"myPropertyName"</span> value=<span class="code-quote">"myPropertyValue"</span> /&gt;</span>
+            <span class="code-tag">&lt;tool key=<span class="code-quote">"myToolName"</span> className=<span class="code-quote">"org.myDomain.MyTool"</span> /&gt;</span>
+        <span class="code-tag">&lt;/context&gt;</span>
+    <span class="code-tag">&lt;/config&gt;</span>
+<span class="code-tag">&lt;/cgen&gt;</span></pre>
+</div></div>
+
+<p>Here is an example of using CGen with vppconfig:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-xml">&lt;typedef
+    resource=<span class="code-quote">"org/objectstyle/cayenne/tools/antlib.xml"</span>&gt;
+    loaderref=<span class="code-quote">"aclasspathloader"</span>
+    <span class="code-tag">&lt;classpath refid=<span class="code-quote">"aclasspath"</span>/&gt;</span>
+<span class="code-tag">&lt;/typedef&gt;</span>
+
+&lt;typedef name=<span class="code-quote">"vppconfig"</span>
+    classname=<span class="code-quote">"foundrylogic.vpp.VPPConfig"</span>
+    loaderref=<span class="code-quote">"aclasspathloader"</span>&gt;
+    <span class="code-tag">&lt;classpath refid=<span class="code-quote">"aclasspath"</span>/&gt;</span>
+<span class="code-tag">&lt;/typedef&gt;</span>
+
+<span class="code-tag">&lt;vppconfig id=<span class="code-quote">"myconfig"</span>&gt;</span>
+    <span class="code-tag">&lt;context&gt;</span>
+        <span class="code-tag">&lt;property key=<span class="code-quote">"myPropertyName"</span> value=<span class="code-quote">"myPropertyValue"</span> /&gt;</span>
+        <span class="code-tag">&lt;tool key=<span class="code-quote">"myToolName"</span> className=<span class="code-quote">"org.myDomain.MyTool"</span> /&gt;</span>
+    <span class="code-tag">&lt;/context&gt;</span>
+<span class="code-tag">&lt;/vppconfig&gt;</span>
+
+&lt;cgen map=<span class="code-quote">"src/datamap.xml"</span>
+    destDir=<span class="code-quote">"src/doc/web"</span>
+    makepairs=<span class="code-quote">"false"</span>
+    usepkgpath=<span class="code-quote">"false"</span>
+    template=<span class="code-quote">"EntityReport.vm"</span>
+    includeEntities=<span class="code-quote">"Artist*"</span>
+    outputPattern=<span class="code-quote">"*Report.html"</span>&gt;
+    <span class="code-tag">&lt;config refid=<span class="code-quote">"myconfig"</span> /&gt;</span>
+<span class="code-tag">&lt;/cgen&gt;</span></pre>
+</div></div></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 ObjectStyle Group and content authors
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/cgen/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/index.html
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/Ant%20Tasks/index.html?rev=405581&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/index.html (added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/index.html Tue May  9 18:10:42 2006
@@ -0,0 +1,66 @@
+<html>
+  <head>
+    <title>Cayenne Documentation - Ant Tasks</title>
+    <style type="text/css">@import "../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img src="../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">Ant Tasks</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../Documentation/User Guide/Generating Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a><ul>
+<li><a href="../../../Documentation/User Guide/Ant Tasks/cdataport/index.html">cdataport</a></li>
+<li><a href="../../../Documentation/User Guide/Ant Tasks/cdbgen/index.html">cdbgen</a></li>
+<li><a href="../../../Documentation/User Guide/Ant Tasks/cdeploy/index.html">cdeploy</a></li>
+<li><a href="../../../Documentation/User Guide/Ant Tasks/cgen/index.html">cgen</a></li>
+</ul>
+</li>
+<li><a href="../../../Documentation/User Guide/Access Stack Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>Cayenne ships with Ant tasks that provide Ant frontend to a number of useful operations in Cayenne. The following tasks are included:</p>
+
+<ul>
+	<li><b><a href="../../../Documentation/User Guide/Ant Tasks/cgen/index.html" title="cgen">cgen</a></b> - Java class generator</li>
+	<li><b><a href="../../../Documentation/User Guide/Ant Tasks/cdbgen/index.html" title="cdbgen">cdbgen</a></b> - Database schema generator</li>
+	<li><b><a href="../../../Documentation/User Guide/Ant Tasks/cdeploy/index.html" title="cdeploy">cdeploy</a></b> - Deployment configurator</li>
+	<li><b><a href="../../../Documentation/User Guide/Ant Tasks/cdataport/index.html" title="cdataport">cdataport</a></b> - Data porting tool.</li>
+</ul>
+
+
+<h3><a name="AntTasks-ImportingCayenneTasksinbuild.xml"></a>Importing Cayenne Tasks in build.xml</h3>
+<p>Cayenne tasks above can be imported individually using Ant taskdef, as described in each task documentation page. However the users of Ant 1.6 and newer can take advantage of Antlib Ant feature. <span class="nobr"><a href="http://ant.apache.org/manual/CoreTypes/antlib.html" title="Visit page outside Confluence" rel="nofollow">Antlib<sup><img class="rendericon" src="../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> allows 3rd party tasks and types to be defined easily. Cayenne has an embedded antlib.xml descriptor file in the package <tt>org.objectstyle.cayenne.tools</tt>. All of Cayenne's Ant tasks can be defined at once using the following definition in your Ant build file:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;typedef resource=<span class="code-quote">"org/objectstyle/cayenne/tools/antlib.xml"</span>&gt;</span> 
+   <span class="code-tag">&lt;classpath refid=<span class="code-quote">"classpath"</span>/&gt;</span> 
+<span class="code-tag">&lt;/typedef&gt;</span></pre>
+</div></div>
+
+<p>When using the Antlib construct, omit the <tt>&lt;taskdef&gt;</tt> elements shown in the examples of each task, as the antlib.xml file defines all of the Cayenne Ant tasks. </p></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 ObjectStyle Group and content authors
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/Ant Tasks/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/DataContextDelegate/index.html
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/DataContext/DataContextDelegate/index.html?rev=405581&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/DataContextDelegate/index.html (added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/DataContextDelegate/index.html Tue May  9 18:10:42 2006
@@ -0,0 +1,70 @@
+<html>
+  <head>
+    <title>Cayenne Documentation - DataContextDelegate</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">DataContextDelegate</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Generating Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a><ul>
+<li><a href="../../../../Documentation/User Guide/DataContext/DataContextDelegate/index.html">DataContextDelegate</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/DataContext/DataObject State Management/index.html">DataObject State Management</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Moving Objects Between Contexts/index.html">Moving Objects Between Contexts</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Nested DataContexts/index.html">Nested DataContexts</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Obtaining DataContext/index.html">Obtaining DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Running Queries/index.html">Running Queries</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Access Stack Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>DataContext supports runtime customization via a DataContextDelegate interface. A user can assign a custom delegate instance to a DataContext by calling DataContext.setDelegate(..). Delegate is optional, and if it is not set, DataContext would go on with its default behavior. If a delegate is set, DataContext consults with it at some critical points in the normal flow execution. A delegate can modify the flow, abort an operation, modify objects participating in an operation, or perform any other tasks it deems necessary.</p>
+
+<p>DataContextDelegate currently has two groups of methods - method to filter select queries, and methods to react to external updates of the ObjectStore:</p>
+
+<ul>
+	<li><tt>public Query willPerformQuery(DataContext context, Query query)</tt></li>
+</ul>
+
+
+<p>Called from DataContext.performQuery(...) before running any select query, including prefetch queries. Implementation has a choice to modify an original query, replace it with alternative one, or return NULL, blocking query execution alltogether.</p>
+
+<ul>
+	<li><tt>public boolean shouldMergeChanges(DataObject object, DataRow snapshotInStore)</tt><br/>
+  <tt>public boolean shouldProcessDelete(DataObject object)</tt><br/>
+  <tt>public void finishedMergeChanges(DataObject object)</tt><br/>
+  <tt>public void finishedProcessDelete(DataObject object)</tt></li>
+</ul>
+
+
+<p>These methods are called by the ObjectStore whenever it performs an update of its state triggered by external events. Default ObjectStore behavior is to merge all changes to the existing objects, and change deleted objects state to TRANSIENT, removing them from the store. Delegate has an option to abort standard processing by returning "false" from "should*" methods.</p></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 ObjectStyle Group and content authors
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/DataContextDelegate/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/DataObject State Management/index.html
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/DataContext/DataObject%20State%20Management/index.html?rev=405581&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/DataObject State Management/index.html (added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/DataObject State Management/index.html Tue May  9 18:10:42 2006
@@ -0,0 +1,175 @@
+<html>
+  <head>
+    <title>Cayenne Documentation - DataObject State Management</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">DataObject State Management</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Generating Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a><ul>
+<li><a href="../../../../Documentation/User Guide/DataContext/DataContextDelegate/index.html">DataContextDelegate</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/DataObject State Management/index.html">DataObject State Management</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Moving Objects Between Contexts/index.html">Moving Objects Between Contexts</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Nested DataContexts/index.html">Nested DataContexts</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Obtaining DataContext/index.html">Obtaining DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Running Queries/index.html">Running Queries</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Access Stack Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>Arguably the second most important function of DataContext (first is performing queries) is keeping track of changes made to the registered DataObjects. "Registered" is a keyword here - registering an object with DataContext is what gives this object its persistent qualities.</p>
+
+<h3><a name="DataObjectStateManagement-HowtoRegisteraDataObject"></a>How to Register a DataObject</h3>
+
+<p>Behind the scenes "registering an object" results in storing this object in a map using its ObjectId as a key, setting "dataContext" property of a DataObject to the current DataContext, and taking a snapshot of all persistent properties to be able to track later modifications. Objects can become "registered" in two ways:</p>
+
+<ul>
+	<li>automatically when they are fetched via query API</li>
+	<li>explicitly for the newly created objects</li>
+</ul>
+
+
+<p>Whenever a selecting query is executed by a DataContext, all fetched objects are automatically registered with this DataContext. On the other hand, newly created objects must be registered explicitly:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> org.objectstyle.cayenne.access.DataContext;
+...
+DataContext context; <span class="code-comment">// assume <span class="code-keyword">this</span> exists
+</span>
+Artist artist = <span class="code-keyword">new</span> Artist();
+context.registerNewObject(artist);
+
+<span class="code-comment">// after the line above is executed, artist object acquired <span class="code-quote">"persistent"</span> behavior
+</span><span class="code-comment">// and is said to be <span class="code-quote">"managed"</span> by DataContext</span></pre>
+</div></div>
+
+<p>This code can be simplified - object creation and registrations steps can be combined in one method call:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> org.objectstyle.cayenne.access.DataContext;
+...
+DataContext context; <span class="code-comment">// assume <span class="code-keyword">this</span> exists
+</span>
+Artist artist = (Artist) context.createAndRegisterNewObject(Artist.class);</pre>
+</div></div>
+
+<p>This method relies on the presence of a no-argument constructor in the DataObject class.</p>
+
+<h3><a name="DataObjectStateManagement-CheckingtheStateofRegisteredDataObjects"></a>Checking the State of Registered DataObjects</h3>
+
+<p>State transitions of DataObjects from persistence point of view are discussed in the "Design" chapter. State of each individual object is described by an integer constant obtained via a call to DataObject.getPeristenceState(). Allowed states are defined as static variables in PersistenceState class.</p>
+
+<p>When a new object is inserted to the DataContext as described above, it becomes "NEW":</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> org.objectstyle.cayenne.access.DataContext;
+...
+DataContext context; <span class="code-comment">// assume <span class="code-keyword">this</span> exists
+</span>
+<span class="code-comment">// artist will become PersistenceState.NEW
+</span>Artist artist = (Artist) context.createAndRegisterNewObject(Artist.class);</pre>
+</div></div>
+
+<p>When a DataContext is committed, such object becomes "COMMITTED":</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-comment">// artist will become PersistenceState.COMMITTED
+</span>context.commitChanges();</pre>
+</div></div>
+
+<p>When any of the attributes or relationships of the fetched or committed object are changed, such an object becomes MODIFIED:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-comment">// <span class="code-keyword">this</span> will change the object state to PersistenceState.MODIFIED
+</span>artist.setName(<span class="code-quote">"NewName"</span>);</pre>
+</div></div>
+
+<p>When a fetched or committed object is explicitly deleted from the DataContext, object becomes DELETED:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-comment">// <span class="code-keyword">this</span> will change the object state to PersistenceState.DELETED
+</span>context.deleteObject(artist);</pre>
+</div></div>
+
+<p>DataContext is said to have changes if it has one or more registered objects in a state PersistenceState.MODIFIED, PersistenceState.NEW or PersistenceState.DELETED. DataContext provides the following method to check if it has any changed objects:</p>
+
+<ul>
+	<li><tt>public boolean hasChanges()</tt></li>
+</ul>
+
+
+<p>There is also a way to obtain a list of changed objects in each one of the above states:</p>
+
+<ul>
+	<li><tt>public java.util.Collection newObjects()</tt></li>
+	<li><tt>public java.util.Collection deletedObjects()</tt></li>
+	<li><tt>public java.util.Collection modifiedObjects()</tt></li>
+</ul>
+
+
+<h3><a name="DataObjectStateManagement-SavingAllUncommittedDataObjects"></a>Saving All Uncommitted DataObjects</h3>
+
+<p>All of the uncommitted objects ("uncommitted" means "new", "modified" or "deleted") are saved ("committed") to the database with a single method call on the DataContext:</p>
+
+<ul>
+	<li><tt>public void commitChanges()</tt></li>
+</ul>
+
+
+<p>Method commitChanges takes care of building correct SQL statements, generating primary keys and transactional behaviour. It roughly follows this scenario:</p>
+
+<ul>
+	<li>Checks if there are any changed objects (also detecting "phantom" modifications, e.g. if an object property was "udapted" with the equivalent value).</li>
+	<li>Validates "dirty" objects (for more information on validation see <a href="../../../../Documentation/User Guide/DataObjects/DataObject Validation/index.html" title="DataObject Validation">this page</a>).</li>
+	<li>Generates primary keys for any NEW objects that require autogenerated key.</li>
+	<li>Builds any needed INSERT, UPDATE, DELETE queries.</li>
+	<li>Starts the database transaction.</li>
+	<li>Runs the queries.</li>
+	<li>Commits transaction.</li>
+	<li>Changes all committed objects state to PersistenceState.COMMITTED.</li>
+	<li>Updates internally stored snapshots of the recently saved objects.</li>
+</ul>
+
+
+
+<h3><a name="DataObjectStateManagement-UndoingAllUncommittedChanges"></a>Undoing All Uncommitted Changes</h3>
+
+<p>There is a way for the DataContext to undo all uncommitted changes:</p>
+
+<ul>
+	<li><tt>public void rollbackChanges()</tt></li>
+</ul>
+
+
+<p>This will restore the persistence state and the values of all registered objects to the values that objects had when they were fetched or the last commitChanges was executed. This effectively restores previously committed state of the object graph. Note that any NEW objects are unregistered from the context.</p></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 ObjectStyle Group and content authors
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/DataObject State Management/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/Moving Objects Between Contexts/index.html
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/DataContext/Moving%20Objects%20Between%20Contexts/index.html?rev=405581&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/Moving Objects Between Contexts/index.html (added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/Moving Objects Between Contexts/index.html Tue May  9 18:10:42 2006
@@ -0,0 +1,70 @@
+<html>
+  <head>
+    <title>Cayenne Documentation - Moving Objects Between Contexts</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">Moving Objects Between Contexts</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Generating Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a><ul>
+<li><a href="../../../../Documentation/User Guide/DataContext/DataContextDelegate/index.html">DataContextDelegate</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/DataObject State Management/index.html">DataObject State Management</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Moving Objects Between Contexts/index.html">Moving Objects Between Contexts</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Nested DataContexts/index.html">Nested DataContexts</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Obtaining DataContext/index.html">Obtaining DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Running Queries/index.html">Running Queries</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Access Stack Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>Each instance of a DataObject belongs to only one DataContext for the duration of the object lifecycle. Sometimes there maybe a need to transfer a list of objects from one DataContext to another. The goal of this operation is to be able to use such objects in relationships with objects of the target DataContext. Most common use for this feature is the following. An application may have a "shared" DataContext that is used to fetch "static" read only lookup data. To avoid fetching the same data over and over again for each session, objects from the shared DataContext can be transferred to a session DataContext by calling <tt>DataContext.localObject()</tt>:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">DataContext sessionContext = DataContext.getThreadDataContext();
+
+HttpSession session; <span class="code-comment">// assume <span class="code-keyword">this</span> exists
+</span>
+<span class="code-comment">// assume that ServletContext contains a list of UserType DataObjects
+</span><span class="code-comment">// fetched via some global DataContext
+</span>List sharedUserTypes = (List) session.getServletContext().getAttribute("userTypes);
+UserType sharedType = (UserType) sharedUserTypes.get(0);
+
+UserType localType = (UserType) sessionContext.localObject(sharedType.getObjectId(), sharedType);
+User user; <span class="code-comment">// assume <span class="code-keyword">this</span> exists
+</span>
+<span class="code-comment">// now it is safe to use the UserType in relationships with other
+</span><span class="code-comment">// session objects
+</span>user.setUserType(localType);
+...</pre>
+</div></div></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 ObjectStyle Group and content authors
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/Moving Objects Between Contexts/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/Nested DataContexts/index.html
URL: http://svn.apache.org/viewcvs/incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User%20Guide/DataContext/Nested%20DataContexts/index.html?rev=405581&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/Nested DataContexts/index.html (added)
+++ incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/Nested DataContexts/index.html Tue May  9 18:10:42 2006
@@ -0,0 +1,93 @@
+<html>
+  <head>
+    <title>Cayenne Documentation - Nested DataContexts</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://objectstyle.org/cayenne/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+    <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+    <span class="pagetitle">Nested DataContexts</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Generating Classes/index.html">Generating Classes</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a><ul>
+<li><a href="../../../../Documentation/User Guide/DataContext/DataContextDelegate/index.html">DataContextDelegate</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/DataObject State Management/index.html">DataObject State Management</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Moving Objects Between Contexts/index.html">Moving Objects Between Contexts</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Nested DataContexts/index.html">Nested DataContexts</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Obtaining DataContext/index.html">Obtaining DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/Running Queries/index.html">Running Queries</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Access Stack Internals/index.html">Access Stack Internals</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>One of the goals of the DataContext is to provide an isolated area where local object changes can be performed without affecting other similar areas or the underlying storage. At some point in time users would either commit changes to the underlying storage or undo them (roll them back). </p>
+
+<p>If a DataContext is directly attached to the DataDomain, a call to <tt>DataContext.commitChanges()</tt> results in changes written to the database. On the other hand if DataContext's direct parent in the access stack is not a DataDomain, but another DataContext, changes can be saved to the parent without saving them to the database. Such child context is often called "nested".</p>
+
+<p>Nested contexts are useful in many situations, such as nested UI dialogs, complicated workflows, etc.</p>
+
+<h3><a name="NestedDataContexts-CreatingNestedDataContext"></a>Creating Nested DataContext</h3>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">DataContext parent = ...
+DataContext child = context.createChildDataContext();</pre>
+</div></div>
+
+<p>Note that if there was a DataContextFactory configured for the DataDomain at the top of the context hierarchy, such factory will be used internally by <tt>createChildDataContext</tt> method. Also child DataContext inherits parent's <tt>"ValidatingObjectsOnCommit"</tt> property.</p>
+
+<h3><a name="NestedDataContexts-UsingNestedDataContext"></a>Using Nested DataContext</h3>
+
+<p>A nested DataContext does everything a regular DataContext can do, i.e. perform queries, register new objects, delete objects, etc. A specific behavior is the ability to choose between a cascading or one-level commit or rollback.</p>
+
+<p>Regular <tt>"commitChanges"</tt> call does a cascading commit through the stack of parents all the way to the database:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java">child.commitChanges();</pre>
+</div></div>
+
+<p>However it is possible to commit to parent, without triggering a DB commit:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java">child.commitChangesToParent();</pre>
+</div></div>
+
+<p>Same thing with rollback, <tt>"rollbackChanges"</tt> does a cascading rollback:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java">child.rollbackChanges();</pre>
+</div></div>
+
+<p>While <tt>"rollbackChangesLocally"</tt> only affects the nested context, and not even sent to the parent:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java">child.rollbackChangesLocally();</pre>
+</div></div>
+
+
+<h3><a name="NestedDataContexts-NestedDataContextsPerformance"></a>Nested DataContexts Performance</h3>
+
+<p>All cascading operations (such as a select query or a cascading update) initiated by a nested DataContext will have to travel through the stack of parent contexts, incurring certain delay at each stack level. The delay is due to the fact that each DataContext has to update its own objects during most operations. So nesting should only be used when application specifics require to do so. Also nesting of more than a few levels should be avoided.</p></div>
+</div>
+  <div class="clearer">.</div>
+  <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+  <div class="smalltext copyright">
+    Copyright &copy;2001-2006 ObjectStyle Group and content authors
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/cayenne/cayenne-other/wiki-docs/Documentation/User Guide/DataContext/Nested DataContexts/index.html
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message