cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r552490 [8/10] - in /cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation: ./ JPA Guide/ JPA Guide/JPA Agent/ JPA Guide/JPA Cayenne Provider Properties/ JPA Guide/JPA Introduction/ JPA Guide/JPA persistence.xml/ JPA Guide/Requir...
Date Mon, 02 Jul 2007 13:36:31 GMT
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/QueryChain/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User%20Guide/Queries/QueryChain/index.html?view=diff&rev=552490&r1=552489&r2=552490
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/QueryChain/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/QueryChain/index.html Mon Jul  2 06:36:24 2007
@@ -29,41 +29,41 @@
   </div>
 <div id="cayenne_toc">
 <ul>
-<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</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><ul>
-<li><a href="../../../../Documentation/User Guide/Queries/SelectQuery/index.html">SelectQuery</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Qualifier Expressions/index.html">Qualifier Expressions</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Using Orderings/index.html">Using Orderings</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Caching Query Results/index.html">Caching Query Results</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Customizing Queries/index.html">Customizing Queries</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/SelectQuery Customization/index.html">SelectQuery Customization</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Using Orderings/index.html">Using Orderings</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/Parameterized Queries/index.html">Parameterized Queries</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/index.html">SQLTemplate Query</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Scripting SQLTemplate/index.html">Scripting SQLTemplate</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/RelationshipQuery/index.html">RelationshipQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/Queries Stored in DataMap/index.html">Queries Stored in DataMap</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Caching Query Results/index.html">Caching Query Results</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Customizing Queries/index.html">Customizing Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/index.html">SQLTemplate Query</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Qualifier Expressions/index.html">Qualifier Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/SelectQuery/index.html">SelectQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/NamedQuery/index.html">NamedQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/ObjectIdQuery/index.html">ObjectIdQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/QueryChain/index.html">QueryChain</a><ul>
 </ul>
 </li>
-<li><a href="../../../../Documentation/User Guide/Queries/RelationshipQuery/index.html">RelationshipQuery</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/EJBQLQuery/index.html">EJBQLQuery</a></li>
 </ul>
 </li>
-<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</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/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
 <li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</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">
@@ -82,7 +82,7 @@
   <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
+    Copyright &copy;2001-2007 Apache Software Foundation
   </div>
 
 </body>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/RelationshipQuery/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User%20Guide/Queries/RelationshipQuery/index.html?view=diff&rev=552490&r1=552489&r2=552490
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/RelationshipQuery/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/RelationshipQuery/index.html Mon Jul  2 06:36:24 2007
@@ -29,41 +29,41 @@
   </div>
 <div id="cayenne_toc">
 <ul>
-<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</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><ul>
-<li><a href="../../../../Documentation/User Guide/Queries/SelectQuery/index.html">SelectQuery</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Qualifier Expressions/index.html">Qualifier Expressions</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Using Orderings/index.html">Using Orderings</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Caching Query Results/index.html">Caching Query Results</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Customizing Queries/index.html">Customizing Queries</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/SelectQuery Customization/index.html">SelectQuery Customization</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Using Orderings/index.html">Using Orderings</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/Parameterized Queries/index.html">Parameterized Queries</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/index.html">SQLTemplate Query</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Scripting SQLTemplate/index.html">Scripting SQLTemplate</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/RelationshipQuery/index.html">RelationshipQuery</a><ul>
+</ul>
+</li>
 <li><a href="../../../../Documentation/User Guide/Queries/Queries Stored in DataMap/index.html">Queries Stored in DataMap</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Caching Query Results/index.html">Caching Query Results</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Customizing Queries/index.html">Customizing Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/index.html">SQLTemplate Query</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Qualifier Expressions/index.html">Qualifier Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/SelectQuery/index.html">SelectQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/NamedQuery/index.html">NamedQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/ObjectIdQuery/index.html">ObjectIdQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/QueryChain/index.html">QueryChain</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/RelationshipQuery/index.html">RelationshipQuery</a><ul>
+<li><a href="../../../../Documentation/User Guide/Queries/EJBQLQuery/index.html">EJBQLQuery</a></li>
 </ul>
 </li>
-</ul>
-</li>
-<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</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/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
 <li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</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">
@@ -79,7 +79,7 @@
   <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
+    Copyright &copy;2001-2007 Apache Software Foundation
   </div>
 
 </body>

Added: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/Advanced SQLTemplate/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User%20Guide/Queries/SQLTemplate%20Query/Advanced%20SQLTemplate/index.html?view=auto&rev=552490
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/Advanced SQLTemplate/index.html (added)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/Advanced SQLTemplate/index.html Mon Jul  2 06:36:24 2007
@@ -0,0 +1,106 @@
+<!--
+   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 - Advanced SQLTemplate</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">Advanced SQLTemplate</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../../Documentation/User Guide/Maven2 Plugins/index.html">Maven2 Plugins</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/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+<li><a href="../../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/index.html">Queries</a><ul>
+<li><a href="../../../../../Documentation/User Guide/Queries/Caching Query Results/index.html">Caching Query Results</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Customizing Queries/index.html">Customizing Queries</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SelectQuery Customization/index.html">SelectQuery Customization</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Using Orderings/index.html">Using Orderings</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Parameterized Queries/index.html">Parameterized Queries</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/RelationshipQuery/index.html">RelationshipQuery</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Queries Stored in DataMap/index.html">Queries Stored in DataMap</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SQLTemplate Query/index.html">SQLTemplate Query</a><ul>
+<li><a href="../../../../../Documentation/User Guide/Queries/SQLTemplate Query/Advanced SQLTemplate/index.html">Advanced SQLTemplate</a><ul>
+</ul>
+</li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SQLTemplate Query/SQLTemplate Basics/index.html">SQLTemplate Basics</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SQLTemplate Query/Scripting SQLTemplate/index.html">Scripting SQLTemplate</a></li>
+</ul>
+</li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Qualifier Expressions/index.html">Qualifier Expressions</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SelectQuery/index.html">SelectQuery</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/NamedQuery/index.html">NamedQuery</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/ObjectIdQuery/index.html">ObjectIdQuery</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/QueryChain/index.html">QueryChain</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/EJBQLQuery/index.html">EJBQLQuery</a></li>
+</ul>
+</li>
+<li><a href="../../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><h3><a name="AdvancedSQLTemplate-ControllingResultDataRowCaps"></a>Controlling Result DataRow Caps</h3>
+
+<p><em>(available since 3.0)</em></p>
+
+<p>Queries like <tt>"SELECT * FROM..."</tt> and even <tt>"SELECT COLUMN1, COLUMN2, ... FROM ..."</tt> can sometimes result in Cayenne exceptions on attempts to convert fetched DataRows to objects. Essentially any query that is not using a <a href="../../../../../Documentation/User Guide/Queries/SQLTemplate Query/Scripting SQLTemplate/index.html" title="Scripting SQLTemplate">#result directive</a> to describe the result set is prone to this problem, as different databases may produce different capitalization of the <tt>java.sql.ResultSet</tt> columns. </p>
+
+<p>The most universal way to address this issue is to describe each column explicitly in the SQLTemplate via <tt>#result</tt> directive, as mentioned above: <tt>"SELECT #result('column1'), #result('column2'), .."</tt>. However this becomes unpractical for the tables with lots of columns. For such cases Cayenne provides a shortcut based on the fact that normally an ORM mapping follows some naming convention for the column names. Simply put, for case-insensitive databases developers normall use either <b>all lowercase</b> or <b>all uppercase</b> column names.</p>
+
+<p>Here is the API to force Cayenne to follow the naming convention (also available as a dropdown in the Modeler). <em>Note that you shouldn't bother with this unless you are getting CayenneRuntimeExceptions when fetching with SQLTemplate.</em></p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">SQLTemplate query = <span class="code-keyword">new</span> SQLTemplate(<span class="code-quote">"SELECT * FROM ARTIST"</span>);
+query.setColumnNamesCapitalization(SQLTemplate.LOWERCASE_COLUMN_NAMES);
+List objects = context.performQuery(query);</pre>
+</div></div>
+
+<p>or </p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">SQLTemplate query = <span class="code-keyword">new</span> SQLTemplate(<span class="code-quote">"SELECT * FROM ARTIST"</span>);
+query.setColumnNamesCapitalization(SQLTemplate.UPPERCASE_COLUMN_NAMES);
+List objects = context.performQuery(query);</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-2007 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/Advanced SQLTemplate/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/SQLTemplate Basics/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User%20Guide/Queries/SQLTemplate%20Query/SQLTemplate%20Basics/index.html?view=auto&rev=552490
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/SQLTemplate Basics/index.html (added)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/SQLTemplate Basics/index.html Mon Jul  2 06:36:24 2007
@@ -0,0 +1,137 @@
+<!--
+   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 - SQLTemplate Basics</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">SQLTemplate Basics</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/index.html">Queries</a><ul>
+<li><a href="../../../../../Documentation/User Guide/Queries/Caching Query Results/index.html">Caching Query Results</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Customizing Queries/index.html">Customizing Queries</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SelectQuery Customization/index.html">SelectQuery Customization</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Using Orderings/index.html">Using Orderings</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Parameterized Queries/index.html">Parameterized Queries</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/RelationshipQuery/index.html">RelationshipQuery</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Queries Stored in DataMap/index.html">Queries Stored in DataMap</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SQLTemplate Query/index.html">SQLTemplate Query</a><ul>
+<li><a href="../../../../../Documentation/User Guide/Queries/SQLTemplate Query/Scripting SQLTemplate/index.html">Scripting SQLTemplate</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SQLTemplate Query/SQLTemplate Basics/index.html">SQLTemplate Basics</a><ul>
+</ul>
+</li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SQLTemplate Query/Advanced SQLTemplate/index.html">Advanced SQLTemplate</a></li>
+</ul>
+</li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Qualifier Expressions/index.html">Qualifier Expressions</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SelectQuery/index.html">SelectQuery</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/NamedQuery/index.html">NamedQuery</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/ObjectIdQuery/index.html">ObjectIdQuery</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/QueryChain/index.html">QueryChain</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/EJBQLQuery/index.html">EJBQLQuery</a></li>
+</ul>
+</li>
+<li><a href="../../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../../Documentation/User Guide/Deployment/index.html">Deployment</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/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../../Documentation/User Guide/DataViews/index.html">DataViews</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/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../../Documentation/User Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><h3><a name="SQLTemplateBasics-CreatingSQLTemplate"></a>Creating SQLTemplate</h3>
+
+<p>SQLTemplates can be built using CayenneModeler. Here we demonstrate how to do the same thing via API. SQLTemplate consists of root and dynamic template string. Dynamic behavior of the template is discussed in subsequent chapters, for now it is sufficient to know that the template string is simply a valid SQL statement in the target database SQL dialect.</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.query.SQLTemplate;
+...
+<span class="code-comment">// create selecting SQLTemplate
+</span>SQLTemplate selectQuery = <span class="code-keyword">new</span> SQLTemplate(Artist.class, <span class="code-quote">"select * from ARTIST"</span>);
+...
+<span class="code-comment">// create updating SQLTemplate
+</span>SQLTemplate updateQuery = <span class="code-keyword">new</span> SQLTemplate(Artist.class, <span class="code-quote">"delete from ARTIST"</span>);</pre>
+</div></div>
+
+<h3><a name="SQLTemplateBasics-SelectingObjectswithSQLTemplate"></a>Selecting Objects with SQLTemplate</h3>
+
+<p>Selecting SQLTemplate is very similar to SelectQuery in many respects. It can be executed via <tt>DataContext.performQuery(..)</tt> and supports the same configuration parameters, such as fetch limit, pagination, etc. It can be configured to return DataObjects (default) or data rows.</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.query.SQLTemplate;
+...
+<span class="code-comment">// fetch all artists, but no more than 1000 objects...
+</span>SQLTemplate rawSelect = <span class="code-keyword">new</span> SQLTemplate(Artist.class, <span class="code-quote">"select * from ARTIST"</span>);
+rawSelect.setFetchLimit(1000);
+
+List artists = dataContext.performQuery(rawSelect);</pre>
+</div></div>
+
+<h3><a name="SQLTemplateBasics-ModifyingDatawithSQLTemplate"></a>Modifying Data with SQLTemplate</h3>
+
+<p>Non-selecting SQLTemplate allows to execute arbitrary SQL that modifies the database, but does not return the results. <tt>DataContext.performNonSelectingQuery(..)</tt> is used for this task.</p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../../images/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>When changing or deleting data via SQLTemplate you must realize that such changes are done directly to the database, bypassing the context, and therefore may potentially leave object graph in an inconsistent state.</td></tr></table>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.query.SQLTemplate;
+...
+<span class="code-comment">// fetch all artists, but no more than 1000 objects...
+</span>SQLTemplate rawDelete = <span class="code-keyword">new</span> SQLTemplate(Artist.class, <span class="code-quote">"delete from ARTIST"</span>);
+<span class="code-object">int</span>[] deleteCounts = dataContext.performNonSelectingQuery(rawDelete);</pre>
+</div></div>
+
+<h3><a name="SQLTemplateBasics-CustomizingSQLDialects"></a>Customizing SQL Dialects</h3>
+
+<p>Even though SQL is an industry standard, different DB vendors still have their own dialects and extensions. Two versions of the same query written for Oracle and PostgreSQL may look quiet different.</p>
+
+<p>Each SQLTemplate query has a default template, usually set in constructor. Internally it also keeps a map of alternative templates. This map normally uses a fully-qualified class name of the target DbAdapter as a key. This way Cayenne can determine which one of the SQL strings to use during the execution. Alternative SQL strings are configured using <tt>SQLTemplate.setTemplate(...)</tt>:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-comment">// build template with <span class="code-keyword">default</span> SQL
+</span>SQLTemplate query = <span class="code-keyword">new</span> SQLTemplate(Artist.class, <span class="code-quote">"select * from ARTIST"</span>);
+
+<span class="code-comment">// <span class="code-keyword">for</span> Postgres it would be nice to trim the CHAR ARTIST_NAME column
+</span><span class="code-comment">// or otherwise it will be returned padded with spaces
+</span><span class="code-object">String</span> pgTemplate = <span class="code-quote">"SELECT ARTIST_ID, RTRIM(ARTIST_NAME), DATE_OF_BIRTH FROM ARTIST"</span>;
+query.setTemplate(PostgresAdapter.class.getName(), pgTemplate);</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-2007 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/SQLTemplate Basics/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/Scripting SQLTemplate/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User%20Guide/Queries/SQLTemplate%20Query/Scripting%20SQLTemplate/index.html?view=auto&rev=552490
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/Scripting SQLTemplate/index.html (added)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/Scripting SQLTemplate/index.html Mon Jul  2 06:36:24 2007
@@ -0,0 +1,300 @@
+<!--
+   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 - Scripting SQLTemplate</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">Scripting SQLTemplate</span>
+  </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../../Documentation/User Guide/Maven2 Plugins/index.html">Maven2 Plugins</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/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+<li><a href="../../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../../Documentation/User Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/index.html">Queries</a><ul>
+<li><a href="../../../../../Documentation/User Guide/Queries/Caching Query Results/index.html">Caching Query Results</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Customizing Queries/index.html">Customizing Queries</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SelectQuery Customization/index.html">SelectQuery Customization</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Using Orderings/index.html">Using Orderings</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Parameterized Queries/index.html">Parameterized Queries</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/RelationshipQuery/index.html">RelationshipQuery</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Queries Stored in DataMap/index.html">Queries Stored in DataMap</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SQLTemplate Query/index.html">SQLTemplate Query</a><ul>
+<li><a href="../../../../../Documentation/User Guide/Queries/SQLTemplate Query/Advanced SQLTemplate/index.html">Advanced SQLTemplate</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SQLTemplate Query/SQLTemplate Basics/index.html">SQLTemplate Basics</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SQLTemplate Query/Scripting SQLTemplate/index.html">Scripting SQLTemplate</a><ul>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="../../../../../Documentation/User Guide/Queries/Qualifier Expressions/index.html">Qualifier Expressions</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/SelectQuery/index.html">SelectQuery</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/NamedQuery/index.html">NamedQuery</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/ObjectIdQuery/index.html">ObjectIdQuery</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/QueryChain/index.html">QueryChain</a></li>
+<li><a href="../../../../../Documentation/User Guide/Queries/EJBQLQuery/index.html">EJBQLQuery</a></li>
+</ul>
+</li>
+<li><a href="../../../../../Documentation/User Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>SQLTemplate's internal SQL string is a dynamic script that is processed at runtime to generate PreparedStatement SQL code. Dynamic nature of SQLTemplate makes possible a few important things - it allows to bind parameters on the fly; it provides a way to pass extra information to Cayenne that is not included in the SQL text; it supports including/excluding chunks of SQL depending on runtime parameters.</p>
+
+<p>Scripting of SQL strings is done using <span class="nobr"><a href="http://jakarta.apache.org/velocity" title="Visit page outside Confluence" rel="nofollow">Jakarta Velocity<sup><img class="rendericon" src="../../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>. Velocity was chosen primarily for its concise template language (no XML tags within SQL!) that doesn't conflict with the SQL syntax. When creating dynamic SQL template, all standard Velocity directives are available, including <tt>#set</tt>, <tt>#foreach</tt>, <tt>#if</tt>. However due to the nature of the SQL and the need to integrate it with Cayenne runtime, only a few Cayenne custom directives are normally used. These directives (<tt>#bind</tt>..., <tt>#result</tt>, <tt>#chain</tt>, <tt>#chunk</tt>) are described below.</p>
+<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../../images/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Directive Syntax Note</b><br />Velocity directives start with pound sign (#) and have their parameters separated by space, not comma. E.g. <tt>#bind('SOMESTRING' 'VARCHAR')</tt>.</td></tr></table>
+
+<h3><a name="ScriptingSQLTemplate-NamedParameters"></a>Named Parameters</h3>
+<p><tt>SQLTemplate.setParameters(java.util.Map)</tt> allows setting a number of named parameters that are used to build parts of the query. During template processing by Velocity all keys in the parameters map are available as variables. For example if the map contains a key "name", its value can be referenced as "$name" in the template. Value of the parameter will be inserted in the SQL unmodified:</p>
+
+<h5><a name="ScriptingSQLTemplate-NamedParametersExample"></a>Named Parameters Example</h5>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-comment">// build SQLTemplate
+</span><span class="code-object">String</span> sql = <span class="code-quote">"delete from $tableName"</span>;
+SQLTemplate delete = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql, <span class="code-keyword">false</span>);
+...
+<span class="code-comment">// <span class="code-keyword">this</span> will create a query <span class="code-quote">"delete from ARTIST"</span>
+</span>delete.setParameters(Collections.singletonMap(<span class="code-quote">"tableName"</span>, <span class="code-quote">"ARTIST"</span>));
+...
+<span class="code-comment">// <span class="code-keyword">this</span> will create a query <span class="code-quote">"delete from PAINTING"</span>
+</span>delete.setParameters(Collections.singletonMap(<span class="code-quote">"tableName"</span>, <span class="code-quote">"PAINTING"</span>));</pre>
+</div></div>
+
+<h3><a name="ScriptingSQLTemplate-DescribingtheResults%23resultDirective"></a>Describing the Results - #result Directive</h3>
+
+<p><tt>#result</tt> directive is used in selecting SQLTemplates to quickly map an arbitrary ResultSet to a DataObject (or a data row with known keys), and also to control Java types of result values. #result directive has a variable number of arguments:</p>
+
+<ul>
+	<li><tt>#result(columnName)</tt> - e.g. <tt>#result('ARTIST_NAME')</tt></li>
+	<li><tt>#result(columnName javaType)</tt> - e.g. <tt>#result('DATE_OF_BIRTH' 'java.util.Date')</tt></li>
+	<li><tt>#result(columnName javaType columnAlias)</tt> - e.g. <tt>#result('DATE_OF_BIRTH' 'java.util.Date' 'DOB')</tt> - in this case returned data row will use "DOB" instead of "DATE_OF_BIRTH" for the result value.</li>
+</ul>
+
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../../images/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>Generally "javaType" argument is a fully-qualified Java class name for a given result column. However for simplicity most common Java types used in JDBC can be specified without a package. These include all numeric types, primitives, String, SQL dates, BigDecimal and BigInteger. So "#result('A' 'String')", "#result('B' 'java.lang.String')" and "#result('C' 'int')" are all valid.</td></tr></table>
+
+<p>While "select * from" queries may work just fine, in most cases it is a good idea to explicitly describe results.</p>
+
+<h5><a name="ScriptingSQLTemplate-%23resultExamples"></a>#result Examples</h5>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-comment">// build selecting SQLTemplate
+</span><span class="code-object">String</span> sql = <span class="code-quote">"SELECT"</span>
+   + <span class="code-quote">" #result('ARTIST_ID' '<span class="code-object">int</span>'),"</span>
+   + <span class="code-quote">" #result('ARTIST_NAME' '<span class="code-object">String</span>'),"</span>
+   + <span class="code-quote">" #result('DATE_OF_BIRTH' 'java.util.Date')"</span>
+   + <span class="code-quote">" FROM ARTIST"</span>;
+SQLTemplate select = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql, <span class="code-keyword">true</span>);
+...
+DataContext context...;
+List artists = context.performQuery(select);</pre>
+</div></div>
+
+<h3><a name="ScriptingSQLTemplate-BindingParameters%23bindDirective"></a>Binding Parameters - #bind Directive</h3>
+<p>SQLTemplate uses <tt>#bind</tt> directive to indicate value binding. It has the same meaning as PreparedStatement question mark ("?"), however it also tells Cayenne about the nature of the bound value, so it should be used for all bindings. <tt>#bind()</tt> directive can have a variable number of arguments. The following are the valid invocation formats:</p>
+
+<ul>
+	<li><tt>#bind(value)</tt> - e.g. <tt>#bind($xyz)</tt> or <tt>#bind('somestring')</tt></li>
+	<li><tt>#bind(value jdbcTypeName)</tt> - e.g. <tt>#bind($xyz 'VARCHAR')</tt>. Second argument is the name of JDBC type for this binding. Valid JDBC types are defined in java.sql.Types class. This form is the the most common and useful. It is generally preferred to the single argument form, as it explicitly tells what type of JDBC value this binding is.</li>
+	<li><tt>#bind(value jdbcTypeName precision)</tt> - e.g. <tt>#bind($xyz 'DECIMAL' 2)</tt></li>
+</ul>
+
+
+<h5><a name="ScriptingSQLTemplate-%23binddirectiveexample"></a>#bind directive example</h5>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-comment">// build SQLTemplate
+</span><span class="code-object">String</span> sql = <span class="code-quote">"update ARTIST set ARTIST_NAME = #bind($name) where ARTIST_ID = #bind($id)"</span>;
+SQLTemplate update = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql, <span class="code-keyword">false</span>);
+...
+<span class="code-comment">// set parameters and run it...
+</span>Map parameters = <span class="code-keyword">new</span> HashMap();
+parameters.put(<span class="code-quote">"name"</span>, <span class="code-quote">"Publo Picasso"</span>);
+parameters.put(<span class="code-quote">"id"</span>, <span class="code-keyword">new</span> <span class="code-object">Integer</span>(1001));
+update.setParameters(parameters);
+
+DataContext context...;
+context.performNonSelectingQuery(update);</pre>
+</div></div>
+
+<p>SQLTemplate also supports binding Collections for building <tt>IN ( .. )</tt> queries. In any of the <tt>#bind</tt> invocation formats above, you may specify a Collection of values in place of <tt>value</tt>, and Cayenne will automatically expand it.</p>
+
+<h5><a name="ScriptingSQLTemplate-Collectionexample"></a>Collection example</h5>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-comment">// build SQLTemplate
+</span><span class="code-object">String</span> sql = "SELECT ARTIST_ID, ARTIST_NAME FROM ARTIST WHERE ARTIST_NAME IN (#bind($names))
+SQLTemplate select = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql, <span class="code-keyword">false</span>);
+...
+<span class="code-comment">// set parameters and run it...
+</span>Map parameters = <span class="code-keyword">new</span> HashMap();
+parameters.put(<span class="code-quote">"names"</span>, Arrays.asList(<span class="code-keyword">new</span> <span class="code-object">String</span>[] { <span class="code-quote">"Monet"</span>, <span class="code-quote">"Publo Picasso"</span>}));
+select.setParameters(parameters);
+
+DataContext context...;
+List artists = context.performQuery(select);</pre>
+</div></div>
+
+
+<h3><a name="ScriptingSQLTemplate-NullValuesinBindings%23bindEqualand%23bindNotEqualDirectives"></a>Null Values in Bindings - #bindEqual and #bindNotEqual Directives</h3>
+<p>Sometimes when a parameter is NULL, SQL code has to be changed. For example, instead of "WHERE COLUMN = ?", PreparedStatement should be rewritten as "WHERE COLUMN IS NULL", and instead of "WHERE COLUMN &lt;&gt; ?" - as "WHERE COLUMN IS NOT NULL". <tt>#bindEqual</tt> and <tt>#bindNotEqual</tt> directives are used to dynamically generate correct SQL string in this case. Their semantics is the same as #bind directive above, except that they do not require "=", "!=" or "&lt;&gt;" in front of them:</p>
+
+<ul>
+	<li><tt>#bindEqual(value)</tt>, <tt>#bindNotEqual(value)</tt></li>
+	<li><tt>#bindEqual(value jdbcTypeName)</tt>, <tt>#bindNotEqual(value jdbcTypeName)</tt></li>
+	<li><tt>#bindEqual(value jdbcTypeName precision)</tt>, <tt>#bindNotEqual(value jdbcTypeName precision)</tt></li>
+</ul>
+
+
+<h5><a name="ScriptingSQLTemplate-NullValueExamples"></a>Null Value Examples</h5>
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-comment">// build SQLTemplate
+</span><span class="code-comment">// note that <span class="code-quote">"="</span> is ommitted <span class="code-keyword">for</span> the second binding, since it is a part of the directive
+</span><span class="code-object">String</span> sql = "update ARTIST set ARTIST_NAME = #bind($name) where ARTIST_ID #bindEqual($id);
+SQLTemplate update = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql, <span class="code-keyword">false</span>);
+...
+<span class="code-comment">// set parameters and run it...
+</span>Map parameters = <span class="code-keyword">new</span> HashMap();
+parameters.put(<span class="code-quote">"name"</span>, <span class="code-quote">"Publo Picasso"</span>);
+parameters.put(<span class="code-quote">"id"</span>, <span class="code-keyword">new</span> <span class="code-object">Integer</span>(1001));
+update.setParameters(parameters);
+
+DataContext context...;
+
+<span class="code-comment">// after binding processing PrepapredStatement SQL will look like 
+</span><span class="code-comment">// <span class="code-quote">"update ARTIST set ARTIST_NAME = ? where ARTIST_ID = ?"</span>
+</span>context.performNonSelectingQuery(update);</pre>
+</div></div>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-comment">// build SQLTemplate
+</span><span class="code-comment">// note that <span class="code-quote">"!="</span> is omitted <span class="code-keyword">for</span> the second binding, since it is a part of the directive
+</span><span class="code-object">String</span> sql = <span class="code-quote">"update ARTIST set ARTIST_NAME = #bind($name) where ARTIST_ID #bindNotEqual($id)"</span>;
+SQLTemplate update = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql, <span class="code-keyword">false</span>);
+...
+<span class="code-comment">// set parameters and run it...
+</span>Map parameters = <span class="code-keyword">new</span> HashMap();
+parameters.put(<span class="code-quote">"name"</span>, <span class="code-quote">"Publo Picasso"</span>);
+parameters.put(<span class="code-quote">"id"</span>, <span class="code-keyword">null</span>);
+update.setParameters(parameters);
+
+DataContext context...;
+
+<span class="code-comment">// after binding processing PrepapredStatement SQL will look like 
+</span><span class="code-comment">// <span class="code-quote">"update ARTIST set ARTIST_NAME = ? where ARTIST_ID IS NOT NULL"</span>
+</span>context.performNonSelectingQuery(update);</pre>
+</div></div>
+
+<h3><a name="ScriptingSQLTemplate-BindingPersistentObjectValues%23bindObjectEqualand%23bindObjectNotEqualdirectives"></a>Binding Persistent Object Values - #bindObjectEqual and #bindObjectNotEqual directives</h3>
+
+<p>It can be tricky to use a Persistent object (or an ObjectId) in a binding, especially for tables with compound primary keys. There are two directives to help with that - <tt>#bindObjectEqual</tt> and <tt>#bindObjectNotEqual</tt>. Long explicit form of these directives is the following:</p>
+
+<ul>
+	<li><tt>#bindObjectEqual(object columns idColumns)</tt></li>
+	<li><tt>#bindObjectNotEqual(object columns idColumns)</tt></li>
+</ul>
+
+
+<p>An <tt>"object"</tt> argument can be one of Persistent, ObjectId or Map. <tt>"columns"</tt> and <tt>"idColumns"</tt> can be of type Object[], Collection or Object. What these directives do is build the SQL to match <tt>"columns"</tt> (i.e. the columns from the SQL query) against <tt>"idColumns"</tt> (i.e. the names of the PK columns for a given entity) for a given object. E.g.:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-object">String</span> sql = <span class="code-quote">"SELECT * FROM PAINTING t0"</span>
+                + <span class="code-quote">" WHERE #bindObjectEqual($a 't0.ARTIST_ID' 'ARTIST_ID' ) ORDER BY PAINTING_ID"</span>;
+SQLTemplate select = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql);
+
+Artist a = ....
+select.setParameters(Collections.singletonMap(<span class="code-quote">"a"</span>, a));</pre>
+</div></div>
+
+<p>In case of compound PK, arrays can be used for the last two parameters:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-object">String</span> sql = <span class="code-quote">"SELECT * FROM TABLE_X t0"</span>
+                + <span class="code-quote">" WHERE #bindObjectEqual($a ['t0.FK1', 't0.FK2'] ['PK1', 'PK2'] )"</span>;
+SQLTemplate select = <span class="code-keyword">new</span> SQLTemplate(TableX.class, sql);</pre>
+</div></div>
+
+<p>In the case when SQL columns have the same names as PK columns, and there's no naming conflict that would force to use fully qualified column names, a short form of these directives can be used, where column names are inferred from the ObjectId:</p>
+
+<ul>
+	<li><tt>#bindObjectEqual(object)</tt></li>
+	<li><tt>#bindObjectNotEqual(object)</tt></li>
+</ul>
+
+
+<p>E.g.:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-object">String</span> sql = <span class="code-quote">"SELECT * FROM PAINTING WHERE #bindObjectEqual($a) ORDER BY PAINTING_ID"</span>;
+SQLTemplate select = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql);</pre>
+</div></div>
+
+<h3><a name="ScriptingSQLTemplate-BuildingDynamicSQL%23chainand%23chunkDirectives"></a>Building Dynamic SQL - #chain and #chunk Directives</h3>
+<p>Often it is desirable to exclude parts of the WHERE clause if some parameters are null or not set. This task is not trivial considering the semantics of a SQL statement. Consider this fairly simple example:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-object">String</span> sql = <span class="code-quote">"SELECT DISTINCT"</span>
+   + <span class="code-quote">" #result('ARTIST_ID' '<span class="code-object">int</span>'),"</span>
+   + <span class="code-quote">" #result('ARTIST_NAME' '<span class="code-object">String</span>'),"</span>
+   + <span class="code-quote">" #result('DATE_OF_BIRTH' 'java.util.Date')"</span>
+   + <span class="code-quote">" FROM ARTIST t0"</span>
+   + <span class="code-quote">" WHERE ARTIST_NAME LIKE #bind($name)"</span>
+   + <span class="code-quote">" OR ARTIST_ID &gt; #bind($id)"</span>;
+SQLTemplate select = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql);</pre>
+</div></div>
+
+<p>It would be nice to exclude ARTIST_NAME matching if "name" parameter is null, exclude ARTIST_ID matching if "id" is null, and exclude the whole WHERE clause if both are null. <tt>#chain</tt> and <tt>#chunk</tt> directives are used for this purpose. Each logical piece is wrapped in a conditional "chunk", and a number of chunks are grouped in a chain. If chain contains no chunks it doesn't render anything enclosed in it.</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-object">String</span> sql = <span class="code-quote">"SELECT DISTINCT"</span>
+   + <span class="code-quote">" #result('ARTIST_ID' '<span class="code-object">int</span>'),"</span>
+   + <span class="code-quote">" #result('ARTIST_NAME' '<span class="code-object">String</span>'),"</span>
+   + <span class="code-quote">" #result('DATE_OF_BIRTH' 'java.util.Date')"</span>
+   + <span class="code-quote">" FROM ARTIST t0"</span>
+   + " #chain('OR' 'WHERE')                              <span class="code-comment">// start chain prefixed by WHERE, 
+</span>                                                         <span class="code-comment">// and joined by OR
+</span>   + <span class="code-quote">" #chunk($name) ARTIST_NAME LIKE #bind($name) #end"</span> <span class="code-comment">// ARTIST_NAME <span class="code-quote">"chunk"</span>
+</span>   + <span class="code-quote">" #chunk($id) ARTIST_ID &gt; #bind($id) #end"</span>          <span class="code-comment">// ARTIST_ID <span class="code-quote">"chunk"</span>
+</span>   + <span class="code-quote">" #end"</span>;                                            <span class="code-comment">// end of chain
+</span>SQLTemplate select = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql);</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-2007 Apache Software Foundation
+  </div>
+
+</body>
+</html>

Propchange: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/Scripting SQLTemplate/index.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User%20Guide/Queries/SQLTemplate%20Query/index.html?view=diff&rev=552490&r1=552489&r2=552490
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SQLTemplate Query/index.html Mon Jul  2 06:36:24 2007
@@ -29,105 +29,62 @@
   </div>
 <div id="cayenne_toc">
 <ul>
-<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</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><ul>
-<li><a href="../../../../Documentation/User Guide/Queries/SelectQuery/index.html">SelectQuery</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Qualifier Expressions/index.html">Qualifier Expressions</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Using Orderings/index.html">Using Orderings</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Caching Query Results/index.html">Caching Query Results</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Customizing Queries/index.html">Customizing Queries</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/SelectQuery Customization/index.html">SelectQuery Customization</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Using Orderings/index.html">Using Orderings</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/Parameterized Queries/index.html">Parameterized Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/RelationshipQuery/index.html">RelationshipQuery</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Queries Stored in DataMap/index.html">Queries Stored in DataMap</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/index.html">SQLTemplate Query</a><ul>
+<li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/Advanced SQLTemplate/index.html">Advanced SQLTemplate</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/SQLTemplate Basics/index.html">SQLTemplate Basics</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/Scripting SQLTemplate/index.html">Scripting SQLTemplate</a></li>
 </ul>
 </li>
-<li><a href="../../../../Documentation/User Guide/Queries/Scripting SQLTemplate/index.html">Scripting SQLTemplate</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Queries Stored in DataMap/index.html">Queries Stored in DataMap</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Caching Query Results/index.html">Caching Query Results</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Customizing Queries/index.html">Customizing Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Qualifier Expressions/index.html">Qualifier Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/SelectQuery/index.html">SelectQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/NamedQuery/index.html">NamedQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/ObjectIdQuery/index.html">ObjectIdQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/QueryChain/index.html">QueryChain</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/RelationshipQuery/index.html">RelationshipQuery</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/EJBQLQuery/index.html">EJBQLQuery</a></li>
 </ul>
 </li>
-<li><a href="../../../../Documentation/User Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</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/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/User Guide/Introduction/index.html">Introduction</a></li>
 <li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</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>Not all features of SQL can (or should) be mapped in the object model in terms of DataObjects. For such cases Cayenne provides a powerful mechanism for running both selecting and non-selecting SQL using scriptable SQLTemplate query. This chapter describes how simple SQLTemplates can be created and executed with DataContext to select or update the database data. Subsequent chapters show how to build SQL dynamically, bind parameters and describe result sets using SQLTemplate scripting features.</p>
-
-<h3><a name="SQLTemplateQuery-CreatingSQLTemplate"></a>Creating SQLTemplate</h3>
+<div id="ConfluenceContent"><p>Not all features of SQL can (or should) be mapped in the object model in terms of Persistent objects. For such cases Cayenne provides a powerful mechanism for running both selecting and non-selecting SQL using scriptable SQLTemplate query. The following chapters describe how SQLTemplates can be created and executed, showing how to build SQL dynamically, bind parameters and describe result sets with SQLTemplate scripting features.</p>
 
-<p>SQLTemplates can be built using CayenneModeler. Here we demonstrate how to do the same thing via API. SQLTemplate consists of root and dynamic template string. Dynamic behavior of the template is discussed in subsequent chapters, for now it is sufficient to know that the template string is simply a valid SQL statement in the target database SQL dialect.</p>
-<div class="code"><div class="codeContent">
-<pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.query.SQLTemplate;
-...
-<span class="code-comment">// create selecting SQLTemplate
-</span>SQLTemplate selectQuery = <span class="code-keyword">new</span> SQLTemplate(Artist.class, <span class="code-quote">"select * from ARTIST"</span>);
-...
-<span class="code-comment">// create updating SQLTemplate
-</span>SQLTemplate updateQuery = <span class="code-keyword">new</span> SQLTemplate(Artist.class, <span class="code-quote">"delete from ARTIST"</span>);</pre>
-</div></div>
+<h3><a name="SQLTemplateQuery-Sections"></a>Sections</h3>
 
-<h3><a name="SQLTemplateQuery-SelectingObjectswithSQLTemplate"></a>Selecting Objects with SQLTemplate</h3>
-
-<p>Selecting SQLTemplate is very similar to SelectQuery in many respects. It can be executed via <tt>DataContext.performQuery(..)</tt> and supports the same configuration parameters, such as fetch limit, pagination, etc. It can be configured to return DataObjects (default) or data rows.</p>
-<div class="code"><div class="codeContent">
-<pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.query.SQLTemplate;
-...
-<span class="code-comment">// fetch all artists, but no more than 1000 objects...
-</span>SQLTemplate rawSelect = <span class="code-keyword">new</span> SQLTemplate(Artist.class, <span class="code-quote">"select * from ARTIST"</span>);
-rawSelect.setFetchLimit(1000);
-
-List artists = dataContext.performQuery(rawSelect);</pre>
-</div></div>
-
-<h3><a name="SQLTemplateQuery-ModifyingDatawithSQLTemplate"></a>Modifying Data with SQLTemplate</h3>
-
-<p>Non-selecting SQLTemplate allows to execute arbitrary SQL that modifies the database, but does not return the results. <tt>DataContext.performNonSelectingQuery(..)</tt> is used for this task.</p>
-
-<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>When changing or deleting data via SQLTemplate you must realize that such changes are done directly to the database, bypassing the context, and therefore may potentially leave object graph in an inconsistent state.</td></tr></table>
-
-<div class="code"><div class="codeContent">
-<pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.query.SQLTemplate;
-...
-<span class="code-comment">// fetch all artists, but no more than 1000 objects...
-</span>SQLTemplate rawDelete = <span class="code-keyword">new</span> SQLTemplate(Artist.class, <span class="code-quote">"delete from ARTIST"</span>);
-<span class="code-object">int</span>[] deleteCounts = dataContext.performNonSelectingQuery(rawDelete);</pre>
-</div></div>
-
-<h3><a name="SQLTemplateQuery-CustomizingSQLDialects"></a>Customizing SQL Dialects</h3>
-
-<p>Even though SQL is an industry standard, different DB vendors still have their own dialects and extensions. Two versions of the same query written for Oracle and PostgreSQL may look quiet different.</p>
-
-<p>Each SQLTemplate query has a default template, usually set in constructor. Internally it also keeps a map of alternative templates. This map normally uses a fully-qualified class name of the target DbAdapter as a key. This way Cayenne can determine which one of the SQL strings to use during the execution. Alternative SQL strings are configured using <tt>SQLTemplate.setTemplate(...)</tt>:</p>
-<div class="code"><div class="codeContent">
-<pre class="code-java"><span class="code-comment">// build template with <span class="code-keyword">default</span> SQL
-</span>SQLTemplate query = <span class="code-keyword">new</span> SQLTemplate(Artist.class, <span class="code-quote">"select * from ARTIST"</span>);
-
-<span class="code-comment">// <span class="code-keyword">for</span> Postgres it would be nice to trim the CHAR ARTIST_NAME column
-</span><span class="code-comment">// or otherwise it will be returned padded with spaces
-</span><span class="code-object">String</span> pgTemplate = <span class="code-quote">"SELECT ARTIST_ID, RTRIM(ARTIST_NAME), DATE_OF_BIRTH FROM ARTIST"</span>;
-query.setTemplate(PostgresAdapter.class.getName(), pgTemplate);</pre>
-</div></div></div>
+<ol>
+	<li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/SQLTemplate Basics/index.html" title="SQLTemplate Basics">SQLTemplate Basics</a></li>
+	<li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/Scripting SQLTemplate/index.html" title="Scripting SQLTemplate">Scripting SQLTemplate</a></li>
+	<li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/Advanced SQLTemplate/index.html" title="Advanced SQLTemplate">Advanced SQLTemplate</a></li>
+</ol>
+</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
+    Copyright &copy;2001-2007 Apache Software Foundation
   </div>
 
 </body>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SelectQuery Customization/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User%20Guide/Queries/SelectQuery%20Customization/index.html?view=diff&rev=552490&r1=552489&r2=552490
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SelectQuery Customization/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SelectQuery Customization/index.html Mon Jul  2 06:36:24 2007
@@ -29,41 +29,41 @@
   </div>
 <div id="cayenne_toc">
 <ul>
+<li><a href="../../../../Documentation/User Guide/Maven2 Plugins/index.html">Maven2 Plugins</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/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
 <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/Ant Tasks/index.html">Ant Tasks</a></li>
 <li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
 <li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a><ul>
-<li><a href="../../../../Documentation/User Guide/Queries/SelectQuery/index.html">SelectQuery</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Qualifier Expressions/index.html">Qualifier Expressions</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Using Orderings/index.html">Using Orderings</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Caching Query Results/index.html">Caching Query Results</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Customizing Queries/index.html">Customizing Queries</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/SelectQuery Customization/index.html">SelectQuery Customization</a><ul>
 </ul>
 </li>
+<li><a href="../../../../Documentation/User Guide/Queries/Using Orderings/index.html">Using Orderings</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/Parameterized Queries/index.html">Parameterized Queries</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/index.html">SQLTemplate Query</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Scripting SQLTemplate/index.html">Scripting SQLTemplate</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/RelationshipQuery/index.html">RelationshipQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/Queries Stored in DataMap/index.html">Queries Stored in DataMap</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Caching Query Results/index.html">Caching Query Results</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Customizing Queries/index.html">Customizing Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/index.html">SQLTemplate Query</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Qualifier Expressions/index.html">Qualifier Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/SelectQuery/index.html">SelectQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/NamedQuery/index.html">NamedQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/ObjectIdQuery/index.html">ObjectIdQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/QueryChain/index.html">QueryChain</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/RelationshipQuery/index.html">RelationshipQuery</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/EJBQLQuery/index.html">EJBQLQuery</a></li>
 </ul>
 </li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</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></li>
 </ul>
 </div>
 <div id="ConfluenceContent"><p><a href="../../../../Documentation/User Guide/Queries/SelectQuery/index.html" title="SelectQuery">SelectQueries</a> allow to fine tune the behavior of the fetch using the following API:</p>
@@ -87,7 +87,7 @@
   <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
+    Copyright &copy;2001-2007 Apache Software Foundation
   </div>
 
 </body>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SelectQuery/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User%20Guide/Queries/SelectQuery/index.html?view=diff&rev=552490&r1=552489&r2=552490
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SelectQuery/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/User Guide/Queries/SelectQuery/index.html Mon Jul  2 06:36:24 2007
@@ -29,41 +29,41 @@
   </div>
 <div id="cayenne_toc">
 <ul>
+<li><a href="../../../../Documentation/User Guide/Maven2 Plugins/index.html">Maven2 Plugins</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/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/User Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/DataViews/index.html">DataViews</a></li>
+<li><a href="../../../../Documentation/User Guide/Stored Procedures/index.html">Stored Procedures</a></li>
 <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/Ant Tasks/index.html">Ant Tasks</a></li>
 <li><a href="../../../../Documentation/User Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/User Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/User Guide/Deployment/index.html">Deployment</a></li>
 <li><a href="../../../../Documentation/User Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/User Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/User Guide/Customizing/index.html">Customizing</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/index.html">Queries</a><ul>
-<li><a href="../../../../Documentation/User Guide/Queries/SelectQuery/index.html">SelectQuery</a><ul>
-</ul>
-</li>
-<li><a href="../../../../Documentation/User Guide/Queries/Qualifier Expressions/index.html">Qualifier Expressions</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Using Orderings/index.html">Using Orderings</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Caching Query Results/index.html">Caching Query Results</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Customizing Queries/index.html">Customizing Queries</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/SelectQuery Customization/index.html">SelectQuery Customization</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Using Orderings/index.html">Using Orderings</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/Parameterized Queries/index.html">Parameterized Queries</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/index.html">SQLTemplate Query</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Scripting SQLTemplate/index.html">Scripting SQLTemplate</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/RelationshipQuery/index.html">RelationshipQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/Queries Stored in DataMap/index.html">Queries Stored in DataMap</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Caching Query Results/index.html">Caching Query Results</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/Customizing Queries/index.html">Customizing Queries</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/SQLTemplate Query/index.html">SQLTemplate Query</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/Qualifier Expressions/index.html">Qualifier Expressions</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/SelectQuery/index.html">SelectQuery</a><ul>
+</ul>
+</li>
 <li><a href="../../../../Documentation/User Guide/Queries/NamedQuery/index.html">NamedQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/ObjectIdQuery/index.html">ObjectIdQuery</a></li>
 <li><a href="../../../../Documentation/User Guide/Queries/QueryChain/index.html">QueryChain</a></li>
-<li><a href="../../../../Documentation/User Guide/Queries/RelationshipQuery/index.html">RelationshipQuery</a></li>
+<li><a href="../../../../Documentation/User Guide/Queries/EJBQLQuery/index.html">EJBQLQuery</a></li>
 </ul>
 </li>
+<li><a href="../../../../Documentation/User Guide/Installation/index.html">Installation</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></li>
 </ul>
 </div>
 <div id="ConfluenceContent"><p>The most commonly used query is SelectQuery. It is a descriptor that allows DataContext to fetch lists of DataObjects of the right type matching the specified criteria. SelectQuery together with the DataMap provides just enough information to the Cayenne runtime objects to build the right SQL SELECT statement and control various execution parameters.</p>
@@ -132,7 +132,7 @@
   <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
+    Copyright &copy;2001-2007 Apache Software Foundation
   </div>
 
 </body>



Mime
View raw message