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/10/25 13:06:25 UTC

svn commit: r829552 [4/6] - in /cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation: ./ Cayenne Guide/Ant Tasks/ Cayenne Guide/Ant Tasks/cdataport/ Cayenne Guide/Ant Tasks/cdbgen/ Cayenne Guide/Ant Tasks/cdbimport/ Cayenne Guide/Ant Tasks/...

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Performance Tuning/Turning off Context Synchronization/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Performance%20Tuning/Turning%20off%20Context%20Synchronization/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Performance Tuning/Turning off Context Synchronization/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Performance Tuning/Turning off Context Synchronization/index.html Sun Oct 25 12:06:20 2009
@@ -60,7 +60,7 @@
 <div id="ConfluenceContent">
 <p>A big part of commit operation is updating peer DataContexts with the changes committed to the database. The conext synchronization operation has <tt>O(N)</tt> performance, where <tt>N</tt> is the number of peer DataContexts. In a web application <tt>N</tt> is often the number of concurrent sessions, which can be quite big. The throughout of high volume applications can be  improved by turning off peer synchronization. One possible way to do that is via a custom <a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html" title="DataContextFactory">DataContextFactory</a>:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java"><span class="code-keyword">public</span> class IsolatedDataContextFactory <span class="code-keyword">implements</span> DataContextFactory {
 
     <span class="code-keyword">public</span> DataContext createDataContext(DataChannel parent, ObjectStore objectStore) {
@@ -74,9 +74,9 @@
 
 <p>Of course doing this may result in some stale data in the peer DataContexts, so a decision whether to use this particular technique should be made based on the application specifics. Also a factory can have logic to selectively turn off synchronization for a subset of DataContexts based on some criteria.</p>
 
-<table cellpadding='5' width='85%' cellspacing='8px' class='tipMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Don't use this for idle applications</b><br />Note that this optimization does not affect percieved user commit time, as synchronization is done in a separate thread. It only affects the overall throughput. So it only makes sense if your application already utilizes close to a 100% of CPU.</td></tr></table>
+<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Don't use this for idle applications</b><br />Note that this optimization does not affect percieved user commit time, as synchronization is done in a separate thread. It only affects the overall throughput. So it only makes sense if your application already utilizes close to a 100% of CPU.</td></tr></table></div>
 
-<p><em>Further improvements in this area are tracked via <span class="nobr"><a href="http://issues.apache.org/cayenne/browse/CAY-554" title="Visit page outside Confluence" rel="nofollow">CAY-554 Jira issue<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>.</em></p></div>
+<p><em>Further improvements in this area are tracked via <a href="http://issues.apache.org/cayenne/browse/CAY-554" rel="nofollow">CAY-554 Jira issue</a>.</em></p></div>
 </div>
   <div class="clearer">.</div>
   <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/Caching Query Results/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/Caching%20Query%20Results/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/Caching Query Results/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/Caching Query Results/index.html Sun Oct 25 12:06:20 2009
@@ -63,7 +63,7 @@
 </div>
 <div id="ConfluenceContent"><p>Cayenne provides a way to cache query results, avoiding unneeded database trips for the frequently used queries. Caching policy is configured per query. Policy can be set via the API or in CayenneModeler.</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">Upgrading to Cayenne 1.2 and Newer</b><br /><tt>org.apache.cayenne.query.GenericSelectQuery</tt> interface that defined cache policy types is deprecated. Cache policies are now a part of the new <tt>org.apache.cayenne.query.QueryMetadata</tt> interface.</td></tr></table>
+<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>Upgrading to Cayenne 1.2 and Newer</b><br /><tt>org.apache.cayenne.query.GenericSelectQuery</tt> interface that defined cache policy types is deprecated. Cache policies are now a part of the new <tt>org.apache.cayenne.query.QueryMetadata</tt> interface.</td></tr></table></div>
 
 <p>The following cache policies are supported:</p>
 
@@ -108,7 +108,7 @@
 <p>Users must set two Query parameters to configure caching - query <b>name</b> that is used as a key to result cache and query <b>cache policy</b> (one of the policies above). Note that if two unrelated queries have the same name, they will hit the same cache entry. This is not a bug, this is a feature that should be taken into consideration when naming queries.</p>
 
 <p>Below we will create a query and set its caching policy to LOCAL_CACHE:</p>
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">SelectQuery query = <span class="code-keyword">new</span> SelectQuery(Artist.class);
 
 <span class="code-comment">// set query name that will be used as a unique key to perform result caching
@@ -121,27 +121,30 @@
 DataContext context = ... <span class="code-comment">// assume <span class="code-keyword">this</span> exists
 </span>
 <span class="code-comment">// there is probably no cache at <span class="code-keyword">this</span> point, so the query will hit the database
-</span>List objects = context.performQuery(query);</pre>
+</span>List objects = context.performQuery(query);
+</pre>
 </div></div>
 
 <p>Reruning the query in the same DataContext at a later time will be much faster as it will be hitting the cache:</p>
 
-<div class="code"><div class="codeContent">
-<pre class="code-java">List objects1 = context.performQuery(query);</pre>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">List objects1 = context.performQuery(query);
+</pre>
 </div></div>
 
 <p>Here we want to refresh the cache, but still keep caching the fresh result:</p>
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">query.setCachePolicy(GenericSelectQuery.LOCAL_CACHE_REFRESH);
 
-List objects2 = context.performQuery(query);</pre>
+List objects2 = context.performQuery(query);
+</pre>
 </div></div>
 
 <p>The example above shows caching with <tt>SelectQuery</tt>, but it works exactly the same way for <tt>SQLTemplate</tt> and <tt>ProcedureQuery</tt>. Similarly <tt>SHARED_CACHE</tt> and <tt>SHARED_CACHE_REFRESH</tt> cache policies create cache shared by all DataDontexts that work with a given DataDomain. </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">Upgrading to Cayenne 1.2 and Newer</b><br /><br/>
-Cache refreshing API has changed in 1.2. Cayenne 1.1 relied on the use of <tt>SelectQuery.setRefreshingObjects(..)</tt> to determine whether to expire cached result lists. This is no longer the case (setting this flag only refreshes <b>individual objects</b> as it should, and has no effect whatsoever on list caching). Instead caching and cache refreshing is controlled by the cache policy as described above.</td></tr></table>
+<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>Upgrading to Cayenne 1.2 and Newer</b><br /><br/>
+Cache refreshing API has changed in 1.2. Cayenne 1.1 relied on the use of <tt>SelectQuery.setRefreshingObjects(..)</tt> to determine whether to expire cached result lists. This is no longer the case (setting this flag only refreshes <b>individual objects</b> as it should, and has no effect whatsoever on list caching). Instead caching and cache refreshing is controlled by the cache policy as described above.</td></tr></table></div>
 
 
 <h3><a name="CachingQueryResults-QueriesMappedinCayenneModeler"></a>Queries Mapped in CayenneModeler</h3>
@@ -152,27 +155,31 @@
 
 <p>Then it can be executed via DataContext:</p>
 
-<div class="code"><div class="codeContent">
-<pre class="code-java">List objects1 = context.performQuery(<span class="code-quote">"MyQuery"</span>, <span class="code-keyword">false</span>);</pre>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">List objects1 = context.performQuery(<span class="code-quote">"MyQuery"</span>, <span class="code-keyword">false</span>);
+</pre>
 </div></div>
 
 <p>The second "false" parameter above indicated that if possible, cached result should be used. Now if we want to force refresh, it can be changed to true (for just this invocation - this does not affect the underlying saved query)</p>
 
-<div class="code"><div class="codeContent">
-<pre class="code-java">List objects2 = context.performQuery(<span class="code-quote">"MyQuery"</span>, <span class="code-keyword">true</span>);</pre>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">List objects2 = context.performQuery(<span class="code-quote">"MyQuery"</span>, <span class="code-keyword">true</span>);
+</pre>
 </div></div>
 
 <p>Note that parameterized named queries will still work correctly with the cache. We've already mentioned that the users must ensure that two queries must have different names if they fetch logically different data. This is NOT the case with queries stored in the DataMap. If you run the same named query with different sets of parameters, Cayenne will internally generate unique cache keys for each distinct parameter set.</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">Map parameters = Collections.singletonMap(<span class="code-quote">"key"</span>, <span class="code-quote">"value1"</span>);
-List objects1 = context.performQuery(<span class="code-quote">"MyQuery"</span>, parameters, <span class="code-keyword">false</span>);</pre>
+List objects1 = context.performQuery(<span class="code-quote">"MyQuery"</span>, parameters, <span class="code-keyword">false</span>);
+</pre>
 </div></div>
 
 <p>Now if we run the same query with a different set of parameters, Cayenne will do the right thing and create a separate entry in the cache:</p>
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">Map parameters = Collections.singletonMap(<span class="code-quote">"key"</span>, <span class="code-quote">"value2"</span>);
-List objects2 = context.performQuery(<span class="code-quote">"MyQuery"</span>, parameters, <span class="code-keyword">false</span>);</pre>
+List objects2 = context.performQuery(<span class="code-quote">"MyQuery"</span>, parameters, <span class="code-keyword">false</span>);
+</pre>
 </div></div>
 
 </div>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/Customizing Queries/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/Customizing%20Queries/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/Customizing Queries/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/Customizing Queries/index.html Sun Oct 25 12:06:20 2009
@@ -67,7 +67,7 @@
 
 <p>The interface defines the following methods (ommitting irrelevant deprecated ones):</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java"><span class="code-keyword">public</span> <span class="code-keyword">interface</span> Query <span class="code-keyword">extends</span> Serializable {
 
     <span class="code-object">String</span> getName();
@@ -104,7 +104,7 @@
 
 <p>One customization strategy is an "indirect" query that encapsulates some user-defined operation and in runtime resolves to one or more standard Cayenne queries. Indirect queries can be created from scratch or by extending <tt>org.apache.cayenne.query.IndirectQuery</tt>. As an example lets implement a "CountQuery" query that returns a number of rows in a given table:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java"><span class="code-keyword">public</span> class CountQuery <span class="code-keyword">extends</span> IndirectQuery {
 	<span class="code-keyword">protected</span> <span class="code-object">Class</span> objectClass;
 
@@ -132,7 +132,7 @@
 
 <p>Now you can run the query like that:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">CountQuery query = <span class="code-keyword">new</span> CountQuery(Artist.class);
 DataContext context = DataContext.createDataContext();
 

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/EJBQLQuery/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/EJBQLQuery/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/EJBQLQuery/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/EJBQLQuery/index.html Sun Oct 25 12:06:20 2009
@@ -69,7 +69,7 @@
 
 <p>Details of the syntax are available in various JPA literature. Here is an example of an EJBQL query:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">select p from Painting p WHERE p.estimatedPrice &gt; 3000</pre>
 </div></div>
 
@@ -81,7 +81,7 @@
 
 <p>Creating an EJBQLQuery is simple - just pass a valid EJBQL string to the constructor:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">EJBQLQuery query = <span class="code-keyword">new</span> EJBQLQuery(<span class="code-quote">"select a FROM Artist a"</span>);</pre>
 </div></div> 
 
@@ -89,7 +89,7 @@
 
 <p>Select objects:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">List artists = context.performQuery(query);</pre>
 </div></div>
 

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/NamedQuery/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/NamedQuery/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/NamedQuery/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/NamedQuery/index.html Sun Oct 25 12:06:20 2009
@@ -65,13 +65,14 @@
 <p><tt>NamedQuery</tt> is a query that is a reference to another query stored in the DataMap. It can hold named parameters that will be passed to the named query on execution.</p>
 
 <p>Assuming that there a query called "Login" was previously mapped in the Modeler, we can do this:</p>
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java"><span class="code-object">String</span>[] keys = <span class="code-keyword">new</span> <span class="code-object">String</span>[] {<span class="code-quote">"loginid"</span>, <span class="code-quote">"password"</span>};
 <span class="code-object">Object</span>[] values = <span class="code-keyword">new</span> <span class="code-object">String</span>[] {<span class="code-quote">"joe"</span>, <span class="code-quote">"secret"</span>};
 
 NamedQuery query = <span class="code-keyword">new</span> NamedQuery(<span class="code-quote">"Login"</span>, keys, values);
 
-List matchingUsers = context.performQuery(query);</pre>
+List matchingUsers = context.performQuery(query);
+</pre>
 </div></div></div>
 </div>
   <div class="clearer">.</div>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/ObjectIdQuery/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/ObjectIdQuery/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/ObjectIdQuery/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/ObjectIdQuery/index.html Sun Oct 25 12:06:20 2009
@@ -86,19 +86,20 @@
 
 <p>An example of getting a guranteed fresh object:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">ObjectId id = <span class="code-keyword">new</span> ObjectId(<span class="code-quote">"Artist"</span>, Artist.ARTIST_ID_PK_COLUMN, 55);
 
 <span class="code-comment">// <span class="code-keyword">this</span> constructor implicitly uses <span class="code-quote">"CACHE_REFRESH"</span> policy, so a fresh object will be returned
 </span>ObjectIdQuery query = <span class="code-keyword">new</span> ObjectIdQuery(id);
 
 DataContext context = ...
-Artist object = (Artist) DataObjectUtils.objectForQuery(context, query);</pre>
+Artist object = (Artist) DataObjectUtils.objectForQuery(context, query);
+</pre>
 </div></div>
 
 <p>An example of checking whether an object is already cached:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">ObjectId id = <span class="code-keyword">new</span> ObjectId(<span class="code-quote">"Artist"</span>, Artist.ARTIST_ID_PK_COLUMN, 55);
 ObjectIdQuery query = <span class="code-keyword">new</span> ObjectIdQuery(id, <span class="code-keyword">false</span>, ObjectIdQuery.CACHE_NO_REFRESH);
 
@@ -109,7 +110,8 @@
 </span>}
 <span class="code-keyword">else</span> {
   <span class="code-comment">// cached
-</span>}</pre>
+</span>}
+</pre>
 </div></div></div>
 </div>
   <div class="clearer">.</div>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/Queries Stored in DataMap/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/Queries%20Stored%20in%20DataMap/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/Queries Stored in DataMap/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/Queries Stored in DataMap/index.html Sun Oct 25 12:06:20 2009
@@ -65,7 +65,7 @@
 <p>To facilitate reuse of queries users can assign symbolic names to them and store such named queries in a DataMap. Normally this is done by <a href="../../../../Documentation/Modeler Guide/Modeling Queries/index.html" title="Modeling Queries">creating a query in CayenneModeler</a>. Storing queries in a DataMap reduces the amount of code and speeds up query creation process.</p>
 
 <p>This example shows how to get a shared instance of a stored query, and use it as a template for customized query.</p>
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">DataContext context = ... <span class="code-comment">// assume <span class="code-keyword">this</span> exists
 </span>
 <span class="code-comment">// 1. lookup prototype
@@ -79,14 +79,16 @@
 SelectQuery query = prototype.queryWithParameters(params);
 
 <span class="code-comment">// 3. execute query
-</span>List objects = context.performQuery(query);</pre>
+</span>List objects = context.performQuery(query);
+</pre>
 </div></div>
 <p>DataContext supports running a named query with preset parameters directly:</p>
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">DataContext context = ... <span class="code-comment">// assume <span class="code-keyword">this</span> exists
 </span>
 <span class="code-comment">// <span class="code-quote">"<span class="code-keyword">false</span>"</span> indicates that a cached result should be used <span class="code-keyword">if</span> available 
-</span>List objects = context.performQuery(<span class="code-quote">"MySelect"</span>, <span class="code-keyword">false</span>);</pre>
+</span>List objects = context.performQuery(<span class="code-quote">"MySelect"</span>, <span class="code-keyword">false</span>);
+</pre>
 </div></div></div>
 </div>
   <div class="clearer">.</div>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/QueryChain/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/QueryChain/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/QueryChain/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/QueryChain/index.html Sun Oct 25 12:06:20 2009
@@ -63,14 +63,15 @@
 </div>
 <div id="ConfluenceContent">
 <p><tt>QueryChain</tt>, as the name implies, is a Query that is itself a collection of other queries. It simplifies an execution of multiple queries in a single batch. E.g.:</p>
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">QueryChain query = <span class="code-keyword">new</span> QueryChain();
 query.addQuery(<span class="code-keyword">new</span> SQLTemplate(Project.class, <span class="code-quote">"delete from project"</span>));
 query.addQuery(<span class="code-keyword">new</span> SQLTemplate(Project.class, <span class="code-quote">"delete from person"</span>));
 query.addQuery(<span class="code-keyword">new</span> SQLTemplate(Project.class, <span class="code-quote">"delete from department"</span>));
 
 DataContext context = ...
-context.performNonSelectingQuery(query);</pre>
+context.performNonSelectingQuery(query);
+</pre>
 </div></div></div>
 </div>
   <div class="clearer">.</div>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/RelationshipQuery/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/RelationshipQuery/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/RelationshipQuery/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/RelationshipQuery/index.html Sun Oct 25 12:06:20 2009
@@ -64,7 +64,7 @@
 <div id="ConfluenceContent">
 <p><tt>RelationshipQuery</tt> is used by Cayenne internally to fetch object(s) related to a single given object via a mapped ObjRelationship. In some cases the query can be used directly in the application, e.g. if we want to refresh related objects.</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">ObjectId id = <span class="code-keyword">new</span> ObjectId(<span class="code-quote">"Artist"</span>, <span class="code-quote">"ARTIST_ID"</span>, 55);
 RelationshipQuery query = <span class="code-keyword">new</span> RelationshipQuery(id, <span class="code-quote">"paintingArray"</span>, <span class="code-keyword">true</span>);
 List paintings = context.performQuery(query);</pre>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SQLTemplate Query/Advanced SQLTemplate/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/SQLTemplate%20Query/Advanced%20SQLTemplate/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SQLTemplate Query/Advanced SQLTemplate/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SQLTemplate Query/Advanced SQLTemplate/index.html Sun Oct 25 12:06:20 2009
@@ -77,7 +77,7 @@
 
 <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">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">SQLTemplate query = <span class="code-keyword">new</span> SQLTemplate(<span class="code-quote">"SELECT * FROM ARTIST"</span>);
 query.setColumnNamesCapitalization(CapsStrategy.LOWER);
 List objects = context.performQuery(query);</pre>
@@ -85,7 +85,7 @@
 
 <p>or </p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">SQLTemplate query = <span class="code-keyword">new</span> SQLTemplate(<span class="code-quote">"SELECT * FROM ARTIST"</span>);
 query.setColumnNamesCapitalization(CapsStrategy.UPPER);
 List objects = context.performQuery(query);</pre>
@@ -96,7 +96,7 @@
 
 <p><a href="../../../../../Documentation/Cayenne Guide/Performance Tuning/Prefetching/index.html" title="Prefetching">Prefetching</a> allows to fetch related objects of different kinds in a single query run. SQLTemplate uses "joint" prefetching. However Cayenne expects the user to provide special naming of the result columns to be able to instantiate persistent objects from the result set. Columns belonging to the "root" entity of the query should use unqualified names corresponding to the root DbEntity columns, for each related entity column names must be prefixed with relationship name and a dot (e.g. "toArtist.ID"). Column naming can be controlled with "#result" directive. E.g.:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">SQLTemplate q = <span class="code-keyword">new</span> SQLTemplate(
                 Artist.class,
                 <span class="code-quote">"SELECT distinct "</span>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SQLTemplate Query/SQLTemplate Basics/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/SQLTemplate%20Query/SQLTemplate%20Basics/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SQLTemplate Query/SQLTemplate Basics/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SQLTemplate Query/SQLTemplate Basics/index.html Sun Oct 25 12:06:20 2009
@@ -70,41 +70,44 @@
 <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">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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>
+</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">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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>
+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='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>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>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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>
+<span class="code-object">int</span>[] deleteCounts = dataContext.performNonSelectingQuery(rawDelete);
+</pre>
 </div></div>
 
 <h3><a name="SQLTemplateBasics-CustomizingSQLDialects"></a>Customizing SQL Dialects</h3>
@@ -112,14 +115,15 @@
 <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">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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>
+query.setTemplate(PostgresAdapter.class.getName(), pgTemplate);
+</pre>
 </div></div></div>
 </div>
   <div class="clearer">.</div>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SQLTemplate Query/SQLTemplate Result Mapping/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/SQLTemplate%20Query/SQLTemplate%20Result%20Mapping/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SQLTemplate Query/SQLTemplate Result Mapping/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SQLTemplate Query/SQLTemplate Result Mapping/index.html Sun Oct 25 12:06:20 2009
@@ -73,14 +73,14 @@
 
 <p>To get either DataObjects or DataRows, not much configuration is needed:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">SQLTemplate query = <span class="code-keyword">new</span> SQLTemplate(Artist.class, <span class="code-quote">"SELECT * FROM ARTIST"</span>);
 
 <span class="code-comment">// List of Artist
 </span>List artists = context.performQuery(query);</pre>
 </div></div>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">SQLTemplate query = <span class="code-keyword">new</span> SQLTemplate(Artist.class, <span class="code-quote">"SELECT * FROM ARTIST"</span>);
 
 <span class="code-comment">// *** Force DataRows
@@ -94,7 +94,7 @@
 
 <p>To select a list of scalar values, you will need to use a SQLResultSetMapping class to tell Cayenne how to deal with it:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">SQLTemplate query = <span class="code-keyword">new</span> SQLTemplate(Painting.class, <span class="code-quote">"SELECT ESTIMATED_PRICE P FROM PAINTING"</span>);
 
 <span class="code-comment">// *** let Cayenne know that result is a scalar
@@ -108,7 +108,7 @@
 
 <p>Or if the query nature guarantees only a single row in the result (aggregate query), do this:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">SQLTemplate query = <span class="code-keyword">new</span> SQLTemplate(Painting.class, <span class="code-quote">"SELECT SUM(ESTIMATED_PRICE) S FROM PAINTING"</span>);
 
 <span class="code-comment">// *** let Cayenne know that result is a scalar
@@ -124,7 +124,7 @@
 
 <p>SQLResultSetMapping can be used to fetch a mix of objects and scalars. In this case the result will be <tt>Object[]</tt> that contains scalars and objects in the order they were configured in SQLResultSetMapping:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java">SQLTemplate query = <span class="code-keyword">new</span> SQLTemplate(Artist.class, <span class="code-quote">"SELECT t0.ARTIST_ID, t0.NAME, t0.DATE_OF_BIRTH, COUNT(t1.PAINTING_ID) C "</span> +
       <span class="code-quote">"FROM ARTIST t0 LEFT JOIN PAINTING t1 ON (t0.ARTIST_ID = t1.ARTIST_ID) "</span> +
       <span class="code-quote">"GROUP BY t0.ARTIST_ID, t0.NAME, t0.DATE_OF_BIRTH"</span>);

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SQLTemplate Query/Scripting SQLTemplate/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/SQLTemplate%20Query/Scripting%20SQLTemplate/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SQLTemplate Query/Scripting SQLTemplate/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SQLTemplate Query/Scripting SQLTemplate/index.html Sun Oct 25 12:06:20 2009
@@ -69,23 +69,24 @@
 </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>
+<p>Scripting of SQL strings is done using <a href="http://velocity.apache.org" rel="nofollow">Apache Velocity</a>. 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>
+<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>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></div>
 
 <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">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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>);
+SQLTemplate delete = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql);
 ...
 <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>
+</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>
@@ -99,22 +100,31 @@
 </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>
+<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>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></div>
 
-<p>While "select * from" queries may work just fine, in most cases it is a good idea to explicitly describe results.</p>
+<p>While "select * from" queries may work just fine, in many 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">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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>);
+SQLTemplate select = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql);
 ...
 DataContext context...;
-List artists = context.performQuery(select);</pre>
+List artists = context.performQuery(select);
+</pre>
+</div></div>
+
+<p>Note that it is possible to mix columns described via #result() with regular columns. Columns without an explicit #result() directive will be mapped automatically using JDBC metadata.  E.g.:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<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">long</span>'),"</span>
+   + <span class="code-quote">" ARTIST_NAME, DATE_OF_BIRTH FROM ARTIST"</span>;</pre>
 </div></div>
 
 <h3><a name="ScriptingSQLTemplate-BindingParameters%23bindDirective"></a>Binding Parameters - #bind Directive</h3>
@@ -123,15 +133,15 @@
 <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>
+	<li><tt>#bind(value jdbcTypeName scale)</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">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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>);
+SQLTemplate update = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql);
 ...
 <span class="code-comment">// set parameters and run it...
 </span>Map parameters = <span class="code-keyword">new</span> HashMap();
@@ -140,16 +150,17 @@
 update.setParameters(parameters);
 
 DataContext context...;
-context.performNonSelectingQuery(update);</pre>
+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">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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>);
+SQLTemplate select = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql);
 ...
 <span class="code-comment">// set parameters and run it...
 </span>Map parameters = <span class="code-keyword">new</span> HashMap();
@@ -157,7 +168,8 @@
 select.setParameters(parameters);
 
 DataContext context...;
-List artists = context.performQuery(select);</pre>
+List artists = context.performQuery(select);
+</pre>
 </div></div>
 
 
@@ -167,16 +179,16 @@
 <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>
+	<li><tt>#bindEqual(value jdbcTypeName scale)</tt>, <tt>#bindNotEqual(value jdbcTypeName scale)</tt></li>
 </ul>
 
 
 <h5><a name="ScriptingSQLTemplate-NullValueExamples"></a>Null Value Examples</h5>
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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>);
+SQLTemplate update = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql);
 ...
 <span class="code-comment">// set parameters and run it...
 </span>Map parameters = <span class="code-keyword">new</span> HashMap();
@@ -188,14 +200,15 @@
 
 <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>
+</span>context.performNonSelectingQuery(update);
+</pre>
 </div></div>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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>);
+SQLTemplate update = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql);
 ...
 <span class="code-comment">// set parameters and run it...
 </span>Map parameters = <span class="code-keyword">new</span> HashMap();
@@ -207,7 +220,8 @@
 
 <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>
+</span>context.performNonSelectingQuery(update);
+</pre>
 </div></div>
 
 <h3><a name="ScriptingSQLTemplate-BindingPersistentObjectValues%23bindObjectEqualand%23bindObjectNotEqualdirectives"></a>Binding Persistent Object Values - #bindObjectEqual and #bindObjectNotEqual directives</h3>
@@ -222,7 +236,7 @@
 
 <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">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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);
@@ -233,7 +247,7 @@
 
 <p>In case of compound PK, arrays can be used for the last two parameters:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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>
@@ -249,7 +263,7 @@
 
 <p>E.g.:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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>
@@ -257,7 +271,7 @@
 <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">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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>
@@ -265,12 +279,13 @@
    + <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>
+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">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <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>
@@ -281,7 +296,8 @@
 </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>
+</span>SQLTemplate select = <span class="code-keyword">new</span> SQLTemplate(Artist.class, sql);
+</pre>
 </div></div>
 </div>
 </div>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SelectQuery/Parameterized Queries/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/SelectQuery/Parameterized%20Queries/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SelectQuery/Parameterized Queries/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SelectQuery/Parameterized Queries/index.html Sun Oct 25 12:06:20 2009
@@ -68,11 +68,11 @@
 </ul>
 </div>
 <div id="ConfluenceContent"><p>SelectQuery objects can be rather complex. They may contain long qualifiers and lots of tuning parameters. Parameterized Queries feature addresses reusability of complex queries. With this feature, for each group of queries that differ only in the values used in the qualifier, a developer may create a single shared "prototype" or "template" query, and use it later as a factory for other queries. All settings configured in the prototype object will be passed to the final queries. Qualifier of the prototype query may use named parameters that are substituted for real values when a final query is created from the prototype.</p>
-<table cellpadding='5' width='85%' cellspacing='8px' class='infoMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../../images/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>"Prototype" queries are normally created in CayenneModeler and stored in the DataMap XML file. "Queries Stored in DataMap" chapter describes how to use such templates. This chapter shows how to create them on the spot using the API calls.</td></tr></table>
+<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../../images/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>"Prototype" queries are normally created in CayenneModeler and stored in the DataMap XML file. "Queries Stored in DataMap" chapter describes how to use such templates. This chapter shows how to create them on the spot using the API calls.</td></tr></table></div>
 
 <p>Building a prototype query using <tt>Expression.fromString(..)</tt>:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.exp.Expression;
 <span class="code-keyword">import</span> org.apache.cayenne.query.SelectQuery;
 ...
@@ -81,12 +81,13 @@
 
 <span class="code-comment">// build a query prototype of a query - simply another select query
 </span>SelectQuery proto = <span class="code-keyword">new</span> SelectQuery(Painting.class, qual);
-proto.setDistinct(<span class="code-keyword">true</span>);</pre>
+proto.setDistinct(<span class="code-keyword">true</span>);
+</pre>
 </div></div>
 
 <p>Same example but using ExpressionFactory:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java"><span class="code-keyword">import</span> java.util.*;
 <span class="code-keyword">import</span> org.apache.cayenne.exp.Expression;
 <span class="code-keyword">import</span> org.apache.cayenne.exp.ExpressionFactory;
@@ -104,7 +105,8 @@
 
 <span class="code-comment">// build a query prototype of a query - simply another select query
 </span>SelectQuery proto = <span class="code-keyword">new</span> SelectQuery(Painting.class, qual);
-proto.setDistinct(<span class="code-keyword">true</span>);</pre>
+proto.setDistinct(<span class="code-keyword">true</span>);
+</pre>
 </div></div>
 <p>Prototype built in the example above can be used to create other queries. Relevalnt API is:</p>
 
@@ -118,7 +120,7 @@
 
 <p>Example of using queryWithParameters is shown below:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java"><span class="code-keyword">import</span> java.util.Map;
 <span class="code-keyword">import</span> java.util.HashMap;
 <span class="code-keyword">import</span> org.apache.cayenne.query.SelectQuery;
@@ -139,7 +141,8 @@
 params2.put(<span class="code-quote">"aname"</span>, <span class="code-quote">"Monet"</span>);
 params2.put(<span class="code-quote">"pname"</span>, <span class="code-quote">"The Beach at Trouville"</span>);
 SelectQuery query2 = proto.queryWithParameters(params2);
-...</pre>
+... 
+</pre>
 </div></div></div>
 </div>
   <div class="clearer">.</div>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SelectQuery/Using Orderings/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/SelectQuery/Using%20Orderings/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SelectQuery/Using Orderings/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SelectQuery/Using Orderings/index.html Sun Oct 25 12:06:20 2009
@@ -67,46 +67,78 @@
 <li><a href="../../../../../Documentation/Cayenne Guide/Customization/index.html">Customization</a></li>
 </ul>
 </div>
-<div id="ConfluenceContent"><p>To sort SelectQuery results, orderings are used. Orderings use path expressions discussed in the previous section to identify the attributes that must be used in sorting. For example to order results by artist name, the following code can be used:</p>
+<div id="ConfluenceContent"><p>To sort SelectQuery results, Orderings are used. Orderings use path expressions discussed in the previous section to identify the attributes that must be used in sorting.  Orderings also use a SortOrder to identify how the ordering should be performed.</p>
 
-<div class="code"><div class="codeContent">
+<p>There are 4 SortOrder options:</p>
+
+<ul>
+	<li>ASCENDING (ascending order, case &#8211; or database &#8211; sensitive)</li>
+	<li>ASCENDING_INSENSITIVE (ascending order, case-insensitive)</li>
+	<li>DESCENDING (descending order, case &#8211; or database &#8211; sensitive)</li>
+	<li>DESCENDING_INSENSITIVE (descending order, case-insensitive)</li>
+</ul>
+
+
+<p>To order results by artist name, the following code can be used:</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.query.SelectQuery;
+<span class="code-keyword">import</span> org.apache.cayenne.query.SortOrder;
 ...
 SelectQuery query = <span class="code-keyword">new</span> SelectQuery(<span class="code-quote">"Artist"</span>);
 
 <span class="code-comment">// add ordering by Artist name:
-</span>query.addOrdering(<span class="code-quote">"artistName"</span>, <span class="code-keyword">true</span>);</pre>
+</span>query.addOrdering(<span class="code-quote">"artistName"</span>, SortOrder.ASCENDING);
+</pre>
 </div></div>
 
+<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../../images/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Legacy Information</b><br /><p>In older versions of Cayenne (3.0M6 and before), the addOrdering() call in the above example would appear as:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">query.addOrdering(<span class="code-quote">"artistName"</span>, <span class="code-keyword">true</span>);
+</pre>
+</div></div>
+<p>A boolean parameter of true meant to order ascending (false descending).</p></td></tr></table></div>
+
 <p>Orderings also support in-memory sorting of lists of Java Beans (all DataObjects are normally Java Beans, since they has set/get method pairs for all the properties). For instance to sort with a single ordering, the following code might be used:</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.query.Ordering;
+<span class="code-keyword">import</span> org.apache.cayenne.query.SortOrder;
 ...
 <span class="code-comment">// assume <span class="code-keyword">this</span> is a properly initialized list of Artists
 </span>List list = ...; 
 
 <span class="code-comment">// creates asending ordering by Artist name
-</span>Ordering ordering = <span class="code-keyword">new</span> Ordering(<span class="code-quote">"artistName"</span>, <span class="code-keyword">true</span>);
+</span>Ordering ordering = <span class="code-keyword">new</span> Ordering(<span class="code-quote">"artistName"</span>, SortOrder.ASCENDING);
 
 <span class="code-comment">// orders a list
-</span>ordering.orderList(list);</pre>
+</span>ordering.orderList(list);
+</pre>
+</div></div>
+
+<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../../images/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Legacy Information</b><br /><p>In older versions of Cayenne (3.0M6 and before), the Ordering() constructor in the above example would appear as:</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
+<pre class="code-java">Ordering ordering = <span class="code-keyword">new</span> Ordering(<span class="code-quote">"artistName"</span>, <span class="code-keyword">true</span>);
+</pre>
 </div></div>
+<p>A boolean parameter of true meant to order ascending (false descending).</p></td></tr></table></div>
 
 <p>If there is a need to sort on more than one object property, multiple Orderings can be passed as a List to a static method <tt>orderList(List, List)</tt>. The cost of adding new Orderings decreases, as the list of objects ends up being sorted by the first Ordering, then, if any two objects are equal for first Ordering, by the second, and so on.</p>
 
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.query.Ordering;
+<span class="code-keyword">import</span> org.apache.cayenne.query.SortOrder;
 ...
 <span class="code-comment">// assume <span class="code-keyword">this</span> is a properly initialized list of Paintings
 </span>List list = ...; 
 
 List orderings = <span class="code-keyword">new</span> ArrayList();
-orderings.add(<span class="code-keyword">new</span> Ordering(<span class="code-quote">"paintingTitle"</span>, <span class="code-keyword">true</span>));
-orderings.add(<span class="code-keyword">new</span> Ordering(<span class="code-quote">"estimatedPrice"</span>, <span class="code-keyword">false</span>));
+orderings.add(<span class="code-keyword">new</span> Ordering(<span class="code-quote">"paintingTitle"</span>, SortOrder.ASCENDING));
+orderings.add(<span class="code-keyword">new</span> Ordering(<span class="code-quote">"estimatedPrice"</span>, SortOrder.DESCENDING));
 
 <span class="code-comment">// orders a list aplying multiple orderings
-</span>Ordering.orderList(list, orderings);</pre>
+</span>Ordering.orderList(list, orderings);
+</pre>
 </div></div></div>
 </div>
   <div class="clearer">.</div>

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SelectQuery/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Queries/SelectQuery/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SelectQuery/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SelectQuery/index.html Sun Oct 25 12:06:20 2009
@@ -101,19 +101,20 @@
 
 
 <p>SelectQuery provides constructors for all three types. For example:</p>
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.query.SelectQuery;
 ...
 <span class="code-comment">// <span class="code-keyword">this</span> is a valid Cayenne query that would allow to fetch
 </span><span class="code-comment">// all records from the ARTIST table as Artist objects
-</span>SelectQuery query = <span class="code-keyword">new</span> SelectQuery(Artist.class);</pre>
+</span>SelectQuery query = <span class="code-keyword">new</span> SelectQuery(Artist.class);
+</pre>
 </div></div>
 <p>Other components of the SelectQuery are discussed in the following sections.</p>
 
 <h3><a name="SelectQuery-ExecutingSelectQueries"></a>Executing SelectQueries</h3>
 
 <p>As mentioned earlier, queries are executed via <tt>DataContext.performQuery()</tt>. For instance to fetch all Artists existing in the database the following code is used:</p>
-<div class="code"><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java"><span class="code-keyword">import</span> org.apache.cayenne.query.SelectQuery;
 <span class="code-keyword">import</span> org.apache.cayenne.access.DataContext;
 <span class="code-keyword">import</span> java.util.List;
@@ -123,7 +124,8 @@
 
 <span class="code-comment">// The query would fetch *ALL* rows from the ARTIST table
 </span><span class="code-comment">// The list returned contains Artist objects, one object per row
-</span>List artists = ctxt.performQuery(query);</pre>
+</span>List artists = ctxt.performQuery(query);
+</pre>
 </div></div>
 <p>There is a special case when a query is run using <tt>DataContext.performIteratedQuery()</tt>. This is discussed in "Performance Tuning" chapter.</p>
 

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial DataContext/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Quick%20Start/Tutorial%20DataContext/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial DataContext/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial DataContext/index.html Sun Oct 25 12:06:20 2009
@@ -67,7 +67,7 @@
 </ul>
 
 
-<div class="code"><div class="codeHeader"><b>Main.java</b></div><div class="codeContent">
+<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">
 <pre class="code-java"><span class="code-keyword">package</span> cayenne.tutorial;
 
 <span class="code-keyword">public</span> class Main {
@@ -83,7 +83,7 @@
 </ul>
 
 
-<div class="code"><div class="codeHeader"><b>Main.java</b></div><div class="codeContent">
+<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">
 <pre class="code-java"><span class="code-keyword">package</span> cayenne.tutorial;
 
 <span class="code-keyword">import</span> org.apache.cayenne.access.DataContext;
@@ -103,7 +103,7 @@
 
 <p>Let's check what happens when you run the application. First you need to close CayenneModeler (as Derby does not allow multiple applications accessing the same database in the embedded mode). After that 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"><div class="preformattedContent">
+<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
 <pre>INFO  QueryLogger: Created connection pool: jdbc:derby:testdb;create=true
 	Driver class: org.apache.derby.jdbc.EmbeddedDriver
 	Min. connections in the pool: 1

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial DataObjects/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Quick%20Start/Tutorial%20DataObjects/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial DataObjects/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial DataObjects/index.html Sun Oct 25 12:06:20 2009
@@ -64,7 +64,7 @@
 <div id="ConfluenceContent"><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 classes <a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial Generate Database and Java Classes/index.html" title="Tutorial Generate Database and Java Classes">generated earlier</a> in this tutorial (e.g. <tt>cayenne.tutorial.Artist</tt>), you'll see that it extends a class with the name that starts with underscore (<tt>cayenne.tutorial.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 of the custom code when refreshing classes from the mapping model.</p>
 
 <p>Let's add a utility method to the Artist class that sets Artist date of birth, taking a string argument for the date:</p>
-<div class="code"><div class="codeHeader"><b>Artist.java</b></div><div class="codeContent">
+<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Artist.java</b></div><div class="codeContent panelContent">
 <pre class="code-java"><span class="code-keyword">package</span> cayenne.tutorial;
 
 <span class="code-keyword">import</span> java.text.ParseException;
@@ -108,7 +108,7 @@
 
 <p>An object is created and registered with DataContext using "newObject" method. (Note that objects must be registered with DataContext to be persisted and to allow relationships with other objects.) Add this code to the "main" method:</p>
 
-<div class="code"><div class="codeHeader"><b>Main.java</b></div><div class="codeContent">
+<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">
 <pre class="code-java">Artist picasso = (Artist) context.newObject(Artist.class);
 picasso.setName(<span class="code-quote">"Pablo Picasso"</span>);
 picasso.setDateOfBirthString(<span class="code-quote">"18811025"</span>);</pre>
@@ -116,7 +116,7 @@
 
 <p>Note that at this point "picasso" object is only stored in memory and is not saved in teh database. Let's continue by adding a Metropolitan Museum gallery object and a few Picasso paintings:</p>
 
-<div class="code"><div class="codeHeader"><b>Main.java</b></div><div class="codeContent">
+<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">
 <pre class="code-java">Gallery metropolitan = (Gallery) context.newObject(Gallery.class);
 metropolitan.setName(<span class="code-quote">"Metropolitan Museum of Art"</span>); 
 
@@ -129,7 +129,7 @@
 
 <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"><div class="codeHeader"><b>Main.java</b></div><div class="codeContent">
+<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">
 <pre class="code-java">picasso.addToPaintings(girl);
 picasso.addToPaintings(stein);
         
@@ -139,13 +139,13 @@
 
 <p>Now lets save all five new objects:</p>
 
-<div class="code"><div class="codeHeader"><b>Main.java</b></div><div class="codeContent">
+<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">
 <pre class="code-java">context.commitChanges();</pre>
 </div></div>
 
 <p>Now you can run the application again as described <a href="../../../../Documentation/Cayenne Guide/Quick Start/Tutorial DataContext/index.html" title="Tutorial DataContext">here</a>. The new output will look like this:</p>
 
-<div class="preformatted"><div class="preformattedContent">
+<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
 <pre>INFO  QueryLogger: Created connection pool: jdbc:derby:/Users/andrus/Desktop/testdb;create=true
 	Driver class: org.apache.derby.jdbc.EmbeddedDriver
 	Min. connections in the pool: 1

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial Delete/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Quick%20Start/Tutorial%20Delete/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial Delete/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial Delete/index.html Sun Oct 25 12:06:20 2009
@@ -83,7 +83,7 @@
 </ul>
 
 
-<div class="code"><div class="codeHeader"><b>Main.java</b></div><div class="codeContent">
+<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">
 <pre class="code-java">Expression qualifier = ExpressionFactory.matchExp(Artist.NAME_PROPERTY, <span class="code-quote">"Pablo Picasso"</span>);
 SelectQuery select = <span class="code-keyword">new</span> SelectQuery(Artist.class, qualifier);
 
@@ -91,7 +91,7 @@
 </div></div>
 
 <p>Now let's delete the artist:</p>
-<div class="code"><div class="codeHeader"><b>Main.java</b></div><div class="codeContent">
+<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">
 <pre class="code-java"><span class="code-keyword">if</span> (picasso != <span class="code-keyword">null</span>) {
     context.deleteObject(picasso);
     context.commitChanges();
@@ -100,7 +100,7 @@
 
 <p>Since we set up "Cascade" delete rule for the Artist.paintings relationships, Cayenne will automatically delete all paintings of this artist. So when your run the app you'll see this output:</p>
 
-<div class="preformatted"><div class="preformattedContent">
+<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
 <pre>INFO  QueryLogger: --- will run 2 queries.
 INFO  QueryLogger: --- transaction started.
 INFO  QueryLogger: DELETE FROM PAINTING WHERE ID = ?

Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial Mapping Query/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Quick%20Start/Tutorial%20Mapping%20Query/index.html?rev=829552&r1=829551&r2=829552&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial Mapping Query/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Quick Start/Tutorial Mapping Query/index.html Sun Oct 25 12:06:20 2009
@@ -81,7 +81,7 @@
 </ul>
 
 
-<div class="preformatted"><div class="preformattedContent">
+<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
 <pre>delete from $table</pre>
 </div></div>
 
@@ -94,7 +94,7 @@
 </ul>
 
 
-<div class="code"><div class="codeHeader"><b>Main.java</b></div><div class="codeContent">
+<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">
 <pre class="code-java">QueryChain chain = <span class="code-keyword">new</span> QueryChain();
 chain.addQuery(<span class="code-keyword">new</span> NamedQuery(<span class="code-quote">"DeleteAll"</span>, Collections.singletonMap(
                 <span class="code-quote">"table"</span>,
@@ -113,7 +113,7 @@
 
 <p>Now we can re-run the application and see the following output in the beginning of the log:</p>
 
-<div class="preformatted"><div class="preformattedContent">
+<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
 <pre>INFO  QueryLogger: delete from PAINTING
 INFO  QueryLogger: === updated 2 rows.
 INFO  QueryLogger: delete from ARTIST