You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2009/12/25 22:15:22 UTC

svn commit: r893886 [4/6] - in /cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation: ./ Cayenne Guide/ Cayenne Guide/Ant Tasks/ Cayenne Guide/Ant Tasks/cdataport/ Cayenne Guide/Ant Tasks/cdbgen/ Cayenne Guide/Ant Tasks/cdbimp...

Copied: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/index.html (from r893884, cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial Object Relational Mapping/index.html)
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Object%20Relational%20Mapping/index.html?p2=cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Object%20Relational%20Mapping/index.html&p1=cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Quick%20Start/Tutorial%20Object%20Relational%20Mapping/index.html&r1=893884&r2=893886&rev=893886&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial Object Relational Mapping/index.html (original)
+++ cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/index.html Fri Dec 25 21:15:02 2009
@@ -31,19 +31,18 @@
 <ul>
 <li><a href="../../../../Documentation/Cayenne Guide/Introduction/index.html">Introduction</a></li>
 <li><a href="../../../../Documentation/Cayenne Guide/Installation/index.html">Installation</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/index.html">Quick Start</a><ul>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Setup/index.html">Tutorial Setup</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Starting Mapping Project/index.html">Tutorial Starting Mapping Project</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Object Relational Mapping/index.html">Tutorial Object Relational Mapping</a><ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/index.html">Tutorial</a><ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Setup/index.html">Tutorial Setup</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/index.html">Tutorial Starting Project</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/index.html">Tutorial Object Relational Mapping</a><ul>
 </ul>
 </li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Generate Database and Java Classes/index.html">Tutorial Generate Database and Java Classes</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial DataContext/index.html">Tutorial DataContext</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial DataObjects/index.html">Tutorial DataObjects</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Mapping Query/index.html">Tutorial Mapping Query</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial SelectQuery/index.html">Tutorial SelectQuery</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Delete/index.html">Tutorial Delete</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Webapp/index.html">Tutorial Webapp</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Java Classes/index.html">Tutorial Java Classes</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial ObjectContext/index.html">Tutorial ObjectContext</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Persistent Objects/index.html">Tutorial Persistent Objects</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial SelectQuery/index.html">Tutorial SelectQuery</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Delete/index.html">Tutorial Delete</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Webapp/index.html">Tutorial Webapp</a></li>
 </ul>
 </li>
 <li><a href="../../../../Documentation/Cayenne Guide/Design/index.html">Design</a></li>
@@ -61,22 +60,23 @@
 <li><a href="../../../../Documentation/Cayenne Guide/Customization/index.html">Customization</a></li>
 </ul>
 </div>
-<div id="ConfluenceContent">
-<p>Lets go back to CayenneModeler where we have the newly created project open. Our goal is to map the following schema:</p>
+<div id="ConfluenceContent"><p>The goal of this section is to learn how to create a simple Object-Relational model with CayenneModeler. We will create a complete ORM model for the following database schema:</p>
 
 <p><img src="database-schema.jpg" align="absmiddle" border="0" /></p>
 
-<h3><a name="TutorialObjectRelationalMapping-MappingDatabaseTables"></a>Mapping Database Tables</h3>
+<div class='panelMacro'><table class='noteMacro'><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>Very often you'd have an existing database already, and it can be quickly imported in Cayenne via <tt>"Tools &gt; Reengineer Database Schema"</tt>. This will save you lots of time compared to manual mapping. However understanding how to create the mapping by hand is important, so we are showing the "manual" approach below.</td></tr></table></div>
 
-<p>Start by adding the ARTIST table. Mapped database tables are called "DbEntities" in Cayenne. Click on "Create DbEntity" button (or use <tt>"Project &gt; Create DbEntity"</tt> menu). In "DbEntity Name" field enter "ARTIST". Then click on "Create Attribute" button on the entity toolbar (second button on the right). This action changes the view to the "Attribute" tab and adds a new attribute (attribute means a "table column" in this case) called "untitledAttr". Let's rename it to ID, make it an INTEGER and make it a PK:</p>
+<h3><a name="TutorialObjectRelationalMapping-MappingDatabaseTablesandColumns"></a>Mapping Database Tables and Columns</h3>
 
-<p><img src="modeler-artistid.jpg" align="absmiddle" border="0" /></p>
+<p>Lets go back to CayenneModeler where we have the newly created project open and start by adding the ARTIST table. Database tables are called <b>"DbEntities"</b> in Cayenne mapping (those can be actual tables or database views). </p>
 
-<p>Similarly add NAME VARCHAR and DATE_OF_BIRTH DATE attributes. </p>
+<p>Select "UntitledDomainMap" on the left-hand side project tree and click "Create DbEntity" button (or use <tt>"Project &gt; Create DbEntity"</tt> menu). A new DbEntity is created. In "DbEntity Name" field enter "ARTIST". Then click on "Create Attribute" button on the entity toolbar (third button from the left). This action changes the view to the "Attribute" tab and adds a new attribute (attribute means a "table column" in this case) called "untitledAttr". Let's rename it to ID, make it an INTEGER and make it a PK:</p>
 
-<p>Repeat this procedure for PAINTING and GALLERY entities.</p>
+<p><img src="modeler-artistid.png" align="absmiddle" border="0" /></p>
 
-<p><img src="modeler-gallery.jpg" align="absmiddle" border="0" /></p>
+<p>Similarly add NAME VARCHAR(200) and DATE_OF_BIRTH DATE attributes.  After that repeat this procedure for PAINTING and GALLERY entities to match DB schema shown above.</p>
+
+<div class='panelMacro'><table class='noteMacro'><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>Don't forget to save your project periodically to avoid losing your work. You will also have to refresh the project in Eclipse after every CayenneModeler save, as Eclipse is by default unaware of any changes made in the Modeler.</td></tr></table></div>
 
 <h3><a name="TutorialObjectRelationalMapping-MappingDatabaseRelationships"></a>Mapping Database Relationships</h3>
 
@@ -84,7 +84,7 @@
 
 <ul>
 	<li>Select the ARTIST DbEntity on the left and click on the "Relationships" tab.</li>
-	<li>Click on "Create Relationship" button on the entity toolbar - a relationship called "untitledRel" is created.</li>
+	<li>Click on "Create Relationship" button on the entity toolbar (second button from the left) - a relationship called "untitledRel" is created.</li>
 	<li>Choose the "Target" to be "Painting".</li>
 	<li>Click on the "Database Mapping" button (letter "I" in a circle) - relationship configuration dialog is presented. Here you can assign a name to the relationship and also its complimentary reverse relationship. This name can be anything (this is really a symbolic name of the database referential constraint), but it is recommended to use a valid Java identifier, as this will save some typing later. We'll call the relationship "paintings" and reverse relationship "artist".</li>
 	<li>Click on "Add" button on the right to add a join</li>
@@ -93,11 +93,11 @@
 </ul>
 
 
-<p><img src="modeler-dbrel-dialog.jpg" align="absmiddle" border="0" /></p>
+<p><img src="modeler-dbrelationship.png" align="absmiddle" border="0" /></p>
 
 <ul>
 	<li>Click "Done" to confirm the changes and close the dialog.</li>
-	<li>Two complimentary relationships have been created - from ARTIST to PAINTING and vice versa. Still you may have noticed one glitch - "paintings" relationship should be to-many, but "To Many" checkbox is not checked. Let's change that - check the checkbox for "paintings" relationship, and then click on PAINTING DbEntity, and uncheck "artist" relationship "To Many" to make the reverse relationship "to-one" as it should be.</li>
+	<li>Two complimentary relationships have been created - from ARTIST to PAINTING and back. Still you may have noticed one thing is missing - "paintings" relationship should be to-many, but "To Many" checkbox is not checked. Let's change that - check the checkbox for "paintings" relationship, and then click on PAINTING DbEntity, and uncheck "artist" relationship "To Many" to make the reverse relationship "to-one" as it should be.</li>
 	<li>Repeat the steps above to create a many-to-one relationship from PAINTING to GALLERY, calling the relationships pair "gallery" and "paintings".</li>
 </ul>
 
@@ -109,8 +109,13 @@
 <ul>
 	<li>Select "ARTIST" DbEntity and click on "Create ObjEntity" button (a green class icon) either on the entity toolbar or on the main toolbar. An ObjEntity called "Artist" is created with a Java class field set to "cayenne.tutorial.Artist". The modeler transformed the database names to the Java-friendly names (e.g., if you click on the "Attributes" tab, you'll see that "DATE_OF_BIRTH" column was converted to "dateOfBirth" Java class attribute).</li>
 	<li>Select "GALLERY" DbEntity and click on "Create ObjEntity" button again - you'll see a "Gallery" ObjEntity created.</li>
-	<li>Do the same thing again for "PAINTING".<br/>
-Now you need to synchronize relationships. Artist and Gallery entities were created when there was no related "Painting" entity, so their relationships were not set. </li>
+	<li>Finally, do the same thing for "PAINTING".</li>
+</ul>
+
+
+<p>Now you need to synchronize relationships. Artist and Gallery entities were created when there was no related "Painting" entity, so their relationships were not set. </p>
+
+<ul>
 	<li>Click on the "Artist" ObjEntity and (optinally) change to the "Relationships" tab. Now click on "Sync ObjEntity with DbEntity" button on the toolbar (two yellow arrows) - you will see the "paintings" relationship appear.</li>
 	<li>Do the same for the "Gallery" entity.</li>
 </ul>
@@ -119,14 +124,14 @@
 <p>Unless you want to customize the Java class and property names (which you can do easily) the mapping is complete. </p>
 
 <hr />
-<p><b>Next Step: <a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Generate Database and Java Classes/index.html" title="Tutorial Generate Database and Java Classes">Tutorial Generate Database and Java Classes</a></b></p>
+<p><b>Next Step: <a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Java Classes/index.html" title="Tutorial Java Classes">Tutorial Java Classes</a></b></p>
 <hr /></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-2008 Apache Software Foundation
+    Copyright &copy;2001-2010 Apache Software Foundation
   </div>
 
 </body>

Added: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/modeler-artistid.png
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Object%20Relational%20Mapping/modeler-artistid.png?rev=893886&view=auto
==============================================================================
Files cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/modeler-artistid.png (added) and cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/modeler-artistid.png Fri Dec 25 21:15:02 2009 differ

Added: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/modeler-dbrelationship.png
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Object%20Relational%20Mapping/modeler-dbrelationship.png?rev=893886&view=auto
==============================================================================
Files cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/modeler-dbrelationship.png (added) and cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/modeler-dbrelationship.png Fri Dec 25 21:15:02 2009 differ

Added: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial ObjectContext/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20ObjectContext/index.html?rev=893886&view=auto
==============================================================================
--- cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial ObjectContext/index.html (added)
+++ cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial ObjectContext/index.html Fri Dec 25 21:15:02 2009
@@ -0,0 +1,169 @@
+<!--
+   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 - Tutorial ObjectContext</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://cayenne.apache.org/"><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">Tutorial ObjectContext</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/index.html">Tutorial</a><ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Setup/index.html">Tutorial Setup</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/index.html">Tutorial Starting Project</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/index.html">Tutorial Object Relational Mapping</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Java Classes/index.html">Tutorial Java Classes</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial ObjectContext/index.html">Tutorial ObjectContext</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Persistent Objects/index.html">Tutorial Persistent Objects</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial SelectQuery/index.html">Tutorial SelectQuery</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Delete/index.html">Tutorial Delete</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Webapp/index.html">Tutorial Webapp</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/Cayenne Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Customization/index.html">Customization</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>In this section we'll write a simple main class to run our application, and get a brief introduction to Cayenne ObjectContext.</p>
+
+<h3><a name="TutorialObjectContext-CreatingtheMainClass"></a>Creating the Main Class</h3>
+
+<ul>
+	<li>In Eclipse create a new class called "Main" in the <tt>"org.example.cayenne"</tt> package.</li>
+	<li>Create a standard "main" method to make it a runnable class:</li>
+</ul>
+
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java"><span class="code-keyword">package</span> org.example.cayenne;
+
+<span class="code-keyword">public</span> class Main {
+
+	<span class="code-keyword">public</span> <span class="code-keyword">static</span> void main(<span class="code-object">String</span>[] args) {
+
+	}
+}</pre>
+</div></div>
+
+<ul>
+	<li>The first thing you need to be able to access the database is an instance of an <tt>ObjectContext</tt>. In this simple case of a standalone command-line application, it can be obtained by calling a static method on a <a href="../../../../Documentation/Cayenne Guide/DataContext/index.html" title="DataContext">DataContext</a> class (DataContext is the default implementor of the ObjectContext interface) :</li>
+</ul>
+
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java"><span class="code-keyword">package</span> org.example.cayenne;
+
+<span class="code-keyword">import</span> org.apache.cayenne.ObjectContext;
+<span class="code-keyword">import</span> org.apache.cayenne.access.DataContext;
+
+<span class="code-keyword">public</span> class Main {
+
+	<span class="code-keyword">public</span> <span class="code-keyword">static</span> void main(<span class="code-object">String</span>[] args) {
+		ObjectContext context = DataContext.createDataContext();
+	}
+}</pre>
+</div></div>
+
+<p>ObjectContext is an isolated "session" in Cayenne that provides all needed API to work with data. ObjectContext has methods to execute queries and manage persistent objects. We'll discuss them in the following sections. When the first ObjectContext is created in the application, Cayenne loads XML mapping files and creates a shared access stack that is later reused by other ObjectContexts. </p>
+
+<h3><a name="TutorialObjectContext-RunningApplication"></a>Running Application</h3>
+
+<p>Let's check what happens when you run the application. But before we do that we need to add another dependency to the <tt>pom.xml</tt> - Apache Derby, our embedded database engine. To get the right version of Derby let's first add a non-default Maven repository that has needed artifacts. Insert this code in <tt>pom.xml</tt> under the <tt>&lt;dependencies&gt;...&lt;/dependencies&gt;</tt> section:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">&lt;repositories&gt;
+	&lt;repository&gt;
+		&lt;id&gt;objectstyle&lt;/id&gt;
+		&lt;name&gt;ObjectStyle Maven2 Repository&lt;/name&gt;
+		&lt;url&gt;http:<span class="code-comment">//objectstyle.org/maven2&lt;/url&gt;
+</span>		&lt;layout&gt;<span class="code-keyword">default</span>&lt;/layout&gt;
+	&lt;/repository&gt;
+&lt;/repositories&gt;</pre>
+</div></div>
+
+<p>After that add Derby to the <tt>&lt;dependencies&gt;...&lt;/dependencies&gt;</tt> section, where we already have Cayenne jars:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">&lt;dependency&gt;
+   &lt;groupId&gt;org.apache.derby&lt;/groupId&gt;
+   &lt;artifactId&gt;derby&lt;/artifactId&gt;
+   &lt;version&gt;10.5.3.0&lt;/version&gt;
+&lt;/dependency&gt;</pre>
+</div></div>
+
+<p>Now we are ready to run. Right click the "Main" class in Eclipse and select <tt>"Run As &gt; Java Application"</tt>. In the console you'll see output similar to this, indicating that Cayenne stack has been started:</p>
+
+<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
+<pre>INFO: started configuration loading.
+INFO: loaded domain: UntitledDomain
+INFO: loaded &lt;map name='UntitledDomainMap' location='UntitledDomainMap.map.xml'&gt;.
+INFO: loading &lt;node name='UntitledDomainNode' datasource='UntitledDomainNode.driver.xml' 
+factory='org.apache.cayenne.conf.DriverDataSourceFactory' 
+schema-update-strategy='org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy'&gt;.
+INFO: using factory: org.apache.cayenne.conf.DriverDataSourceFactory
+INFO: loading driver information from 'UntitledDomainNode.driver.xml'.
+INFO: loading driver org.apache.derby.jdbc.EmbeddedDriver
+INFO: loading user name and password.
+INFO: Created connection pool: jdbc:derby:memory:testdb;create=true 
+	Driver class: org.apache.derby.jdbc.EmbeddedDriver
+	Min. connections in the pool: 1
+	Max. connections in the pool: 1
+INFO: loaded datasource.
+INFO: no adapter set, using automatic adapter.
+INFO: loaded map-ref: UntitledDomainMap.
+INFO: finished configuration loading in 396 ms.</pre>
+</div></div>
+
+<div class='panelMacro'><table class='noteMacro'><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>How to Configure Cayenne Logging</b><br />You can tweak more or less detailed output by following the instructions in the <a href="../../../../Documentation/Cayenne Guide/Deployment/Configuring Logging/index.html" title="Configuring Logging">logging chapter</a>.</td></tr></table></div>
+
+<p>Nothing much happened here, but we've been able to create a working Cayenne stack. In the following chapters we'll use the ObjectContext for more interesting things.</p>
+
+<hr />
+<p><b>Next Step: <a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Persistent Objects/index.html" title="Tutorial Persistent Objects">Tutorial Persistent Objects</a></b></p>
+<hr /></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-2010 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial ObjectContext/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Persistent Objects/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Persistent%20Objects/index.html?rev=893886&view=auto
==============================================================================
--- cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Persistent Objects/index.html (added)
+++ cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Persistent Objects/index.html Fri Dec 25 21:15:02 2009
@@ -0,0 +1,210 @@
+<!--
+   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 - Tutorial Persistent Objects</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://cayenne.apache.org/"><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">Tutorial Persistent Objects</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/index.html">Tutorial</a><ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Setup/index.html">Tutorial Setup</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/index.html">Tutorial Starting Project</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/index.html">Tutorial Object Relational Mapping</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Java Classes/index.html">Tutorial Java Classes</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial ObjectContext/index.html">Tutorial ObjectContext</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Persistent Objects/index.html">Tutorial Persistent Objects</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial SelectQuery/index.html">Tutorial SelectQuery</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Delete/index.html">Tutorial Delete</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Webapp/index.html">Tutorial Webapp</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/Cayenne Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Customization/index.html">Customization</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>In this section we'll learn about persistent objects, how to customize them and how to create and save them in DB.</p>
+
+<h3><a name="TutorialPersistentObjects-InspectingandCustomizingPersistentObjects"></a>Inspecting and Customizing Persistent Objects</h3>
+
+<p>Persistent classes in Cayenne implement a <a href="../../../../Documentation/Cayenne Guide/DataObjects/index.html" title="DataObjects">DataObject interface</a>. If you inspect any of the classes <a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Java Classes/index.html" title="Tutorial Java Classes">generated earlier</a> in this tutorial (e.g. <tt>org.example.cayenne.persistent.Artist</tt>), you'll see that it extends a class with the name that starts with underscore (<tt>org.example.cayenne.persistent.auto._Artist</tt>), which in turn extends from <tt>org.apache.cayenne.CayenneDataObject</tt>. Splitting each persistent class into user-customizable subclass (Xyz) and a generated superclass (_Xyz) is a useful technique to avoid overwriting the custom code when refreshing classes from the mapping model.</p>
+
+<p>Let's for instance add a utility method to the Artist class that sets Artist date of birth, taking a string argument for the date. It will be preserved even if the model changes later:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java"><span class="code-keyword">package</span> org.example.cayenne.persistent;
+
+<span class="code-keyword">import</span> java.text.ParseException;
+<span class="code-keyword">import</span> java.text.SimpleDateFormat;
+<span class="code-keyword">import</span> java.util.Date;
+
+<span class="code-keyword">import</span> org.example.cayenne.persistent.auto._Artist;
+
+<span class="code-keyword">public</span> class Artist <span class="code-keyword">extends</span> _Artist {
+
+	<span class="code-keyword">static</span> <span class="code-keyword">final</span> <span class="code-object">String</span> DEFAULT_DATE_FORMAT = <span class="code-quote">"yyyyMMdd"</span>;
+
+	/**
+	 * Sets date of birth using a string in format yyyyMMdd.
+	 */
+	<span class="code-keyword">public</span> void setDateOfBirthString(<span class="code-object">String</span> yearMonthDay) {
+		<span class="code-keyword">if</span> (yearMonthDay == <span class="code-keyword">null</span>) {
+			setDateOfBirth(<span class="code-keyword">null</span>);
+		} <span class="code-keyword">else</span> {
+
+			Date date;
+			<span class="code-keyword">try</span> {
+				date = <span class="code-keyword">new</span> SimpleDateFormat(DEFAULT_DATE_FORMAT)
+						.parse(yearMonthDay);
+			} <span class="code-keyword">catch</span> (ParseException e) {
+				<span class="code-keyword">throw</span> <span class="code-keyword">new</span> IllegalArgumentException(
+				  <span class="code-quote">"A date argument must be in format '"</span>
+				+ DEFAULT_DATE_FORMAT + <span class="code-quote">"': "</span> + yearMonthDay);
+			}
+
+			setDateOfBirth(date);
+		}
+	}
+}</pre>
+</div></div>
+
+
+<h3><a name="TutorialPersistentObjects-CreateNewObjects"></a>Create New Objects</h3>
+
+<p>Now we'll create a bunch of objects and save them to the database. An object is created and registered with ObjectContext using "newObject" method. Objects <b>must</b> be registered with DataContext to be persisted and to allow setting relationships with other objects. Add this code to the "main" method of the Main class:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">Artist picasso = context.newObject(Artist.class);
+picasso.setName(<span class="code-quote">"Pablo Picasso"</span>);
+picasso.setDateOfBirthString(<span class="code-quote">"18811025"</span>);</pre>
+</div></div>
+
+<p>Note that at this point "picasso" object is only stored in memory and is not saved in the database. Let's continue by adding a Metropolitan Museum "Gallery" object and a few Picasso "Paintings":</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">Gallery metropolitan = context.newObject(Gallery.class);
+metropolitan.setName(<span class="code-quote">"Metropolitan Museum of Art"</span>); 
+
+Painting girl = context.newObject(Painting.class);
+girl.setName(<span class="code-quote">"Girl Reading at a Table"</span>);
+        
+Painting stein = context.newObject(Painting.class);
+stein.setName(<span class="code-quote">"Gertrude Stein"</span>);</pre>
+</div></div>
+
+<p>Now we can link the objects together, establishing relationships. Note that in each case below relationships are automatically estabslished in both directions (e.g. <tt>picasso.addToPaintings(girl)</tt> has exactly the same effect as <tt>girl.setToArtist(picasso)</tt>).</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">picasso.addToPaintings(girl);
+picasso.addToPaintings(stein);
+        
+girl.setGallery(metropolitan);
+stein.setGallery(metropolitan);</pre>
+</div></div>
+
+<p>Now lets save all five new objects, in a single method call:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">context.commitChanges();</pre>
+</div></div>
+
+<p>Now you can run the application again as described <a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial ObjectContext/index.html" title="Tutorial ObjectContext">in the previous section</a>. The new output will show a few actual DB operations:</p>
+
+<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
+<pre>Dec 20, 2009 11:11:37 PM org.apache.cayenne.conf.RuntimeLoadDelegate startedLoading
+INFO: started configuration loading.
+... 
+INFO: Opening connection: jdbc:derby:memory:testdb;create=true 
+	Login: null
+	Password: *******
+INFO: +++ Connecting: SUCCESS.
+INFO: --- transaction started.
+INFO: Detected and installed adapter: org.apache.cayenne.dba.derby.DerbyAdapter
+INFO: --- will run 3 queries.
+INFO: No schema detected, will create mapped tables
+INFO: CREATE TABLE ARTIST (DATE_OF_BIRTH DATE, ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY, 
+ NAME VARCHAR (200), PRIMARY KEY (ID))
+INFO: CREATE TABLE GALLERY (ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY, NAME VARCHAR (200), 
+ PRIMARY KEY (ID))
+INFO: CREATE TABLE PAINTING (ARTIST_ID INTEGER, GALLERY_ID INTEGER, ID INTEGER NOT NULL 
+ GENERATED BY DEFAULT AS IDENTITY, NAME VARCHAR (200), PRIMARY KEY (ID))
+INFO: ALTER TABLE PAINTING ADD FOREIGN KEY (ARTIST_ID) REFERENCES ARTIST (ID)
+INFO: ALTER TABLE PAINTING ADD FOREIGN KEY (GALLERY_ID) REFERENCES GALLERY (ID)
+INFO: CREATE TABLE AUTO_PK_SUPPORT (  TABLE_NAME CHAR(100) NOT NULL,  NEXT_ID BIGINT NOT NULL,  
+PRIMARY KEY(TABLE_NAME))
+INFO: DELETE FROM AUTO_PK_SUPPORT WHERE TABLE_NAME IN ('ARTIST', 'GALLERY', 'PAINTING')
+INFO: INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('ARTIST', 200)
+INFO: INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('GALLERY', 200)
+INFO: INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('PAINTING', 200)
+INFO: SELECT NEXT_ID FROM AUTO_PK_SUPPORT WHERE TABLE_NAME = ? FOR UPDATE [bind: 1:'ARTIST']
+INFO: SELECT NEXT_ID FROM AUTO_PK_SUPPORT WHERE TABLE_NAME = ? FOR UPDATE [bind: 1:'GALLERY']
+INFO: SELECT NEXT_ID FROM AUTO_PK_SUPPORT WHERE TABLE_NAME = ? FOR UPDATE [bind: 1:'PAINTING']
+INFO: --- will run 3 queries.
+INFO: INSERT INTO ARTIST (DATE_OF_BIRTH, ID, NAME) VALUES (?, ?, ?)
+INFO: [batch bind: 1-&gt;DATE_OF_BIRTH:'1881-10-25 00:00:00.0', 2-&gt;ID:200, 
+3-&gt;NAME:'Pablo Picasso']
+INFO: === updated 1 row.
+INFO: INSERT INTO GALLERY (ID, NAME) VALUES (?, ?)
+INFO: [batch bind: 1-&gt;ID:200, 2-&gt;NAME:'Metropolitan Museum of Art']
+INFO: === updated 1 row.
+INFO: INSERT INTO PAINTING (ARTIST_ID, GALLERY_ID, ID, NAME) VALUES (?, ?, ?, ?)
+INFO: [batch bind: 1-&gt;ARTIST_ID:200, 2-&gt;GALLERY_ID:200, 3-&gt;ID:200, 
+4-&gt;NAME:'Girl Reading at a Table']
+INFO: [batch bind: 1-&gt;ARTIST_ID:200, 2-&gt;GALLERY_ID:200, 3-&gt;ID:201, 
+4-&gt;NAME:'Gertrude Stein']
+INFO: === updated 2 rows.
+INFO: +++ transaction committed.
+</pre>
+</div></div>
+
+<p>So first Cayenne creates the needed tables (remember, we used "CreateIfNoSchemaStrategy"). Then it runs a number of inserts, generating primary keys on the fly. Not bad for just a few lines of code.</p>
+
+<hr />
+<p><b>Next Step: <a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial SelectQuery/index.html" title="Tutorial SelectQuery">Tutorial SelectQuery</a></b></p>
+<hr /></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-2010 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Persistent Objects/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial SelectQuery/index.html (from r893884, cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial SelectQuery/index.html)
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20SelectQuery/index.html?p2=cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20SelectQuery/index.html&p1=cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Quick%20Start/Tutorial%20SelectQuery/index.html&r1=893884&r2=893886&rev=893886&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial SelectQuery/index.html (original)
+++ cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial SelectQuery/index.html Fri Dec 25 21:15:02 2009
@@ -31,19 +31,18 @@
 <ul>
 <li><a href="../../../../Documentation/Cayenne Guide/Introduction/index.html">Introduction</a></li>
 <li><a href="../../../../Documentation/Cayenne Guide/Installation/index.html">Installation</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/index.html">Quick Start</a><ul>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Setup/index.html">Tutorial Setup</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Starting Mapping Project/index.html">Tutorial Starting Mapping Project</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Object Relational Mapping/index.html">Tutorial Object Relational Mapping</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Generate Database and Java Classes/index.html">Tutorial Generate Database and Java Classes</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial DataContext/index.html">Tutorial DataContext</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial DataObjects/index.html">Tutorial DataObjects</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Mapping Query/index.html">Tutorial Mapping Query</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial SelectQuery/index.html">Tutorial SelectQuery</a><ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/index.html">Tutorial</a><ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Setup/index.html">Tutorial Setup</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/index.html">Tutorial Starting Project</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/index.html">Tutorial Object Relational Mapping</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Java Classes/index.html">Tutorial Java Classes</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial ObjectContext/index.html">Tutorial ObjectContext</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Persistent Objects/index.html">Tutorial Persistent Objects</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial SelectQuery/index.html">Tutorial SelectQuery</a><ul>
 </ul>
 </li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Delete/index.html">Tutorial Delete</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Webapp/index.html">Tutorial Webapp</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Delete/index.html">Tutorial Delete</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Webapp/index.html">Tutorial Webapp</a></li>
 </ul>
 </li>
 <li><a href="../../../../Documentation/Cayenne Guide/Design/index.html">Design</a></li>
@@ -61,24 +60,25 @@
 <li><a href="../../../../Documentation/Cayenne Guide/Customization/index.html">Customization</a></li>
 </ul>
 </div>
-<div id="ConfluenceContent">
-<p>It was shown before how to <a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial DataObjects/index.html" title="Tutorial DataObjects">persist new objects</a>. Cayenne <a href="../../../../Documentation/Cayenne Guide/Queries/index.html" title="Queries">queries</a> are used to access already saved objects. The primary query type used for selecting objects is <a href="../../../../Documentation/Cayenne Guide/Queries/SelectQuery/index.html" title="SelectQuery">SelectQuery</a>. It can be mapped in CayenneModeler similar to how the SQLTemplate <a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Mapping Query/index.html" title="Tutorial Mapping Query">was mapped</a>, in this chapter however we'll show how to create it using Cayenne API.</p>
+<div id="ConfluenceContent"><p>This section shows how to select objects from the database using SelectQuery. </p>
 
-<p>We don't have too much data in the database yet, but we can still demonstrate the main principles:</p>
+<h3><a name="TutorialSelectQuery-IntroducingSelectQuery"></a>Introducing SelectQuery</h3>
+
+<p>It was shown before how to <a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Persistent Objects/index.html" title="Tutorial Persistent Objects">persist new objects</a>. Cayenne <a href="../../../../Documentation/Cayenne Guide/Queries/index.html" title="Queries">queries</a> are used to access already saved objects. The primary query type used for selecting objects is <a href="../../../../Documentation/Cayenne Guide/Queries/SelectQuery/index.html" title="SelectQuery">SelectQuery</a>. It can be mapped in CayenneModeler or created via the API. We'll use the later approach in this section. We don't have too much data in the database yet, but we can still demonstrate the main principles below.</p>
 
 <ul>
 	<li>Select all paintings (the code, and the log output it generates):</li>
 </ul>
 
 
-<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Main.java</b></div><div class="codeContent panelContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">SelectQuery select1 = <span class="code-keyword">new</span> SelectQuery(Painting.class);
 List paintings1 = context.performQuery(select1);</pre>
 </div></div>
 
 <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
-<pre>INFO  QueryLogger: SELECT t0.NAME, t0.ARTIST_ID, t0.GALLERY_ID, t0.ID FROM PAINTING t0
-INFO  QueryLogger: === returned 2 rows. - took 20 ms.</pre>
+<pre>INFO: SELECT t0.GALLERY_ID, t0.ARTIST_ID, t0.NAME, t0.ID FROM PAINTING t0
+INFO: === returned 2 rows. - took 18 ms.</pre>
 </div></div>
 
 <ul>
@@ -86,7 +86,7 @@
 </ul>
 
 
-<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Main.java</b></div><div class="codeContent panelContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">Expression qualifier2 = ExpressionFactory.likeIgnoreCaseExp(
                 Painting.NAME_PROPERTY,
                 <span class="code-quote">"gi%"</span>);
@@ -95,9 +95,9 @@
 </div></div>
 
 <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
-<pre>INFO  QueryLogger: SELECT t0.NAME, t0.ARTIST_ID, t0.GALLERY_ID, t0.ID FROM PAINTING t0 
-                             WHERE UPPER(t0.NAME) LIKE UPPER(?) [bind: 'gi%']
-INFO  QueryLogger: === returned 1 row. - took 28 ms.</pre>
+<pre>INFO: SELECT t0.GALLERY_ID, t0.ARTIST_ID, t0.NAME, t0.ID FROM PAINTING t0 
+WHERE UPPER(t0.NAME) LIKE UPPER(?) [bind: 1-&gt;NAME:'gi%']
+INFO: === returned 1 row. - took 12 ms.</pre>
 </div></div>
 
 <ul>
@@ -105,7 +105,7 @@
 </ul>
 
 
-<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Main.java</b></div><div class="codeContent panelContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">Calendar c = <span class="code-keyword">new</span> GregorianCalendar();
 c.set(c.get(Calendar.YEAR) - 100, 0, 1, 0, 0, 0);
 
@@ -116,20 +116,21 @@
 </div></div>
 
 <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
-<pre>INFO  QueryLogger: SELECT t0.NAME, t0.ARTIST_ID, t0.GALLERY_ID, t0.ID FROM PAINTING t0, ARTIST t1 
-                             WHERE t0.ARTIST_ID = t1.ID AND (t1.DATE_OF_BIRTH &lt; ?) [bind: '1906-01-01 00:00:00.3']
-INFO  QueryLogger: === returned 2 rows. - took 31 ms.</pre>
+<pre>SELECT t0.GALLERY_ID, t0.ARTIST_ID, t0.NAME, t0.ID FROM PAINTING t0 
+JOIN ARTIST t1 ON (t0.ARTIST_ID = t1.ID) WHERE t1.DATE_OF_BIRTH &lt; ? 
+[bind: 1-&gt;DATE_OF_BIRTH:'1909-01-01 00:00:00.378']
+INFO: === returned 2 rows. - took 19 ms.</pre>
 </div></div>
 
 <hr />
-<p><b>Next Step: <a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Delete/index.html" title="Tutorial Delete">Tutorial Delete</a></b></p>
+<p><b>Next Step: <a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Delete/index.html" title="Tutorial Delete">Tutorial Delete</a></b></p>
 <hr /></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-2008 Apache Software Foundation
+    Copyright &copy;2001-2010 Apache Software Foundation
   </div>
 
 </body>

Added: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Setup/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Setup/index.html?rev=893886&view=auto
==============================================================================
--- cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Setup/index.html (added)
+++ cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Setup/index.html Fri Dec 25 21:15:02 2009
@@ -0,0 +1,91 @@
+<!--
+   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 - Tutorial Setup</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://cayenne.apache.org/"><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">Tutorial Setup</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/index.html">Tutorial</a><ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Setup/index.html">Tutorial Setup</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/index.html">Tutorial Starting Project</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/index.html">Tutorial Object Relational Mapping</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Java Classes/index.html">Tutorial Java Classes</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial ObjectContext/index.html">Tutorial ObjectContext</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Persistent Objects/index.html">Tutorial Persistent Objects</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial SelectQuery/index.html">Tutorial SelectQuery</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Delete/index.html">Tutorial Delete</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Webapp/index.html">Tutorial Webapp</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/Cayenne Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Customization/index.html">Customization</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>The goal of this section of the tutorial is to install (or check that you already have installed) a minimally needed set of software to build a Cayenne application.</p>
+
+<h3><a name="TutorialSetup-InstallJava"></a>Install Java</h3>
+
+<p>Obviously, JDK has to be installed. Cayenne 3.0 requires JDK 1.5 or newer.</p>
+
+<h3><a name="TutorialSetup-InstallEclipseIDEandtheMavenPlugin"></a>Install Eclipse IDE and the Maven Plugin</h3>
+
+<p>Download Eclipse <a href="http://www.eclipse.org/downloads/" rel="nofollow">from here</a>. This tutorial is based on the Galileo package (Eclipse 3.5), JEE edition, still it should work with any recent vanilla Eclipse distribution.</p>
+
+<p>After downloading Eclipse, unpack it somewhere in the filesystem, and start it. The only plugin that you need for the tutorial is <a href="http://m2eclipse.sonatype.org/" rel="nofollow">m2eclipse</a>. To install it, in Eclipse go to "Help &gt; Install New Software", then click on "Add.." to add a new download site, and enter "Maven" in the "Name" field, and "http://m2eclipse.sonatype.org/update/" in the "Location" field. You may install any of the optional components that you think you need, but for this tutorial we only select a few basic components as shown on the following screenshot:</p>
+
+<p><img src="maven-plugin-install.png" align="absmiddle" border="0" /></p>
+
+<p>From here follow the Eclipse dialog instructions to finish the installation.</p>
+
+<hr />
+<p><b>Next Step: <a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/index.html" title="Tutorial Starting Project">Tutorial Starting Project</a></b></p>
+<hr /></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-2010 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Setup/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Setup/maven-plugin-install.png
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Setup/maven-plugin-install.png?rev=893886&view=auto
==============================================================================
Files cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Setup/maven-plugin-install.png (added) and cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Setup/maven-plugin-install.png Fri Dec 25 21:15:02 2009 differ

Added: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/base-datamap.png
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Starting%20Project/base-datamap.png?rev=893886&view=auto
==============================================================================
Files cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/base-datamap.png (added) and cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/base-datamap.png Fri Dec 25 21:15:02 2009 differ

Added: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/base-datanode.png
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Starting%20Project/base-datanode.png?rev=893886&view=auto
==============================================================================
Files cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/base-datanode.png (added) and cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/base-datanode.png Fri Dec 25 21:15:02 2009 differ

Added: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/eclipse-xmlfiles.png
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Starting%20Project/eclipse-xmlfiles.png?rev=893886&view=auto
==============================================================================
Files cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/eclipse-xmlfiles.png (added) and cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/eclipse-xmlfiles.png Fri Dec 25 21:15:02 2009 differ

Added: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Starting%20Project/index.html?rev=893886&view=auto
==============================================================================
--- cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/index.html (added)
+++ cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/index.html Fri Dec 25 21:15:02 2009
@@ -0,0 +1,133 @@
+<!--
+   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 - Tutorial Starting Project</title>
+    <style type="text/css">@import "../../../../style.css";</style>
+  </head>
+<body>
+  <div class="header">
+    <div style="float: left;"><a href="http://cayenne.apache.org/"><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">Tutorial Starting Project</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/index.html">Tutorial</a><ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Setup/index.html">Tutorial Setup</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/index.html">Tutorial Starting Project</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/index.html">Tutorial Object Relational Mapping</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Java Classes/index.html">Tutorial Java Classes</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial ObjectContext/index.html">Tutorial ObjectContext</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Persistent Objects/index.html">Tutorial Persistent Objects</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial SelectQuery/index.html">Tutorial SelectQuery</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Delete/index.html">Tutorial Delete</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Webapp/index.html">Tutorial Webapp</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/Cayenne Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Customization/index.html">Customization</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>The goal of this section is to create a new Java project in Eclipse containing a basic Cayenne mapping. It presents an introduction to CayenneModeler GUI tool, showing how to create the initial mapping objects: DataDomain, DataNode, DataMap.</p>
+
+<h3><a name="TutorialStartingProject-CreateanewProjectinEclipse"></a>Create a new Project in Eclipse</h3>
+
+<p>In Eclipse select <tt>"File &gt; New &gt; Other..."</tt> and then <tt>"Maven &gt; Maven Project"</tt>. Click "Next". On the following screen check "Create a simple project" checkbox and click "Next" again. In the dialog shown on the screenshot below, fill the "Group Id" and "Artifact Id" fields and click "Finish". <br/>
+<img src="tutorial-eclipse-project.png" align="absmiddle" border="0" /></p>
+
+<p>Now you should have a new empty project in the Eclipse workspace. Check that the project Java compiler settings are correct. Rightclick on the "tutorial" project, select <tt>"Properties &gt; Java Compiler"</tt> and ensure that "Compiler compliance level" is at least "1.5" (some versions of Maven plugin seem to be setting it to 1.4 by default).</p>
+
+<h3><a name="TutorialStartingProject-DownloadandStartCayenneModeler"></a>Download and Start CayenneModeler</h3>
+
+<p>Although later in this tutorial we'll be using Maven to include Cayenne runtime jars in the project, you'll still need to download Cayenne to get access to the CayenneModeler tool. </p>
+
+<div class='panelMacro'><table class='noteMacro'><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>If you are really into Maven, you can <a href="../../../../Documentation/Cayenne Guide/Maven2 Plugins/maven2-modeler/index.html" title="maven2-modeler">start CayenneModeler from Maven</a> if you wish. We'll do it in a more traditional way here.</td></tr></table></div>  
+
+<p>Download the latest release <a href="http://cayenne.apache.org/download.html" rel="nofollow">from here</a>. Unpack the distribution somewhere in the file system and start CayenneModeler, following <a href="../../../../Documentation/Modeler Guide/Introduction to CayenneModeler/Running CayenneModeler/index.html" title="Running CayenneModeler">platform-specific instructions</a>. On most platforms it is done simply by doubleclicking the Modeler icon. The welcome screen of the Modeler looks like this:</p>
+
+<p><img src="modeler-started.png" align="absmiddle" border="0" /></p>
+
+<h3><a name="TutorialStartingProject-CreateaNewMappingProjectinCayenneModeler"></a>Create a New Mapping Project in CayenneModeler</h3>
+
+<p>Click on the "New Project" button on Welcome screen. A new mapping project will appear that contains a single <b>DataDomain</b>. The meaning of a DataDomain is explained elsewhere in the User Guide. For now it is sufficient to understand that DataDomain is the root of your mapping project.</p>
+
+<h3><a name="TutorialStartingProject-CreateaDataNode"></a>Create a DataNode</h3>
+
+<p>The next project object you will create is a <b>DataNode</b>. DataNode is a descriptor of a single database your application will connect to. Cayenne mapping project can use more than one database, but for now, we'll only use one. With "UntitledDomain" selected on the left, click on "Create DataNode" button on the toolbar (or select <tt>"Project &gt; Create DataNode"</tt> from the menu.</p>
+
+<p>A new DataNode is displayed. Now you need to specify JDBC connection parameters. For an in-memory Derby database you can enter the following settings: </p>
+
+<ul>
+	<li>JDBC Driver: <tt>org.apache.derby.jdbc.EmbeddedDriver</tt></li>
+	<li>DB URL: <tt>jdbc:derby:memory:testdb;create=true</tt></li>
+</ul>
+
+
+<div class='panelMacro'><table class='noteMacro'><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>We are creating an in-memory database here. So when you stop your application, all the data will be lost. In most real-life cases you'll be connecting to a database that actually persists its data on disk, but an in-memory DB will do for the simple tutorial.</td></tr></table></div>
+
+<p>Also you will need to change "Schema Update Strategy". Select <tt>"org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy"</tt> from the dropdown, so that Cayenne creates a new schema on Derby based on the ORM mapping when the application starts.</p>
+
+<p><img src="base-datanode.png" align="absmiddle" border="0" /></p>
+
+
+<h3><a name="TutorialStartingProject-CreateaDataMap"></a>Create a DataMap</h3>
+
+<p>Now you will create a <b>DataMap</b>. DataMap is an object that holds all the mapping information. To create it, click on "Create DataMap" button (or select a corresponding menu item). Note that the newly created DataMap is automatically linked to the DataNode that you created in the previous step. If there is more than one DataNode, you may need to link a DataMap to the correct node manually. In other words a DataMap within DataDomain must point to a database described by the map.</p>
+
+<p>You can leave all the DataMap defaults unchanged except for one - "Java Package". Enter "org.example.cayenne.persistent". This name will later be used for all persistent classes.</p>
+
+<p><img src="base-datamap.png" align="absmiddle" border="0" /></p>
+
+<h3><a name="TutorialStartingProject-SavetheProject"></a>Save the Project</h3>
+
+<p>Before you proceed with the actual mapping, let's save the project. Click on "Save" button in the toolbar and navigate to the <tt>"tutorial"</tt> Eclipse project folder that was created earlier in this section and its <tt>"src/main/resources"</tt> subfolder and save the project there. Now go back to Eclipse, right click on "tutorial" project and select "Refresh", you will see three Cayenne XML files.</p>
+
+<p><img src="eclipse-xmlfiles.png" align="absmiddle" border="0" /></p>
+
+<p>Note that the location of the XML files is not coincidental. Cayenne runtime looks for <tt>"cayenne.xml"</tt> file in the application CLASSPATH and <tt>"src/main/resources"</tt> folder should already be a "class folder" in Eclipse for our project (and is also a standard location that Maven would copy to a jar file, if we were using Maven from command-line).</p>
+
+<hr />
+<p><b>Next Step: <a href="../../../../Documentation/Cayenne Guide/Tutorial/Tutorial Object Relational Mapping/index.html" title="Tutorial Object Relational Mapping">Tutorial Object Relational Mapping</a></b></p>
+<hr /></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-2010 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/modeler-started.png
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Starting%20Project/modeler-started.png?rev=893886&view=auto
==============================================================================
Files cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/modeler-started.png (added) and cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/modeler-started.png Fri Dec 25 21:15:02 2009 differ

Added: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/tutorial-eclipse-project.png
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Starting%20Project/tutorial-eclipse-project.png?rev=893886&view=auto
==============================================================================
Files cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/tutorial-eclipse-project.png (added) and cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Starting Project/tutorial-eclipse-project.png Fri Dec 25 21:15:02 2009 differ

Added: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Webapp/eclipse-mvnrun.png
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Webapp/eclipse-mvnrun.png?rev=893886&view=auto
==============================================================================
Files cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Webapp/eclipse-mvnrun.png (added) and cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Webapp/eclipse-mvnrun.png Fri Dec 25 21:15:02 2009 differ

Added: cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Webapp/firefox-webapp.png
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Tutorial/Tutorial%20Webapp/firefox-webapp.png?rev=893886&view=auto
==============================================================================
Files cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Webapp/firefox-webapp.png (added) and cayenne/main/branches/STABLE-3.0/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Tutorial/Tutorial Webapp/firefox-webapp.png Fri Dec 25 21:15:02 2009 differ