cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r488202 [9/19] - in /incubator/cayenne/main/trunk/assembly/cayenne-generic: ./ src/doc/ src/doc/confluence/ src/doc/confluence/Documentation/ src/doc/confluence/Documentation/JPA Guide/ src/doc/confluence/Documentation/JPA Guide/JPA Agent/ ...
Date Mon, 18 Dec 2006 10:24:42 GMT
Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/DataObjects Example/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataObjects/DataObjects%20Example/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/DataObjects Example/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/DataObjects Example/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,132 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - DataObjects Example</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.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">DataObjects Example</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/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><ul>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Accessing PK and FK values/index.html">Accessing PK and FK values</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Relationships/index.html">Relationships</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Flattened Relationships/index.html">Flattened Relationships</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObjects Example/index.html">DataObjects Example</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObjectUtils/index.html">DataObjectUtils</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObject Validation/index.html">DataObject Validation</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Handling Inheritance/index.html">Handling Inheritance</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Deleting Objects/index.html">Deleting Objects</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Generic Persistent Class/index.html">Generic Persistent Class</a></li>
+</ul>
+</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/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</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/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>As discussed in <a href="../../../../Documentation/User Guide/DataObjects/index.html" title="DataObjects">DataContext</a> chapter, any changes made to the DataObjects via "set*" methods are synchronized with the database by calling <tt>DataContext.commitChanges</tt>. Here is an example showing how the <tt>Painting</tt> object is fetched, modified and saved back. The following modifications are performed: the price of the first retrieved painting is doubled, a new painting is added that belongs to the same artist as the painting fetched before:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> java.math.BigDecimal;
+<span class="code-keyword">import</span> java.util.List;
+<span class="code-keyword">import</span> org.apache.cayenne.access.DataContext;
+<span class="code-keyword">import</span> org.apache.cayenne.query.SelectQuery;
+<span class="code-keyword">import</span> org.apache.cayenne.exp.Expression;
+<span class="code-keyword">import</span> org.apache.cayenne.exp.ExpressionFactory;
+<span class="code-keyword">import</span> org.apache.art.Painting;
+<span class="code-keyword">import</span> org.apache.art.Artist;
+...
+
+<span class="code-comment">// assume <span class="code-keyword">this</span> exists and initialized
+</span>DataContext ctxt;
+...
+Expression e =
+  ExpressionFactory.greaterExp(<span class="code-quote">"estimatedPrice"</span>,
+                        <span class="code-keyword">new</span> BigDecimal(100000.0));
+SelectQuery q = <span class="code-keyword">new</span> SelectQuery(Painting.class, e);
+List realExpensiveArt = ctxt.performQuery(q);
+
+<span class="code-keyword">if</span>(realExpensiveArt.size() &gt; 0) {
+  Painting firstPainting = (Painting)realExpensiveArt.get(0);
+
+  <span class="code-comment">// <span class="code-object">double</span> the price
+</span>  <span class="code-object">double</span> oldPrice = firstPainting.getEstimatedPrice().doubleValue();
+  firstPainting.setEstimatedPrice(<span class="code-keyword">new</span> BigDecimal(oldPrice * 2.00));
+
+  <span class="code-comment">// create <span class="code-keyword">new</span> painting and register it with DataContext
+</span>  <span class="code-comment">// <span class="code-quote">"Painting"</span> string is a name of ObjEntity in the DataMap
+</span>  Painting newPainting = (Painting)ctxt.newObject(Painting.class);
+  newPainting.setPaintingTitle(<span class="code-quote">"Sunset as it is"</span>);
+
+  <span class="code-comment">// price it as unreasonable as other paintings
+</span>  newPainting.setEstimatedPrice(<span class="code-keyword">new</span> BigDecimal(5000000.0));
+
+  <span class="code-comment">// get artist via relationship
+</span>  Artist artist = firstPainting.getToArtist();
+
+  <span class="code-comment">// assign <span class="code-keyword">new</span> painting to an artist
+</span>  artist.addToPaintingArray(newPainting);
+
+  <span class="code-comment">// save all the changes we've made so far
+</span>  ctxt.commitChanges();
+}
+...</pre>
+</div></div>
+<p>If SQL tracing is turned on, and depending on the preexisting data in the database, the following SQL statements might be printed to console during the commit phase:</p>
+<div class="preformatted"><div class="preformattedContent">
+<pre>[main 12-22 15:50:19] QueryLogger: --- will run 2 queries.
+[main 12-22 15:50:19] QueryLogger: INSERT INTO PAINTING (PAINTING_ID, PAINTING_TITLE, ESTIMATED_PRICE,
+ ARTIST_ID) VALUES (?, ?, ?, ?) [params: 200, 'Sunset as it is', 5000000, 10]
+[main 12-22 15:50:19] QueryLogger: === updated 1 row.
+[main 12-22 15:50:19] QueryLogger: UPDATE PAINTING SET ESTIMATED_PRICE = ? WHERE PAINTING_ID = ? 
+ [params: 2000000, 34]
+[main 12-22 15:50:19] QueryLogger: === updated 1 row.
+[main 12-22 15:50:19] QueryLogger: +++ transaction committed.
+</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 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/DataObjects Example/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Deleting Objects/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataObjects/Deleting%20Objects/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Deleting Objects/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Deleting Objects/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,110 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - Deleting Objects</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.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">Deleting Objects</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/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><ul>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Accessing PK and FK values/index.html">Accessing PK and FK values</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Relationships/index.html">Relationships</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Flattened Relationships/index.html">Flattened Relationships</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObjects Example/index.html">DataObjects Example</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObjectUtils/index.html">DataObjectUtils</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObject Validation/index.html">DataObject Validation</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Handling Inheritance/index.html">Handling Inheritance</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Deleting Objects/index.html">Deleting Objects</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Generic Persistent Class/index.html">Generic Persistent Class</a></li>
+</ul>
+</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/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</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/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>As discussed before, an object must be deleted in the DataContext to trigger a removal of the corresponding row from the database on commit. There are few simple ways to delete individual objects and collections of objects. Quite naturally delete operation changes object state to PersistenceState.DELETED. However there maybe other consequences of such operation for the overall object graph. Such consequences are controlled via <a href="../../../../Documentation/Modeler Guide/Modeling Object Layer/Delete Rules/index.html" title="Delete Rules">delete rules</a> configured for object relationships. Properly configuring delete rules will simplify the application code, as you no longer need to track related objects and do the right thing with them. Other delete rule effects are discussed for each DataContext deletion method individually.</p>
+
+<h5><a name="DeletingObjects-Deletingasingleobject"></a>Deleting a single object</h5>
+<div class="code"><div class="codeContent">
+<pre class="code-java">DataContext context = ...;
+Artist artist = ....;
+
+<span class="code-comment">// <span class="code-keyword">this</span> will trigger delete rules <span class="code-keyword">for</span> artist, <span class="code-keyword">if</span> any
+</span>context.deleteObject(artist);</pre>
+</div></div>
+<h5><a name="DeletingObjects-Deletingacollectionofobjects"></a>Deleting a collection of objects</h5>
+<div class="code"><div class="codeContent">
+<pre class="code-java">DataContext context = ...;
+Artist artist = ....;
+
+context.deleteObjects(artist.getPaintings());</pre>
+</div></div>
+<h5><a name="DeletingObjects-DeletinginanIterator"></a>Deleting in an Iterator</h5>
+<p>This case can be complicated if an iteration is performed over a relationship list and an object being deleted has a nullify delete rule. Such combination may result in ConcurrencyModificationExceptions as collection underlying the iterator is being modified. If ALL objects in the collection have to be deleted, use "deleteObjects()" method shown above - it will do the right thing. If only a subset of collection objects has to be deleted, you can use the following technique:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">DataContext context = ...;
+Artist artist = ....;
+
+Iterator it = artist.getPaintings().iterator();
+<span class="code-keyword">while</span>(it.hasNext()) {
+   DataObject object = it.next();
+   
+   <span class="code-keyword">if</span>(some_condition) {
+      <span class="code-comment">// jump ahead of the delete rule and unset the relationship
+</span>      it.remove();
+   
+      <span class="code-comment">// now <span class="code-keyword">do</span> the actual delete
+</span>      context.deleteObject(object); 
+   }
+}</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 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Deleting Objects/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Flattened Relationships/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataObjects/Flattened%20Relationships/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Flattened Relationships/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Flattened Relationships/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,76 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - Flattened Relationships</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.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">Flattened Relationships</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/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><ul>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Accessing PK and FK values/index.html">Accessing PK and FK values</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Relationships/index.html">Relationships</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Flattened Relationships/index.html">Flattened Relationships</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObjects Example/index.html">DataObjects Example</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObjectUtils/index.html">DataObjectUtils</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObject Validation/index.html">DataObject Validation</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Handling Inheritance/index.html">Handling Inheritance</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Deleting Objects/index.html">Deleting Objects</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Generic Persistent Class/index.html">Generic Persistent Class</a></li>
+</ul>
+</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/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</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/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent">
+<p>Flattened relationships represent relationship between two types of DataObjects that is not direct in the underlying relational storage. Instead it is mapped across one or more "join" tables. Still from the application point of view there is no diffrence in working with flattened relationships compared to the "normal" ones. Cayenne internally figures out how to build the needed query joins to retrieve related objects. On adding or removing an object to/from a flattened relationship via a corresponding "addTo..." / "removeFrom..." method an appropriate join record is created or removed.</p>
+<table cellpadding='5' width='85%' cellspacing='8px' class='infoMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Flattened Relationships Limitations</b><br />Currently only many-to-many flattened relatationships with a single join table can be modified. All other types of flattened relationships can be used as "read-only". This is reflected in the DataObject code generated for such relationships - no set/addTo/RemoveFrom methods are created for read-only relationships.</td></tr></table></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 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Flattened Relationships/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Generic Persistent Class/custom-generic-object.jpg
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataObjects/Generic%20Persistent%20Class/custom-generic-object.jpg?view=auto&rev=488202
==============================================================================
Binary file - no diff available.

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Generic Persistent Class/custom-generic-object.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Generic Persistent Class/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataObjects/Generic%20Persistent%20Class/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Generic Persistent Class/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Generic Persistent Class/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,143 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - Generic Persistent Class</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.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">Generic Persistent Class</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/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><ul>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Accessing PK and FK values/index.html">Accessing PK and FK values</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Relationships/index.html">Relationships</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Flattened Relationships/index.html">Flattened Relationships</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObjects Example/index.html">DataObjects Example</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObjectUtils/index.html">DataObjectUtils</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObject Validation/index.html">DataObject Validation</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Handling Inheritance/index.html">Handling Inheritance</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Deleting Objects/index.html">Deleting Objects</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Generic Persistent Class/index.html">Generic Persistent Class</a><ul>
+</ul>
+</li>
+</ul>
+</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/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</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/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p><em>(available since 1.2M9)</em></p>
+
+<p><a href="http://cwiki.apache.org/confluence/confluence/display/CAY/Generic+DataObjects+Example" title="Generic DataObjects Example">Download the example code</a></p>
+
+<h2><a name="GenericPersistentClass-WhatIs%22GenericPersistentClass%22"></a>What Is "Generic Persistent Class"</h2>
+
+<p>Each kind of persistent objects (such as "Artist" or "Painting") is described in Cayenne by a single ObjEntity. The most common and useful scenario is mapping an ObjEntity to a "specialized" Java class, one class per entity. But there is an alternative - use a single generic persistent object class to map any entity.</p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='tipMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Generic DataObject hints</b><br />
+<ul>
+	<li>Accessing generic objects is done via DataObject API (see examples below).</li>
+	<li>The simplest "generic" object class for all practical purposes is <tt>CayenneDataObject</tt>.</li>
+	<li>"Concrete" DataObject classes are by definition "generic" as they implement <tt>DataObject</tt>.</li>
+</ul>
+</td></tr></table>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='tipMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">When to Use Generic Objects</b><br />Generic objects are not type-safe and are not convenient for manual coding. Most applications should stick to concrete classes. Generic objects are useful in cases when all persistent properties are not fully known at compile time. It is also possible to use a hybrid approach when new persistent properties are added to the existing concrete class at runtime.</td></tr></table>
+
+<h2><a name="GenericPersistentClass-MappinginCayenneModeler"></a>Mapping in CayenneModeler</h2>
+
+<p>If you don't enter anything for Java Class of an ObjEntity, Cayenne assumes generic mapping and uses the following implicit rules to determine a class of a generic object. First it will check whether a DataMap "Custom Superclass" is set. If so, runtime uses this class to instantiate new objects. If not, <tt>org.apache.cayenne.CayenneDataObject</tt> is used.</p>
+
+<p><img src="custom-generic-object.jpg" align="absmiddle" border="0" /></p>
+
+<p>CayenneModeler and Ant class generators skip ObjEntities that are mapped to CayenneDataObject explicitly or have no class mapping (i.e. implicitly mapped to a generic class).</p>
+
+
+<h2><a name="GenericPersistentClass-HowtoUseGenericDataObjects"></a>How to Use Generic DataObjects</h2>
+
+<h4><a name="GenericPersistentClass-UseStringentitynameinplaceswhereyouwouldpreviouslyuseJavaclassasamethodargumenttogetaholdofaDataObject."></a>Use String <em>entity name</em> in places where you would previously use Java class as a method argument to get a hold of a DataObject.</h4>
+
+<p>Create a new object:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">DataObject author = context.newObject(<span class="code-quote">"Person"</span>);</pre>
+</div></div>
+
+<p>Build SelectQuery:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">Expression e = ExpressionFactory.likeIgnoreCaseExp(<span class="code-quote">"subject"</span>, <span class="code-quote">"%first%"</span>);
+SelectQuery q = <span class="code-keyword">new</span> SelectQuery(<span class="code-quote">"Message"</span>, e);</pre>
+</div></div>
+
+<h4><a name="GenericPersistentClass-UseDataObjectAPItoread%2Fwritethevaluesinsteadorgetters%2Fsetters."></a>Use DataObject API to read/write the values instead or getters/setters.</h4>
+
+<p>Determine object entity name:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">DataObject object = ...;
+<span class="code-object">String</span> entityName = object.getObjectId().getEntityName();</pre>
+</div></div>
+
+<p>Read a simple property value (attribute or relationship):</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-object">String</span> subject = (<span class="code-object">String</span>) object.readProperty(<span class="code-quote">"subject"</span>);</pre>
+</div></div>
+
+<p>Read a "nested" property value spanning a chain of DataObjects:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-object">String</span> name = (<span class="code-object">String</span>) object.readNestedProperty(<span class="code-quote">"author.lastName"</span>);</pre>
+</div></div>
+
+<p>Modify a property value:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">object.writeProperty(<span class="code-quote">"subject"</span>, <span class="code-quote">"Post On Topic"</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 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Generic Persistent Class/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Handling Inheritance/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataObjects/Handling%20Inheritance/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Handling Inheritance/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Handling Inheritance/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,159 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - Handling Inheritance</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.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">Handling Inheritance</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/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><ul>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Accessing PK and FK values/index.html">Accessing PK and FK values</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Relationships/index.html">Relationships</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Flattened Relationships/index.html">Flattened Relationships</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObjects Example/index.html">DataObjects Example</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObjectUtils/index.html">DataObjectUtils</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObject Validation/index.html">DataObject Validation</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Handling Inheritance/index.html">Handling Inheritance</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Deleting Objects/index.html">Deleting Objects</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Generic Persistent Class/index.html">Generic Persistent Class</a></li>
+</ul>
+</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/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</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/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent">
+<p>"Inheritance" is an Object Oriented concept absent in traditional RDBMS. Cayenne however allows to map a hierarchical class tree to a single base table (so called "single table inheritance"). Such mapping is described in detail in the <a href="../../../../Documentation/Modeler Guide/Modeling Object Layer/Modeling Inheritance/index.html" title="Modeling Inheritance">Modeler Guide</a>. The idea of single table inheritance is that a "class" of a database row is determined from the values in one or more columns of the base table. These columns are called "class designator columns".</p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='infoMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Initial Values of the Classs Designator Columns</b><br />Assigning correct values to the "class designator columns" mentioned above is one task that is not yet automated in Cayenne and requires user code in the DataObject, as discussed in the next subsection. In the future versions this will likely be handled in the mapping and completely outside of the Java classes, so the advise below will become obsolete.</td></tr></table>
+
+<h3><a name="HandlingInheritance-InheritanceandnewDataObjects"></a>Inheritance and new DataObjects</h3>
+<p>Consider the following class hierarchy (also used in the Modeler Guide example):<br/>
+<img src="inheritance-diagram.jpg" align="absmiddle" border="0" /></p>
+
+<p>If a class designator column is "PERSON_TYPE", AbstractPerson class should define an attribute (for instance called "personType") that maps to PERSON_TYPE. This attribute is redundant and meanigless in Java, since person type is defined already by the Java class of the object, however we still have to keep it around so that when the new objects are saved, correct PERSON_TYPE data is stored in the database. Currently it is a developer responsibility to set "personType" value (or values of any other attributes that map to "class designator columns") when the new object is registered with DataContext. One way to take care of this is to override "setPersistenceState(..)" method on each DataObject class in the inheritance hierarchy to catch when the object is registered with DataContext:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">public</span> class Employee <span class="code-keyword">extends</span> _Employee {
+    <span class="code-keyword">public</span> void setPersistenceState(<span class="code-object">int</span> state) {
+        <span class="code-keyword">super</span>.setPersistenceState(state);
+        
+        <span class="code-comment">// <span class="code-keyword">if</span> object was just created
+</span>        <span class="code-keyword">if</span>(state == PersistenceState.NEW) {
+           setPersonType(<span class="code-quote">"EMPLOYEE"</span>);
+        }
+    }
+...
+}
+
+<span class="code-keyword">public</span> class Manager <span class="code-keyword">extends</span> _Manager {
+    <span class="code-keyword">public</span> void setPersistenceState(<span class="code-object">int</span> state) {
+        <span class="code-keyword">super</span>.setPersistenceState(state);
+        
+        <span class="code-comment">// <span class="code-keyword">if</span> object was just created
+</span>        <span class="code-keyword">if</span>(state == PersistenceState.NEW) {
+           setPersonType(<span class="code-quote">"MANAGER"</span>);
+        }
+    }
+...
+}
+
+<span class="code-keyword">public</span> class CustomerContact <span class="code-keyword">extends</span> _CustomerContact {
+    <span class="code-keyword">public</span> void setPersistenceState(<span class="code-object">int</span> state) {
+        <span class="code-keyword">super</span>.setPersistenceState(state);
+        
+        <span class="code-comment">// <span class="code-keyword">if</span> object was just created
+</span>        <span class="code-keyword">if</span>(state == PersistenceState.NEW) {
+           setPersonType(<span class="code-quote">"CUSTOMER"</span>);
+        }
+    }
+...
+}</pre>
+</div></div>
+
+<h3><a name="HandlingInheritance-InheritanceandSelectQueries"></a>Inheritance and SelectQueries</h3>
+<p>When performing SelectQuery on a table that maps to inheritance hierarchy, Cayenne will only return rows that belong to root class of the query and all its subclasses. No superclasses or objects from parallel inheritance branches will be returned. For example executing a SelectQuery with Employee class as root will potentially return a mix of Employees and Managers (who are also Employees of course), but no CustomerContact objects:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java">DataContext context;
+...
+SelectQuery query = <span class="code-keyword">new</span> SelectQuery(Employee.class);
+List employees = context.performQuery(query);
+ 
+<span class="code-comment">// employees list will contain <span class="code-quote">"regular"</span> employees and managers
+</span>Iterator it = employees.iterator();
+<span class="code-keyword">while</span>(it.hasNext()) {
+   Employee e = (Employee) it.next();
+   <span class="code-keyword">if</span>(e <span class="code-keyword">instanceof</span> Manager) {
+   	<span class="code-comment">// <span class="code-keyword">do</span> something with manager...
+</span>   }
+}</pre>
+</div></div>
+
+<p>The need to determine the correct class for each fetched database row makes queries on entities that use inheritance less efficient than the regular queries. If an application doesn't care about the query root class subclasses, the query can be optimized by explicitly turning off inheritance resolution. If this is done, the example above will return all Managers as instances of Employee class, not Manager class:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">DataContext context;
+...
+SelectQuery query = <span class="code-keyword">new</span> SelectQuery(Employee.class);
+ 
+<span class="code-comment">// *** explicitly turn off inheritance resolution
+</span>query.setResolvingInherited(<span class="code-keyword">false</span>);
+ 
+List employees = context.performQuery(query);
+ 
+<span class="code-comment">// employees list will contain no Manager instances...
+</span><span class="code-comment">// all Managers will be returned as regular Employees</span></pre>
+</div></div>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='infoMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>Whenever an object is obtained via a relationship, it is always fully resolved to the lowest possible subclass in an entity inheritance tree.</td></tr></table>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='warningMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>Use <tt>setResolvingInherited(false)</tt> with caution, and only if you never plan to work with subclasses. The downside of it is that the DataContext may end up with two objects pointing to the same database row, thus violating uniquing principle. With the above example, this may happen if at a later time user decides to fetch Managers directly, or if a Manager object is obtained via a relationship.</td></tr></table></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 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Handling Inheritance/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Handling Inheritance/inheritance-diagram.jpg
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataObjects/Handling%20Inheritance/inheritance-diagram.jpg?view=auto&rev=488202
==============================================================================
Binary file - no diff available.

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Handling Inheritance/inheritance-diagram.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Relationships/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataObjects/Relationships/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Relationships/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Relationships/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,115 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - Relationships</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.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">Relationships</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/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><ul>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Accessing PK and FK values/index.html">Accessing PK and FK values</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Relationships/index.html">Relationships</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Flattened Relationships/index.html">Flattened Relationships</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObjects Example/index.html">DataObjects Example</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObjectUtils/index.html">DataObjectUtils</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/DataObject Validation/index.html">DataObject Validation</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Handling Inheritance/index.html">Handling Inheritance</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Deleting Objects/index.html">Deleting Objects</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/Generic Persistent Class/index.html">Generic Persistent Class</a></li>
+</ul>
+</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/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</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/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>Relationships are special DataObject properties that reference other "related" objects. Semantically there are two types of relationships - to-one pointing to just a single DataObjects (e.g. Painting.toArtist), and to-many pointing to a collection of DataObjects of the same base type (e.g. Artist.paintingArray).</p>
+
+<h3><a name="Relationships-ToOneRelationships"></a>To-One Relationships</h3>
+
+<p>"Get" methods for to-one relationships return the target DataObject. If the object is not in memory yet, it will be fetched on demand. Modifying to-one relationships is no different from modifying attributes - just a simple call to a "set" method:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java">Painting painting;
+
+<span class="code-comment">// obtain artist <span class="code-keyword">for</span> a given painting
+</span>Artist originalArtist = painting.getToArtist();
+
+<span class="code-comment">// replace with a <span class="code-keyword">new</span> artist
+</span>Artist newArtist = (Artist)context.createAndRegisterNewObject(Artist.class);
+painting.setToArtist(newArtist);
+
+<span class="code-comment">// or remove Artist at all...
+</span><span class="code-comment">// painting.setToArtist(<span class="code-keyword">null</span>);</span></pre>
+</div></div>
+<table cellpadding='5' width='85%' cellspacing='8px' class='infoMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>
+<p>When adding or removing an object from any kind of relationship, Cayenne will locate and modify an existing reverse relationship as appropriate.</p></td></tr></table>
+
+<h3><a name="Relationships-ToManyRelationships"></a>To-Many Relationships</h3>
+
+<p>"Get" methods for to-many relationships return Lists of DataObjects. Just like individual DataObjects, such lists are also resolved on demand (e.g. when a user tries to read an element from the list). For modification there are special "addTo..." and "removeFrom..." methods:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java">Artist artist;
+
+<span class="code-comment">// obtain a list of paintings
+</span>List paintings = artist.getPaintingArray();
+
+<span class="code-comment">// remove the first painting
+</span><span class="code-keyword">if</span>(paintings.size() &gt; 0) {
+   Painting firstPainting = (Painting)paintings.get(0);
+   artist.removeFromPaintingArray(firstPainting);
+}
+
+<span class="code-comment">// add a <span class="code-keyword">new</span> painting
+</span>Painting newPainting = (Painting)context.createAndRegisterNewObject(Painting.class);
+artist.addToPaintingArray(newPainting);</pre>
+</div></div>
+<table cellpadding='5' width='85%' cellspacing='8px' class='infoMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>
+<p>While to-many relationships in Cayenne are represented by Lists, they are really ordered Sets, as they are not allowed to contain the same object more than once.</p></td></tr></table></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 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/Relationships/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataObjects/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,78 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - DataObjects</title>
+    <style type="text/css">@import "../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.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">DataObjects</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/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><ul>
+<li><a href="../../../Documentation/User Guide/DataObjects/Accessing PK and FK values/index.html">Accessing PK and FK values</a></li>
+<li><a href="../../../Documentation/User Guide/DataObjects/Relationships/index.html">Relationships</a></li>
+<li><a href="../../../Documentation/User Guide/DataObjects/Flattened Relationships/index.html">Flattened Relationships</a></li>
+<li><a href="../../../Documentation/User Guide/DataObjects/DataObjects Example/index.html">DataObjects Example</a></li>
+<li><a href="../../../Documentation/User Guide/DataObjects/DataObjectUtils/index.html">DataObjectUtils</a></li>
+<li><a href="../../../Documentation/User Guide/DataObjects/DataObject Validation/index.html">DataObject Validation</a></li>
+<li><a href="../../../Documentation/User Guide/DataObjects/Handling Inheritance/index.html">Handling Inheritance</a></li>
+<li><a href="../../../Documentation/User Guide/DataObjects/Deleting Objects/index.html">Deleting Objects</a></li>
+<li><a href="../../../Documentation/User Guide/DataObjects/Generic Persistent Class/index.html">Generic Persistent Class</a></li>
+</ul>
+</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/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</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/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>DataObjects (Cayenne persistent objects) are composed of attributes and relationships. Attributes are the simplest object properties (as in "java bean properties") that can be stored in the columns in the database. Those are usually string, numeric, binary or date values. Another type of properties is relationships. They represent related DataObjects (to-one relationships) or collections of DataObjects (to-many relationships). To read and modify attributes and relationships, application code would simply invoke corresponding get or set methods. In case of to-many relationships represented by collections there are also add and remove methods.</p>
+
+<p>Queries discussed in the previous chapter are used to obtain the initial sets of DataObjects. After that a graph of persistent objects is navigated and modified via relationship methods, thus hiding the underlying relational storage complexity and giving application a nice object view of the relevant subset of the database data.</p>
+
+<p>Examples of working with attributes and relationships are given later in this chapter.</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 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataObjects/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DVModeler GUI Tool/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataViews/DVModeler%20GUI%20Tool/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DVModeler GUI Tool/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DVModeler GUI Tool/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,82 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - DVModeler GUI Tool</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.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">DVModeler GUI Tool</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/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/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</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/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a><ul>
+<li><a href="../../../../Documentation/User Guide/DataViews/Swing Applications/index.html">Swing Applications</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/DataView Concepts/index.html">DataView Concepts</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/DVModeler GUI Tool/index.html">DVModeler GUI Tool</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/DataViews/DataViews in Action/index.html">DataViews in Action</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>DVModeler is a Java GUI tool to work with DataViews configuration included in Cayenne projects. Steps needed to start DVModeler are similar to that of CayenneModeler. Main class is <tt>org.apache.cayenne.dataview.dvmodeler.Main</tt>. For convenience Cayenne distribution provides run scripts to start DVModeler on Windows and UNIX platforms. To take advantage of these scripts, user must set CAYENNE_HOME (optional) and JAVA_HOME environment variables as described in <a href="../../../../Documentation/User Guide/Installation/index.html" title="Installation">Installation</a>.</p>
+
+<p>To run DVModeler, simply doubleclick the appropriate script. Alternatively it can be run from the command line.</p>
+
+<p>Windows:</p>
+<div class="preformatted"><div class="preformattedContent">
+<pre>%CAYENNE_HOME%\bin\dvmodeler.bat
+</pre>
+</div></div>
+<p>UNIX:</p>
+<div class="preformatted"><div class="preformattedContent">
+<pre>$CAYENNE_HOME/bin/dvmodeler.sh
+</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 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DVModeler GUI Tool/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/cell-editors1.gif
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataViews/DataView%20Concepts/cell-editors1.gif?view=auto&rev=488202
==============================================================================
Binary file - no diff available.

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/cell-editors1.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/cell-renderers.gif
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataViews/DataView%20Concepts/cell-renderers.gif?view=auto&rev=488202
==============================================================================
Binary file - no diff available.

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/cell-renderers.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/dataview-structure.gif
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataViews/DataView%20Concepts/dataview-structure.gif?view=auto&rev=488202
==============================================================================
Binary file - no diff available.

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/dataview-structure.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/dataview-usecases.gif
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataViews/DataView%20Concepts/dataview-usecases.gif?view=auto&rev=488202
==============================================================================
Binary file - no diff available.

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/dataview-usecases.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/domodels.gif
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataViews/DataView%20Concepts/domodels.gif?view=auto&rev=488202
==============================================================================
Binary file - no diff available.

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/domodels.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/format-factory.gif
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataViews/DataView%20Concepts/format-factory.gif?view=auto&rev=488202
==============================================================================
Binary file - no diff available.

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/format-factory.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/index.html
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User%20Guide/DataViews/DataView%20Concepts/index.html?view=auto&rev=488202
==============================================================================
--- incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/index.html (added)
+++ incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/index.html Mon Dec 18 02:24:19 2006
@@ -0,0 +1,115 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+ 
+     http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<html>
+  <head>
+    <title>Apache Cayenne Documentation - DataView Concepts</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://incubator.apache.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">DataView Concepts</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/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/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</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/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a><ul>
+<li><a href="../../../../Documentation/User Guide/DataViews/Swing Applications/index.html">Swing Applications</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/DataView Concepts/index.html">DataView Concepts</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/User Guide/DataViews/DVModeler GUI Tool/index.html">DVModeler GUI Tool</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/DataViews in Action/index.html">DataViews in Action</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div id="ConfluenceContent">
+<h3><a name="DataViewConcepts-DataViewHierarchy"></a>DataView Hierarchy</h3>
+
+<p>The class diagram on the figure below captures the structure of Data Views and how they rely on the classes in the Cayenne subpackages. Single DataView object is the root of the hierarchy. It serves as a container for ObjEntityViews from one or more DataView configuration files. Just like entities in the DataMaps, ObjEntityViews can freely refer to each other whether they are defined in the same configuration file or different ones. The recommended practice is to store closely related ObjEntityViews in the same XML "module" and define several "modules" based on the criterion of such closeness. When you load the list of XML files into the DataView, all the relationships are resolved automatically and the ObjEntityViews share the same namespace (so they must have different names even if they are located in different XML files).</p>
+
+<p>The diagram also shows that DataView is associated with several classes such as EntityResolver, DataTypeSpec, FormatFactory. The instances of these classes participate in the process of loading actual Data View files.</p>
+
+<p>The main unit of any Data View is ObjEntityView. It always refers to an ObjEntity defined in one of the used DataMaps and defines various presentation rules for this entity. There can be several ObjEntityViews for an ObjEntity, each of them utilized by an application when appropriate. EntityResolver finds the corresponding ObjEntities by the names as the Data View is being loaded. Every ObjEntityView must have a name unique in the DataView context.</p>
+
+<p>ObjEntityViews contain fields called ObjEntityViewFields. They must be named uniquely within an ObjEntityView. The fields can be of two sorts. The regular "nocalc" fields reference ObjAttributes in the ObjEntity referred by the parent ObjEntityView. There may be several fields for a given ObjAttribute in the ObjEntityView. A field describes the following view parameters:</p>
+
+<ul>
+	<li>How the related ObjAttribute should be rendered and edited.</li>
+	<li>The data type and the formats to use in the presentation layer.</li>
+	<li>The caption that is usually used to name a table column or to label an input control in a form.</li>
+	<li>Editability and visibility of the attribute</li>
+	<li>An order in which the fields appear as columns in a JTable or in a form with the preferred index.</li>
+</ul>
+
+
+<p>The other type of ObjEntityViewFields is "lookup" fields. They point to the fields defined in other ObjEntityViews so the actual values to display, edit, or select from come from those referenced fields. Such a lookup field corresponds to an ObjRelationship with the ObjEntity referred by this its ObjEntityView as a source and the ObjEntity referred by the lookup ObjEntityView as a target instead of an ObjAttribute. Next the field identifies which lookup ObjEntityView and which particular field it wants to use as a lookup. These dependencies are resolved when the data views are loaded into memory. Class LookupCache helps maintain and map to data objects lists of values used in lookup combo boxes and lists. Thus you can describe the rules of visual editing the relationships or make aggregated views base on the related entities.<br/>
+<img src="format-factory.gif" align="absmiddle" border="0" /></p>
+
+
+<h3><a name="DataViewConcepts-FieldDataTypes"></a>Field Data Types</h3>
+<p>Cayenne defines the mapping between several Java Class types and JDBC types. It is convenient to use and sufficient in many cases but there are all sorts of situations when one would like to define more specific data types to make use of, especially for the presentation purposes. In many cases when Integer is used as a flag you would like to map it to Boolean. Or you may have a Money type or Date type that holds only year, month, and day values, and so forth.</p>
+
+<p>ObjEntityViewFields address that by providing an easily extensible system of data types often used in the business applications. This system takes care of converting values back and forth between Cayenne data types and application specific data types. It relies on two classes DataTypeEnum and DataTypeSpec, both of them can be extended to define new types of any sorts. While the entire thing may seem redundant at the first glance, actually, it is a powerful concept that can save a lot of time spent on the manual conversions.</p>
+
+<h3><a name="DataViewConcepts-FormatFactory"></a>FormatFactory</h3>
+<p>FormatFactory shown on the next figure provides the means to create instances of the edit and display formats used by ObjEntityViewFields. There are several formats defined in the java.text package. In addition the dataview library defines convenient MapFormat somewhat similar to java.text.ChoiceFormat. instead of formatting doubles by inclusion in range criterion as ChoiceFormat does it maps a set of objects of any type to string values. For example you can map Booleans to "Sure" and "No way" strings or you can map String keys to some descriptive String values, etc. It is easy for users to add custom formats of their own. They should subclass FormatFactory and create new Builders for their formats. That done, all they need is to configure the display and edit formats in ObjEntityViewFields with the class names of their Format classes and the patterns (and, maybe, some other properties).<br/>
+<img src="format-factory.gif" align="absmiddle" border="0" /></p>
+
+
+<h3><a name="DataViewConcepts-CellRenderersandCellEditors"></a>CellRenderers and CellEditors</h3>
+<p>The following figure presents the utility class CellRenderers and several ready-to-use cell renderers for different types of ObjEntityViewFields. They are used in JTables, JLists, and JComboBoxes. The methods defined in the CellRenderers class will save your time when configuring a JTable to render values of the types available for use with ObjEntityViewFields<br/>
+<img src="cell-renderers.gif" align="absmiddle" border="0" /></p>
+
+<p>The purpose of CellEditors is the same as that of CellRenderers. The editors are used when there is a need to edit data in JTables and such.<br/>
+<img src="cell-editors1.gif" align="absmiddle" border="0" /></p>
+
+<p>The convenient notion of DataObjectList is defined in the library. It is a specialized container to store Cayenne DataObjects (usually of the same type). It fires events when modified and DOTableModel, DOListModel, DOComboBoxModel wrap it and being configured with an ObjEntityView / Field are handy to provide access to these data objects with JTables, JLists, and JComboBoxes. In fact, they make the visual components data aware.<br/>
+<img src="domodels.gif" align="absmiddle" border="0" /></p>
+
+
+<h3><a name="DataViewConcepts-MiscellaneousFeatures"></a>Miscellaneous Features</h3>
+<p>One more useful feature is a centralized EventDispatcher within the DataView class. It is used by the fields to fire the events whenever their values are changed. Thus the ObjAttribute/ObjRelationship modifications can be easily propagated to all the listening components. </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 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: incubator/cayenne/main/trunk/assembly/cayenne-generic/src/doc/confluence/Documentation/User Guide/DataViews/DataView Concepts/index.html
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message