You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by bu...@apache.org on 2017/10/06 07:50:17 UTC

svn commit: r1019170 [40/42] - in /websites/staging/cayenne/trunk/content: ./ 2017/10/ doap/ docs/ docs/4.0/api/ docs/4.0/api/org/apache/cayenne/ docs/4.0/api/org/apache/cayenne/access/ docs/4.0/api/org/apache/cayenne/access/class-use/ docs/4.0/api/org...

Modified: websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/performance-tuning.html
==============================================================================
--- websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/performance-tuning.html (original)
+++ websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/performance-tuning.html Fri Oct  6 07:49:44 2017
@@ -9,7 +9,7 @@
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
   })();
-        </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.B1)</th><th align="center">Chapter&nbsp;11.&nbsp;Performance Tuning</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lifecycle-events.html">Prev</a>&nbsp;</td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part2.html">Part&nbsp;II.&nbsp;Cayenne Framework</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="customizing-cayenne-runtime.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="performance-tuning"></a>Chapter&nbsp;11.&nbsp;Performance Tuning</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="performance-tuning.html#prefetching"
 >Prefetching</a></span></dt><dt><span class="section"><a href="performance-tuning.html#datarows">Data Rows</a></span></dt><dt><span class="section"><a href="performance-tuning.html#specific-attributes-with-ejbql">Specific Attributes and Relationships with EJBQL</a></span></dt><dt><span class="section"><a href="performance-tuning.html#iterated-queries">Iterated Queries</a></span></dt><dt><span class="section"><a href="performance-tuning.html#paginated-queries">Paginated Queries</a></span></dt><dt><span class="section"><a href="performance-tuning.html#caching-and-fresh-data">Caching and Fresh Data</a></span></dt><dt><span class="section"><a href="performance-tuning.html#turning-off-synchronization-of-objectcontexts">Turning off Synchronization of ObjectContexts</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="prefetching"></a>Prefetching</h2></div></div></div><p>Prefetching is a technique that allows to bring back in one query 
 not only the queried
+        </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.B2)</th><th align="center">Chapter&nbsp;11.&nbsp;Performance Tuning</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="lifecycle-events.html">Prev</a>&nbsp;</td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part2.html">Part&nbsp;II.&nbsp;Cayenne Framework</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="customizing-cayenne-runtime.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="performance-tuning"></a>Chapter&nbsp;11.&nbsp;Performance Tuning</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="performance-tuning.html#prefetching"
 >Prefetching</a></span></dt><dt><span class="section"><a href="performance-tuning.html#datarows">Data Rows</a></span></dt><dt><span class="section"><a href="performance-tuning.html#specific-attributes-with-ejbql">Specific Attributes and Relationships with EJBQL</a></span></dt><dt><span class="section"><a href="performance-tuning.html#iterated-queries">Iterated Queries</a></span></dt><dt><span class="section"><a href="performance-tuning.html#paginated-queries">Paginated Queries</a></span></dt><dt><span class="section"><a href="performance-tuning.html#caching-and-fresh-data">Caching and Fresh Data</a></span></dt><dt><span class="section"><a href="performance-tuning.html#turning-off-synchronization-of-objectcontexts">Turning off Synchronization of ObjectContexts</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="prefetching"></a>Prefetching</h2></div></div></div><p>Prefetching is a technique that allows to bring back in one query 
 not only the queried
             objects, but also objects related to them. In other words it is a controlled eager
             relationship resolving mechanism. Prefetching is discussed in the "Performance Tuning"
             chapter, as it is a powerful performance optimization method. However another common

Modified: websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/persistent-objects-objectcontext.html
==============================================================================
--- websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/persistent-objects-objectcontext.html (original)
+++ websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/persistent-objects-objectcontext.html Fri Oct  6 07:49:44 2017
@@ -9,7 +9,7 @@
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
   })();
-        </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.B1)</th><th align="center">Chapter&nbsp;6.&nbsp;Persistent Objects and ObjectContext</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="starting-cayenne.html">Prev</a>&nbsp;</td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part2.html">Part&nbsp;II.&nbsp;Cayenne Framework</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="expressions.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="persistent-objects-objectcontext"></a>Chapter&nbsp;6.&nbsp;Persistent Objects and ObjectContext</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="pers
 istent-objects-objectcontext.html#objectcontext">ObjectContext</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#persistent-lifecycle">Persistent Object and its Lifecycle</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#persistent-operations">ObjectContext Persistence API</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#cayenne-helper-class">Cayenne Helper Class</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#objectcontext-nesting">ObjectContext Nesting</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#generic-persistent-objects">Generic Persistent Objects</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#transactions">Transactions</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="objectcontext"></a
 >ObjectContext</h2></div></div></div><p>ObjectContext is an interface that users normally work with to access the database. It
+        </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.B2)</th><th align="center">Chapter&nbsp;6.&nbsp;Persistent Objects and ObjectContext</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="starting-cayenne.html">Prev</a>&nbsp;</td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part2.html">Part&nbsp;II.&nbsp;Cayenne Framework</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="expressions.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="persistent-objects-objectcontext"></a>Chapter&nbsp;6.&nbsp;Persistent Objects and ObjectContext</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="pers
 istent-objects-objectcontext.html#objectcontext">ObjectContext</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#persistent-lifecycle">Persistent Object and its Lifecycle</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#persistent-operations">ObjectContext Persistence API</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#cayenne-helper-class">Cayenne Helper Class</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#objectcontext-nesting">ObjectContext Nesting</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#generic-persistent-objects">Generic Persistent Objects</a></span></dt><dt><span class="section"><a href="persistent-objects-objectcontext.html#transactions">Transactions</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="objectcontext"></a
 >ObjectContext</h2></div></div></div><p>ObjectContext is an interface that users normally work with to access the database. It
             provides the API to execute database operations and to manage persistent objects. A
             context is obtained from the
             ServerRuntime:</p><pre class="programlisting">ObjectContext context = runtime.newContext();</pre><p>The call above creates a new instance of ObjectContext that can access the database via this
@@ -39,7 +39,7 @@
             equality check of 2 objects, knowing persistence state would allow highlighting changed
             objects, etc.</p><p>Each persistent object belongs to a single ObjectContext, and can be in one of the following
             persistence states (as defined in <code class="code">org.apache.cayenne.PersistenceState</code>)
-                :</p><div class="table"><a name="d0e1617"></a><p class="title"><b>Table&nbsp;6.1.&nbsp;Persistence States</b></p><div class="table-contents"><table frame="void"><col width="16%"><col width="84%"><tbody><tr>
+                :</p><div class="table"><a name="d0e1628"></a><p class="title"><b>Table&nbsp;6.1.&nbsp;Persistence States</b></p><div class="table-contents"><table frame="void"><col width="16%"><col width="84%"><tbody><tr>
                         <td>TRANSIENT</td>
                         <td>The object is not registered with an ObjectContext and will not be
                             persisted.</td>

Modified: websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/queries.html
==============================================================================
--- websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/queries.html (original)
+++ websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/queries.html Fri Oct  6 07:49:44 2017
@@ -9,7 +9,7 @@
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
   })();
-        </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.B1)</th><th align="center">Chapter&nbsp;9.&nbsp;Queries</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="orderings.html">Prev</a>&nbsp;</td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part2.html">Part&nbsp;II.&nbsp;Cayenne Framework</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="lifecycle-events.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="queries"></a>Chapter&nbsp;9.&nbsp;Queries</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="queries.html#selectquery">ObjectSelect</a></span></dt><dt><span class="section"><a href="
 queries.html#ejbqlquery">EJBQLQuery</a></span></dt><dt><span class="section"><a href="queries.html#sqltemplate">SQLTemplate</a></span></dt><dt><span class="section"><a href="queries.html#procedurequery">ProcedureQuery</a></span></dt><dt><span class="section"><a href="queries.html#namedquery">NamedQuery</a></span></dt><dt><span class="section"><a href="queries.html#custom-queries">Custom Queries</a></span></dt></dl></div><p>Queries are Java objects used by the application to communicate with the database. Cayenne
+        </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.B2)</th><th align="center">Chapter&nbsp;9.&nbsp;Queries</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="orderings.html">Prev</a>&nbsp;</td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part2.html">Part&nbsp;II.&nbsp;Cayenne Framework</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="lifecycle-events.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="queries"></a>Chapter&nbsp;9.&nbsp;Queries</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="queries.html#selectquery">ObjectSelect</a></span></dt><dt><span class="section"><a href="
 queries.html#ejbqlquery">EJBQLQuery</a></span></dt><dt><span class="section"><a href="queries.html#selectbyid">SelectById</a></span></dt><dt><span class="section"><a href="queries.html#sqlselect">SQLSelect and SQLExec</a></span></dt><dt><span class="section"><a href="queries.html#mappedqueries">MappedSelect and MappedExec</a></span></dt><dt><span class="section"><a href="queries.html#procedurecallquery">ProcedureCall</a></span></dt><dt><span class="section"><a href="queries.html#custom-queries">Custom Queries</a></span></dt><dt><span class="section"><a href="queries.html#sqltemplate">SQLTemplate</a></span></dt></dl></div><p>Queries are Java objects used by the application to communicate with the database. Cayenne
         knows how to translate queries into SQL statements appropriate for a particular database
         engine. Most often queries are used to find objects matching certain criteria, but there are
         other types of queries too. E.g. those allowing to run native SQL, call DB stored
@@ -26,41 +26,82 @@
         are usually presented as Lists of Maps, with each map representing a row in the DB (a term
         "data row" is often used to describe such a map). They can potentially be converted to
         objects, however it may take a considerable effort to do so. Native queries are also less
-        (if at all) portable across databases than object queries. </p><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="selectquery"></a>ObjectSelect</h2></div></div></div><p>
+        (if at all) portable across databases than object queries. </p><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="selectquery"></a>ObjectSelect</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="d0e2088"></a>Selecting objects</h3></div></div></div><p>
             <span class="italic">ObjectSelect supersedes older SelectQuery. SelectQuery is still
                 available and supported. </span>
         </p><p>ObjectSelect is the most commonly used query in Cayenne applications. This may be the
             only query you will ever need. It returns a list of persistent objects (or data rows) of
             a certain type specified in the
-            query:</p><pre class="programlisting">List&lt;Artist&gt; objects = ObjectSelect.query(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>).select(context);</pre><p>This
-            returned all rows in the "ARTIST" table. If the logs were turned on, you might see the
-            following SQL
-            printed:</p><pre class="screen">INFO: SELECT t0.DATE_OF_BIRTH, t0.NAME, t0.ID FROM ARTIST t0
-INFO: === returned 5 row. - took 5 ms.</pre><p>This SQL was generated by Cayenne from the ObjectSelect above. ObjectSelect can have a
+            query:
+            </p><pre class="programlisting">List&lt;Artist&gt; objects = ObjectSelect.query(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>).select(context);</pre><p>
+            This returned all rows in the "ARTIST" table. If the logs were turned on, you might see the
+            following SQL printed:
+            </p><pre class="screen">INFO: SELECT t0.DATE_OF_BIRTH, t0.NAME, t0.ID FROM ARTIST t0
+INFO: === returned 5 row. - took 5 ms.</pre><p>
+        </p><p>This SQL was generated by Cayenne from the ObjectSelect above. ObjectSelect can have a
             qualifier to select only the data matching specific criteria. Qualifier is simply an
             Expression (Expressions where discussed in the previous chapter), appended to the query
             using "where" method. If you only want artists whose name begins with 'Pablo', you might
             use the following qualifier expression:
             </p><pre class="programlisting">List&lt;Artist&gt; objects = ObjectSelect.query(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>)
-        .where(Artist.NAME.like(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"Pablo%"</span>))
-        .select(context);</pre><p>The
-            SQL will look different this
-            time:</p><pre class="screen">INFO: SELECT t0.DATE_OF_BIRTH, t0.NAME, t0.ID FROM ARTIST t0 WHERE t0.NAME LIKE ?
+    .where(Artist.NAME.like(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"Pablo%"</span>))
+    .select(context);</pre><p>
+            The SQL will look different this time:
+            </p><pre class="screen">INFO: SELECT t0.DATE_OF_BIRTH, t0.NAME, t0.ID FROM ARTIST t0 WHERE t0.NAME LIKE ?
 [bind: 1-&gt;NAME:'Pablo%']
-INFO: === returned 1 row. - took 6 ms.</pre><p>ObjectSelect allows to assemble qualifier from parts, using "and" and "or" method to
-            chain then
-            together:</p><pre class="programlisting">List&lt;Artist&gt; objects = ObjectSelect.query(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>)
-        .where(Artist.NAME.like(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"A%"</span>))
-        .and(Artist.DATE_OF_BIRTH.gt(someDate)
-        .select(context);</pre><p>To order the results of ObjectSelect, one or more orderings can be
-            applied:</p><pre class="programlisting">List&lt;Artist&gt; objects = ObjectSelect.query(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>)
-        .addOrderBy(Artist.DATE_OF_BIRTH.desc())
-        .addOrderBy(Artist.NAME.asc())
-        .select(context);</pre><p>There's a number of other useful methods in ObjectSelect that define what to select
+INFO: === returned 1 row. - took 6 ms.</pre><p>
+        </p><p>ObjectSelect allows to assemble qualifier from parts, using "and" and "or" method to
+            chain then together:
+            </p><pre class="programlisting">List&lt;Artist&gt; objects = ObjectSelect.query(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>)
+    .where(Artist.NAME.like(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"A%"</span>))
+    .and(Artist.DATE_OF_BIRTH.gt(someDate)
+    .select(context);</pre><p>
+        </p><p>To order the results of ObjectSelect, one or more orderings can be applied:
+            </p><pre class="programlisting">List&lt;Artist&gt; objects = ObjectSelect.query(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>)
+    .orderBy(Artist.DATE_OF_BIRTH.desc())
+    .orderBy(Artist.NAME.asc())
+    .select(context);</pre><p>
+        </p><p>There's a number of other useful methods in ObjectSelect that define what to select
             and how to optimize database interaction (prefetching, caching, fetch offset and limit,
             pagination, etc.). Some of them are discussed in separate chapters on caching and
             performance optimization. Others are fairly self-explanatory. Please check the API docs
-            for the full extent of the ObjectSelect features.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="ejbqlquery"></a>EJBQLQuery</h2></div></div></div><p>EJBQLQuery was created as a part of an experiment in adopting some of Java Persistence
+            for the full extent of the ObjectSelect features.
+        </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="d0e2124"></a>Selecting individual columns</h3></div></div></div><p>
+            <code class="code">ObjectSelect</code> query can be used to fetch individual properties of objects via
+            type-safe API:
+            </p><pre class="programlisting">List&lt;String&gt; names = ObjectSelect.columnQuery(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, Artist.ARTIST_NAME)
+    .select(context);</pre><p>
+            And here is example of selecting several properties, note that result will be <code class="code">Object[]</code>:
+            </p><pre class="programlisting">List&lt;Object[]&gt; nameAndDate = ObjectSelect
+    .columnQuery(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, Artist.ARTIST_NAME, Artist.DATE_OF_BIRTH)
+    .select(context);</pre><p>
+        </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="d0e2141"></a>Selecting aggregate functions</h3></div></div></div><p>
+            ObjectSelect query supports usage of aggregate functions.
+            Most common variant of aggregation is selecting count of records, this can be done really easy:
+            </p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">long</span> count = ObjectSelect.query(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>).selectCount(context);</pre><p>
+            But you can use aggregates in more cases, even combine selecting individual properties and aggregates:
+            </p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// this is artificial property signaling that we want to get full object</span>
+Property&lt;Artist&gt; artistProperty = Property.createSelf(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>);
+
+List&lt;Object[]&gt; artistAndPaintingCount = ObjectSelect.columnQuery(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, artistProperty, Artist.PAINTING_ARRAY.count())
+    .where(Artist.ARTIST_NAME.like(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"a%"</span>))
+    .having(Artist.PAINTING_ARRAY.count().lt(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">5L</span>))
+    .orderBy(Artist.PAINTING_ARRAY.count().desc(), Artist.ARTIST_NAME.asc())
+    .select(context);
+
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">for</span>(Object[] next : artistAndPaintingCount) {
+    Artist artist = (Artist)next[<span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">0</span>];
+    <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">long</span> paintings = (Long)next[<span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">1</span>];
+    System.out.println(artist.getArtistName() + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">" have "</span> + paintings + <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">" paintings"</span>);
+}</pre><p>
+            Here is generated <code class="code">SQL</code> for this query:
+            </p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">SELECT</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">DISTINCT</span> t0.ARTIST_NAME, t0.DATE_OF_BIRTH, t0.ARTIST_ID, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">COUNT</span>(t1.PAINTING_ID)
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">FROM</span> ARTIST t0 <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">JOIN</span> PAINTING t1 <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">ON</span> (t0.ARTIST_ID = t1.ARTIST_ID)
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">WHERE</span> t0.ARTIST_NAME <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">LIKE</span> ?
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">GROUP</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">BY</span> t0.ARTIST_NAME, t0.ARTIST_ID, t0.DATE_OF_BIRTH
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">HAVING</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">COUNT</span>(t1.PAINTING_ID) &lt; ?
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">ORDER</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">BY</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">COUNT</span>(t1.PAINTING_ID) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">DESC</span>, t0.ARTIST_NAME</pre><p>
+        </p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="ejbqlquery"></a>EJBQLQuery</h2></div></div></div><p>EJBQLQuery was created as a part of an experiment in adopting some of Java Persistence
             API (JPA) approaches in Cayenne. It is a parameterized object query that is created from
             query String. A String used to build EJBQLQuery must conform to JPQL (JPA query
             language):</p><pre class="programlisting">EJBQLQuery query = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> EJBQLQuery(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"select a FROM Artist a"</span>);</pre><p>JPQL details can be found in any JPA manual. Here we'll mention only how this fits
@@ -121,13 +162,126 @@ List&lt;String&gt; names = context.perfo
                         "X &lt;&gt; NULL"), which will evaluate differently.</p></li><li class="listitem"><p>Expression Parameters: SelectQuery uses "$" to denote named parameters
                         (e.g. "$myParam"), while EJBQL uses ":" (e.g. ":myParam"). Also EJBQL
                         supports positional parameters denoted by the question mark: "?3".</p></li></ul></div><p>
-        </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="sqltemplate"></a>SQLTemplate</h2></div></div></div><p>SQLTemplate is a query that allows to run native SQL from a Cayenne application. It
+        </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="selectbyid"></a>SelectById</h2></div></div></div><p>
+        This query allows to search objects by their ID.
+        It's introduced in Cayenne 4.0 and uses new "fluent" API same as <code class="code">ObjectSelect</code> query.
+    </p><p>
+        Here is example of how to use it:
+        </p><pre class="programlisting">Artist artistWithId1 = SelectById.query(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">1</span>)
+    .prefetch(Artist.PAINTING_ARRAY.joint())
+    .localCache()
+    .selectOne(context);</pre><p>
+    </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="sqlselect"></a>SQLSelect and SQLExec</h2></div></div></div><p>
+        <code class="code">SQLSelect</code> and <code class="code">SQLExec</code> are essentially a "fluent" versions of older <code class="code">SQLTemplate</code> query.
+        <code class="code">SQLSelect</code> can be used (as name suggests) to select custom data in form of entities, separate columns or collection of <code class="code">DataRow</code>.
+        <code class="code">SQLExec</code> is designed to just execute any raw SQL code (e.g. updates, deletes, DDLs, etc.)
+        These queries support all directives described in <a class="link" href="queries.html#sqltemplate" title="SQLTemplate">SQLTemplate</a> section.
+    </p><p>
+        Here is example of how to use <code class="code">SQLSelect</code>:
+        </p><pre class="programlisting">SQLSelect&lt;Painting&gt; q1 = SQLSelect
+    .query(Painting.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"SELECT * FROM PAINTING WHERE PAINTING_TITLE LIKE #bind($title)"</span>)
+    .params(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"title"</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"painting%"</span>)
+    .upperColumnNames()
+    .localCache()
+    .limit(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">100</span>)
+    .select(context);</pre><p>
+    </p><p>
+        And here is example of how to use <code class="code">SQLExec</code>:
+        </p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">int</span> inserted = SQLExec
+    .query(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME) VALUES (#bind($id), #bind($name))"</span>)
+    .paramsArray(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">55</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"Picasso"</span>)
+    .update(context);</pre><p>
+    </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="mappedqueries"></a>MappedSelect and MappedExec</h2></div></div></div><p>
+        <code class="code">MappedSelect</code> and <code class="code">MappedExec</code> is a queries that are just a reference to another queries stored in the DataMap.
+        The actual stored query can be SelectQuery, SQLTemplate, EJBQLQuery, etc.
+        Difference between <code class="code">MappedSelect</code> and <code class="code">MappedExec</code> is (as reflected in their names)
+        whether underlying query intended to select data or just to perform some generic SQL code.
+        </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>These queries are "fluent" versions of deprecated <code class="code">NamedQuery</code> class.</p></div><p>
+    </p><p>
+        Here is example of how to use <code class="code">MappedSelect</code>:
+        </p><pre class="programlisting">List&lt;Artist&gt; results = MappedSelect.query(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"artistsByName"</span>, Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>)&#8232;
+    .param(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"name"</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"Picasso"</span>)&#8232;
+    .select(context);</pre><p>
+    </p><p>
+        And here is example of <code class="code">MappedExec</code>:
+        </p><pre class="programlisting">QueryResult result = MappedExec.query(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"updateQuery"</span>)&#8232;
+    .param(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"var"</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"value"</span>)&#8232;
+    .execute(context);
+System.out.println(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"Rows updated: "</span> + result.firstUpdateCount());</pre><p>
+    </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="procedurecallquery"></a>ProcedureCall</h2></div></div></div><p>Stored procedures are mapped as separate objects in CayenneModeler. <code class="code">ProcedureCall</code>
+        provides a way to execute them with a certain set of parameters. This query is a "fluent" version of
+        older <code class="code">ProcedureQuery</code>.
+        Just like with <code class="code">SQLTemplate</code>, the outcome of a procedure can be anything - a single result set, multiple
+        result sets, some data modification (returned as an update count), or a combination of these.
+        So use root class to get a single result set, and use only procedure name
+        for anything else:
+        </p><pre class="programlisting">List&lt;Artist&gt; result = ProcedureCall.query(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"my_procedure"</span>, Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>)
+    .param(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"p1"</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"abc"</span>)
+    .param(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"p2"</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">3000</span>)
+    .call(context)
+    .firstList();</pre><p>
+
+        </p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// here we do not bother with root class.</span>
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// Procedure name gives us needed routing information</span>
+ProcedureResult result = ProcedureCall.query(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"my_procedure"</span>)
+    .param(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"p1"</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"abc"</span>)
+    .param(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"p2"</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">3000</span>)
+    .call();</pre><p>
+    </p><p>A stored procedure can return data back to the application as result sets or via OUT
+        parameters. To simplify the processing of the query output, QueryResponse treats OUT
+        parameters as if it was a separate result set. For stored procedures declaref any OUT or
+        INOUT parameters, <code class="code">ProcedureResult</code> have convenient utility method to get them:
+        </p><pre class="programlisting">ProcedureResult result = ProcedureCall.query(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"my_procedure"</span>)
+    .call(context);
+
+<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// read OUT parameters</span>
+Object out = result.getOutParam(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"out_param"</span>);
+</pre><p>
+    </p><p>
+        There maybe a situation when a stored procedure handles its own transactions, but an
+        application is configured to use Cayenne-managed transactions. This is obviously
+        conflicting and undesirable behavior. In this case ProcedureQueries should be executed
+        explicitly wrapped in an "external" Transaction. This is one of the few cases when a
+        user should worry about transactions at all. See Transactions section for more
+        details.
+    </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="custom-queries"></a>Custom Queries</h2></div></div></div><p>If a user needs some extra functionality not addressed by the existing set of Cayenne
+            queries, he can write his own. The only requirement is to implement
+                <code class="code">org.apache.cayenne.query.Query</code> interface. The easiest way to go about
+            it is to subclass some of the base queries in Cayenne. </p><p>E.g. to do something directly in the JDBC layer, you might subclass
+            AbstractQuery:</p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span> MyQuery <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">extends</span> AbstractQuery {
+
+    <span xmlns="http://www.w3.org/1999/xhtml" class="hl-annotation">@Override</span>
+    <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> SQLAction createSQLAction(SQLActionVisitor visitor) {
+        <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">return</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> SQLAction() {
+
+            <span xmlns="http://www.w3.org/1999/xhtml" class="hl-annotation">@Override</span>
+            <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">void</span> performAction(Connection connection, OperationObserver observer) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">throws</span> SQLException, Exception {
+                <span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// 1. do some JDBC work using provided connection...</span>
+                <span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// 2. push results back to Cayenne via OperationObserver</span>
+            }
+        };
+    }
+}</pre><p>To delegate the actual query execution to a standard Cayenne query, you may subclass
+            IndirectQuery:</p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span> MyDelegatingQuery <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">extends</span> IndirectQuery {
+
+    <span xmlns="http://www.w3.org/1999/xhtml" class="hl-annotation">@Override</span>
+    <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">protected</span> Query createReplacementQuery(EntityResolver resolver) {
+        SQLTemplate delegate = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> SQLTemplate(SomeClass.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, generateRawSQL());
+        delegate.setFetchingDataRows(true);
+        <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">return</span> delegate;
+    }
+
+    <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">protected</span> String generateRawSQL() {
+        <span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// build some SQL string</span>
+    }
+}</pre><p>In fact many internal Cayenne queries are IndirectQueries, delegating to SelectQuery
+            or SQLTemplate after some preprocessing.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="sqltemplate"></a>SQLTemplate</h2></div></div></div><p>SQLTemplate is a query that allows to run native SQL from a Cayenne application. It
             comes handy when the standard ORM concepts are not sufficient for a given query or an
             update. SQL is too powerful and allows to manipulate data in ways that are not easily
             described as a graph of related entities. Cayenne acknowledges this fact and provides
             this facility to execute SQL, mapping the result to objects when possible. Here are
             examples of selecting and non-selecting
-            SQLTemplates:</p><pre class="programlisting">SQLTemplate select = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> SQLTemplate(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"select * from ARTIST"</span>); 
+            SQLTemplates:</p><pre class="programlisting">SQLTemplate select = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> SQLTemplate(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"select * from ARTIST"</span>);
 List&lt;Artist&gt; result = context.performQuery(select);</pre><pre class="programlisting">SQLTemplate update = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> SQLTemplate(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"delete from ARTIST"</span>);
 QueryResponse response = context.performGenericQuery(update);</pre><p>Cayenne doesn't make any attempt to make sense of the SQL semantics, so it doesn't
             know whether a given query is performing a select or update, etc. It is the the user's
@@ -149,7 +303,7 @@ QueryResponse response = context.perform
             default generic statement is used. E.g. in all the examples above a default statement
             will be used regardless of the runtime database. So in most cases you won't need to
             explicitly "translate" your SQL to all possible dialects. Here is how this works in
-            practice:</p><pre class="programlisting">SQLTemplate select = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> SQLTemplate(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"select * from ARTIST"</span>); 
+            practice:</p><pre class="programlisting">SQLTemplate select = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> SQLTemplate(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"select * from ARTIST"</span>);
 
 <span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// For Postgres it would be nice to trim padding of all CHAR columns.</span>
 <span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// Otherwise those will be returned with whitespace on the right.</span>
@@ -178,7 +332,7 @@ query.setParameters(Collections.singleto
                 E.g. passing a date object in a WHERE clause expression may be converted to a String
                 not understood by the target RDBMS SQL parser. In such cases variable should be wrapped in <code class="code">#bind</code>
                 directive as described below.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="sqltemplate-bind-directive"></a>Directives</h3></div></div></div><p>These are the Cayenne directives used to customize SQLTemplate parsing and
-                integrate it with the JDBC layer: </p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2222"></a>#bind</h4></div></div></div><p>Creates a PreparedStatement positional parameter in place of the directive,
+                integrate it with the JDBC layer: </p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2425"></a>#bind</h4></div></div></div><p>Creates a PreparedStatement positional parameter in place of the directive,
                     binding the value to it before statement execution. <code class="code">#bind</code> is
                     allowed in places where a "?" would be allowed in a PreparedStatement. And in
                     such places it almost always makes sense to pass objects to the template via
@@ -197,7 +351,7 @@ query.setParameters(Collections.singleto
 #bind(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'str'</span>)
 #bind($xyz <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'VARCHAR'</span>)
 #bind($xyz <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'DECIMAL'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">2</span>)</pre><p><span class="italic">Full
-                    example:</span></p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">update</span> ARTIST <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">set</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">NAME</span> = #bind($name) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">where</span> ID = #bind($id)</pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2273"></a>#bindEqual</h4></div></div></div><p>Same as #bind, but also includes the "=" sign in front of the value binding.
+                    example:</span></p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">update</span> ARTIST <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">set</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">NAME</span> = #bind($name) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">where</span> ID = #bind($id)</pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2476"></a>#bindEqual</h4></div></div></div><p>Same as #bind, but also includes the "=" sign in front of the value binding.
                     Look at the example below - we took the #bind example and replaced "<code class="code">ID =
                         #bind(..)</code>" with "<code class="code">ID #bindEqual(..)</code>". While it looks like
                     a clumsy shortcut to eliminate the equal sign, the actual reason why this is
@@ -212,7 +366,7 @@ query.setParameters(Collections.singleto
 #bindEqual(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'str'</span>)
 #bindEqual($xyz <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'VARCHAR'</span>)
 #bindEqual($xyz <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'DECIMAL'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">2</span>)</pre><p><span class="italic">Full
-                    example:</span></p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">update</span> ARTIST <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">set</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">NAME</span> = #bind($name) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">where</span> ID #bindEqual($id)</pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2311"></a>#bindNotEqual</h4></div></div></div><p>This directive deals with the same issue as <code class="code">#bindEqual</code> above,
+                    example:</span></p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">update</span> ARTIST <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">set</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">NAME</span> = #bind($name) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">where</span> ID #bindEqual($id)</pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2514"></a>#bindNotEqual</h4></div></div></div><p>This directive deals with the same issue as <code class="code">#bindEqual</code> above,
                     only it generates "not equal" in front of the value (or IS NOT NULL).</p><p><span class="italic">Semantics:</span></p><pre class="programlisting">#bindNotEqual(value)
 #bindNotEqual(value jdbcType)
 #bindNotEqual(value jdbcType scale)</pre><p><span class="italic">Arguments: (same as #bind)</span></p><p>
@@ -220,7 +374,7 @@ query.setParameters(Collections.singleto
 #bindNotEqual(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'str'</span>)
 #bindNotEqual($xyz <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'VARCHAR'</span>)
 #bindNotEqual($xyz <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'DECIMAL'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">2</span>)</pre><p><span class="italic">Full
-                    example:</span></p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">update</span> ARTIST <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">set</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">NAME</span> = #bind($name) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">where</span> ID #bindEqual($id)</pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2339"></a>#bindObjectEqual</h4></div></div></div><p>It can be tricky to use a Persistent object or an ObjectId in a binding,
+                    example:</span></p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">update</span> ARTIST <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">set</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">NAME</span> = #bind($name) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">where</span> ID #bindEqual($id)</pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2542"></a>#bindObjectEqual</h4></div></div></div><p>It can be tricky to use a Persistent object or an ObjectId in a binding,
                     especially for tables with compound primary keys. This directive helps to handle
                     such binding. It maps columns in the query to the names of Persistent object ID
                     columns, extracts ID values from the object, and generates SQL like "COL1 = ?
@@ -237,7 +391,7 @@ query.setParameters(Collections.singleto
 SQLTemplate select = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> SQLTemplate(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, sql);
 
 Artist a = ....
-select.setParameters(Collections.singletonMap(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"a"</span>, a)); </pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2381"></a>#bindObjectNotEqual</h4></div></div></div><p>Same as #bindObjectEqual above, only generates "not equal" operator for value
+select.setParameters(Collections.singletonMap(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"a"</span>, a)); </pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2584"></a>#bindObjectNotEqual</h4></div></div></div><p>Same as #bindObjectEqual above, only generates "not equal" operator for value
                     comparison (or IS NOT NULL).</p><p><span class="italic">Semantics:</span></p><pre class="programlisting">#bindObjectNotEqual(value columns idColumns)</pre><p><span class="italic">Arguments: (same as #bindObjectEqual)</span>
                 </p><p>
                     <span class="italic">Usage</span>:</p><pre class="programlisting">#bindObjectNotEqual($a <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'t0.ID'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'ID'</span>)
@@ -246,7 +400,7 @@ select.setParameters(Collections.singlet
 SQLTemplate select = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> SQLTemplate(Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, sql);
 
 Artist a = ....
-select.setParameters(Collections.singletonMap(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"a"</span>, a)); </pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2407"></a>#result</h4></div></div></div><p>Renders a column in SELECT clause of a query and maps it to a key in the
+select.setParameters(Collections.singletonMap(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"a"</span>, a)); </pre></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="d0e2610"></a>#result</h4></div></div></div><p>Renders a column in SELECT clause of a query and maps it to a key in the
                     result DataRow. Also ensures the value read is of the correct type. This allows
                     to create a DataRow (and ultimately - a persistent object) from an arbitrary
                     ResultSet.</p><p><span class="italic">Semantics:</span></p><pre class="programlisting">#result(column)
@@ -269,13 +423,13 @@ select.setParameters(Collections.singlet
                                 database path expressions for joint column keys, and their format is
                                 incompatible with most databases alias format. </p></li></ul></div><p>
                     <span class="italic">Usage</span>:</p><pre class="programlisting">#result(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'NAME'</span>)
-#result(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'DATE_OF_BIRTH'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'java.util.Date'</span>) 
+#result(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'DATE_OF_BIRTH'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'java.util.Date'</span>)
 #result(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'DOB'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'java.util.Date'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'DATE_OF_BIRTH'</span>)
-#result(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'DOB'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'java.util.Date'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">''</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'artist.DATE_OF_BIRTH'</span>) 
+#result(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'DOB'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'java.util.Date'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">''</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'artist.DATE_OF_BIRTH'</span>)
 #result(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'SALARY'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'float'</span>) </pre><p><span class="italic">Full
-                    example:</span></p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">SELECT</span> #<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">result</span>(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'ID'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'int'</span>), #<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">result</span>(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'NAME'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'String'</span>), #<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">result</span>(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'DATE_OF_BIRTH'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'java.util.Date'</span>) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">FROM</span> ARTIST</pre></div><div class="section"><div class="titlepage"><div><div><h4 
 class="title"><a name="d0e2463"></a>#chain and #chunk</h4></div></div></div><p><code class="code">#chain</code> and <code class="code">#chunk</code> directives are used for
+                    example:</span></p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">SELECT</span> #<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">result</span>(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'ID'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'int'</span>), #<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">result</span>(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'NAME'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'String'</span>), #<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">result</span>(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'DATE_OF_BIRTH'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'java.util.Date'</span>) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">FROM</span> ARTIST</pre></div><div class="section"><div class="titlepage"><div><div><h4 
 class="title"><a name="d0e2666"></a>#chain and #chunk</h4></div></div></div><p><code class="code">#chain</code> and <code class="code">#chunk</code> directives are used for
                     conditional inclusion of SQL code. They are used together with
-                        <code class="code">#chain</code> wrapping multiple <code class="code">#chunks</code>. A chunk
+                    <code class="code">#chain</code> wrapping multiple <code class="code">#chunks</code>. A chunk
                     evaluates its parameter expression and if it is NULL suppresses rendering of the
                     enclosed SQL block. A chain renders its prefix and its chunks joined by the
                     operator. If all the chunks are suppressed, the chain itself is suppressed. This
@@ -285,13 +439,13 @@ select.setParameters(Collections.singlet
                     to Expression pruning discussed above). If all conditions are excluded, the
                     entire WHERE clause should be excluded. chain/chunk allows to do that.</p><p>
                     <span class="italic">Semantics</span>:</p><pre class="programlisting">#chain(operator) ... #end
-#chain(operator prefix) ... #end
-#chunk() ... #end
-#chunk(param) ... #end </pre><p><span class="italic">Full
-                    example:</span></p><pre class="programlisting">#chain(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'OR'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'WHERE'</span>) 
-	#chunk($name) NAME LIKE #bind($name) #end
-	#chunk($id) ARTIST_ID &gt; #bind($id) #end
-#end<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">" </span></pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="d0e2491"></a>Mapping SQLTemplate Results</h3></div></div></div><p>Here we'll discuss how to convert the data selected via SQLTemplate to some
+                    #chain(operator prefix) ... #end
+                    #chunk() ... #end
+                    #chunk(param) ... #end </pre><p><span class="italic">Full
+                    example:</span></p><pre class="programlisting">#chain(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'OR'</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">'WHERE'</span>)
+                    #chunk($name) NAME LIKE #bind($name) #end
+                    #chunk($id) ARTIST_ID &gt; #bind($id) #end
+                    #end<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">" </span></pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="d0e2694"></a>Mapping SQLTemplate Results</h3></div></div></div><p>Here we'll discuss how to convert the data selected via SQLTemplate to some
                 useable format, compatible with other query results. It can either be very simple or
                 very complex, depending on the structure of the SQL, JDBC driver nature and the
                 desired result structure. This section presents various tips and tricks dealing with
@@ -387,80 +541,4 @@ List objects = context.performQuery(quer
 query.setColumnNamesCapitalization(CapsStrategy.UPPER);
 List objects = context.performQuery(query); </pre><p>None of this affects the generated SQL, but the resulting DataRows are using
                 correct capitalization. Note that you probably shouldn't bother with this unless you
-                are getting CayenneRuntimeExceptions when fetching with SQLTemplate.</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="procedurequery"></a>ProcedureQuery</h2></div></div></div><p>Stored procedures are mapped as separate objects in CayenneModeler. ProcedureQuery
-            provides a way to execute them with a certain set of parameters. Just like with
-            SQLTemplate, the outcome of a procedure can be anything - a single result set, mutliple
-            result sets, some data modification (returned as an update count), or a combination of
-            these. So use "performQuery" to get a single result set, and use "performGenericQuery"
-            for anything
-            else:</p><pre class="programlisting">ProcedureQuery query = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> ProcedureQuery(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"my_procedure"</span>, Artist.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>);
-
-<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// Set "IN" parameter values</span>
-query.addParam(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"p1"</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"abc"</span>);
-query.addParam(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"p2"</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">3000</span>);
-
-List&lt;Artist&gt; result = context.performQuery(query);</pre><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// here we do not bother with root class. </span>
-<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// Procedure name gives us needed routing information</span>
-ProcedureQuery query = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> ProcedureQuery(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"my_procedure"</span>);
-
-query.addParam(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"p1"</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"abc"</span>);
-query.addParam(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"p2"</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">3000</span>);
-
-QueryResponse response = context.performGenericQuery(query); </pre><p>A stored procedure can return data back to the application as result sets or via OUT
-            parameters. To simplify the processing of the query output, QueryResponse treats OUT
-            parameters as if it was a separate result set. If a stored procedure declares any OUT or
-            INOUT parameters, QueryResponse will contain their returned values in the very first
-            result
-            list:</p><pre class="programlisting">ProcedureQuery query = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> ProcedureQuery(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"my_procedure"</span>);
-QueryResponse response = context.performGenericQuery(query);
-
-<span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// read OUT parameters</span>
-List out = response.firstList();
-
-<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">if</span>(!out.isEmpty()) {
-    Map outParameterValues = (Map) outList.get(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-number">0</span>);
-}</pre><p>There maybe a situation when a stored procedure handles its own transactions, but an
-            application is configured to use Cayenne-managed transactions. This is obviously
-            conflicting and undesirable behavior. In this case ProcedureQueries should be executed
-            explicitly wrapped in an "external" Transaction. This is one of the few cases when a
-            user should worry about transactions at all. See Transactions section for more
-            details.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="namedquery"></a>NamedQuery</h2></div></div></div><p>NamedQuery is a query that is a reference to another query stored in the DataMap. The
-            actual stored query can be SelectQuery, SQLTemplate, EJBQLQuery, etc. It doesn't matter
-            - the API for calling them is the same - via a
-            NamedQuery:</p><pre class="programlisting">String[] keys = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> String[] {<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"loginid"</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"password"</span>};
-Object[] values = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> String[] {<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"joe"</span>, <span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"secret"</span>};
-
-NamedQuery query = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> NamedQuery(<span xmlns="http://www.w3.org/1999/xhtml" class="hl-string">"Login"</span>, keys, values);
-
-List&lt;User&gt; matchingUsers = context.performQuery(query); </pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="custom-queries"></a>Custom Queries</h2></div></div></div><p>If a user needs some extra functionality not addressed by the existing set of Cayenne
-            queries, he can write his own. The only requirement is to implement
-                <code class="code">org.apache.cayenne.query.Query</code> interface. The easiest way to go about
-            it is to subclass some of the base queries in Cayenne. </p><p>E.g. to do something directly in the JDBC layer, you might subclass
-            AbstractQuery:</p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span> MyQuery <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">extends</span> AbstractQuery {
-
-    <span xmlns="http://www.w3.org/1999/xhtml" class="hl-annotation">@Override</span>
-    <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> SQLAction createSQLAction(SQLActionVisitor visitor) {
-        <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">return</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> SQLAction() {
-
-            <span xmlns="http://www.w3.org/1999/xhtml" class="hl-annotation">@Override</span>
-            <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">void</span> performAction(Connection connection, OperationObserver observer) <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">throws</span> SQLException, Exception {
-                <span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// 1. do some JDBC work using provided connection... </span>
-                <span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// 2. push results back to Cayenne via OperationObserver</span>
-            }
-        };
-    }
-}</pre><p>To delegate the actual query execution to a standard Cayenne query, you may subclass
-            IndirectQuery:</p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">public</span> <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span> MyDelegatingQuery <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">extends</span> IndirectQuery {
-    
-    <span xmlns="http://www.w3.org/1999/xhtml" class="hl-annotation">@Override</span>
-    <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">protected</span> Query createReplacementQuery(EntityResolver resolver) {
-        SQLTemplate delegate = <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">new</span> SQLTemplate(SomeClass.<span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">class</span>, generateRawSQL());
-        delegate.setFetchingDataRows(true);
-        <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">return</span> delegate;
-    }
-    
-    <span xmlns="http://www.w3.org/1999/xhtml" class="hl-keyword">protected</span> String generateRawSQL() {
-        <span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">// build some SQL string</span>
-    }
-}</pre><p>In fact many internal Cayenne queries are IndirectQueries, delegating to SelectQuery
-            or SQLTemplate after some preprocessing.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="orderings.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="cayenne-guide-part2.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="lifecycle-events.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;8.&nbsp;Orderings&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;10.&nbsp;Lifecycle Events</td></tr></table></div></body></html>
\ No newline at end of file
+                are getting CayenneRuntimeExceptions when fetching with SQLTemplate.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="orderings.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="cayenne-guide-part2.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="lifecycle-events.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;8.&nbsp;Orderings&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;10.&nbsp;Lifecycle Events</td></tr></table></div></body></html>
\ No newline at end of file

Modified: websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/re-filtering.html
==============================================================================
--- websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/re-filtering.html (original)
+++ websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/re-filtering.html Fri Oct  6 07:49:44 2017
@@ -9,7 +9,7 @@
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
   })();
-        </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.B1)</th><th align="center">Chapter&nbsp;20.&nbsp;Filtering</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re-introduction.html">Prev</a>&nbsp;</td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part4.html">Part&nbsp;IV.&nbsp;DB-First Flow</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="re-relationships-loading-control.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="re-filtering"></a>Chapter&nbsp;20.&nbsp;Filtering</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="re-filtering.html#everything-schema-catalog">Process everyth
 ing from schema/catalog</a></span></dt><dt><span class="section"><a href="re-filtering.html#combine-schema-catalog">Combine Schema and Catalog filters</a></span></dt><dt><span class="section"><a href="re-filtering.html#including-excluding-tables-columns-procedures">Including and Excluding tables, columns and procedures</a></span></dt><dt><span class="section"><a href="re-filtering.html#complete-filtering-example">Complete filtering example</a></span></dt><dt><span class="section"><a href="re-filtering.html#d0e3620">Ant configuration example</a></span></dt></dl></div><p>
+        </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.B2)</th><th align="center">Chapter&nbsp;20.&nbsp;Filtering</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re-introduction.html">Prev</a>&nbsp;</td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part4.html">Part&nbsp;IV.&nbsp;DB-First Flow</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="re-relationships-loading-control.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="re-filtering"></a>Chapter&nbsp;20.&nbsp;Filtering</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="re-filtering.html#everything-schema-catalog">Process everyth
 ing from schema/catalog</a></span></dt><dt><span class="section"><a href="re-filtering.html#combine-schema-catalog">Combine Schema and Catalog filters</a></span></dt><dt><span class="section"><a href="re-filtering.html#including-excluding-tables-columns-procedures">Including and Excluding tables, columns and procedures</a></span></dt><dt><span class="section"><a href="re-filtering.html#complete-filtering-example">Complete filtering example</a></span></dt><dt><span class="section"><a href="re-filtering.html#d0e3843">Ant configuration example</a></span></dt></dl></div><p>
         The first thing you usually want to control during reverse engineering is what exactly should be loaded from database and
         what not. One of the most common cases is excluding system tables, as you usually don't want to map them.
     </p><p>
@@ -220,7 +220,7 @@
             and xml attributes. </p><p>
             The cdbimport will execute reverse engineering task for all entities from &#8220;shop-01&#8221; and &#8220;shop-02&#8221;, including tables, views, stored procedures
             and table columns. As &#8220;shop-03&#8221; has variety filter tags, entities from this catalog will be filtered by cdbimport.
-        </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="d0e3620"></a>Ant configuration example</h2></div></div></div><p> Here is config sample for <code class="code">Ant</code> task:
+        </p></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="d0e3843"></a>Ant configuration example</h2></div></div></div><p> Here is config sample for <code class="code">Ant</code> task:
             </p><pre class="programlisting"><span xmlns="http://www.w3.org/1999/xhtml" class="hl-comment">&lt;!-- inside &lt;cdbimport&gt; tag --&gt;</span>
 <span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;catalog&gt;</span>shop-01<span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;/catalog&gt;</span>
 

Modified: websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/re-introduction.html
==============================================================================
--- websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/re-introduction.html (original)
+++ websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/re-introduction.html Fri Oct  6 07:49:44 2017
@@ -9,7 +9,7 @@
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
   })();
-        </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.B1)</th><th align="center">Chapter&nbsp;19.&nbsp;Introduction</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="cayenne-guide-part4.html">Prev</a>&nbsp;</td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part4.html">Part&nbsp;IV.&nbsp;DB-First Flow</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="re-filtering.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="re-introduction"></a>Chapter&nbsp;19.&nbsp;Introduction</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="re-introduction.html#what-is-cdbimport">"DB-first" Flow</a></span><
 /dt><dt><span class="section"><a href="re-introduction.html#re-configuration-file">Introduction to "cdbimport"</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="what-is-cdbimport"></a>"DB-first" Flow</h2></div></div></div><p>An ORM system consists of three parts: database, OR mapping and persistent Java classes.
+        </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.B2)</th><th align="center">Chapter&nbsp;19.&nbsp;Introduction</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="cayenne-guide-part4.html">Prev</a>&nbsp;</td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part4.html">Part&nbsp;IV.&nbsp;DB-First Flow</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="re-filtering.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="re-introduction"></a>Chapter&nbsp;19.&nbsp;Introduction</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="re-introduction.html#what-is-cdbimport">"DB-first" Flow</a></span><
 /dt><dt><span class="section"><a href="re-introduction.html#re-configuration-file">Introduction to "cdbimport"</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="what-is-cdbimport"></a>"DB-first" Flow</h2></div></div></div><p>An ORM system consists of three parts: database, OR mapping and persistent Java classes.
 			These parts always need to be kept in sync with each other for the application to work.
 			"DB-first" flow is a common and practical approach to synchronization that assumes the
 			database to be the master source of the metadata, with other two parts synchronized from
@@ -30,7 +30,7 @@
 	<span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;plugin&gt;</span>
 		<span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;groupId&gt;</span>org.apache.cayenne.plugins<span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;/groupId&gt;</span>
 		<span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;artifactId&gt;</span>cayenne-maven-plugin<span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;/artifactId&gt;</span>
-		<span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;version&gt;</span>4.0.B1<span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;/version&gt;</span>
+		<span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;version&gt;</span>4.0.B2<span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;/version&gt;</span>
 
 		<span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;configuration&gt;</span>
 			<span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;map&gt;</span>${project.basedir}/src/main/resources/datamap.map.xml<span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;/map&gt;</span>

Modified: websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/re-modeler.html
==============================================================================
--- websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/re-modeler.html (original)
+++ websites/staging/cayenne/trunk/content/docs/4.0/cayenne-guide/re-modeler.html Fri Oct  6 07:49:44 2017
@@ -1,6 +1,6 @@
 <html><head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-   <title xmlns:d="http://docbook.org/ns/docbook">Chapter&nbsp;22.&nbsp;Reverse Engineering in Cayenne Modeler</title><link rel="stylesheet" type="text/css" href="css/cayenne-doc.css"><meta xmlns:d="http://docbook.org/ns/docbook" name="keywords" content="Cayenne 4.0 documentation"><meta xmlns:d="http://docbook.org/ns/docbook" name="description" content="User documentation for Apache Cayenne version 4.0"><link rel="home" href="index.html" title="Cayenne Guide"><link rel="up" href="cayenne-guide-part4.html" title="Part&nbsp;IV.&nbsp;DB-First Flow"><link rel="prev" href="re-relationships-loading-control.html" title="Chapter&nbsp;21.&nbsp;Other Settings"><link rel="next" href="configuration-properties.html" title="Appendix&nbsp;A.&nbsp;Configuration Properties"><script xmlns:d="http://docbook.org/ns/docbook" type="text/javascript">
+   <title xmlns:d="http://docbook.org/ns/docbook">Chapter&nbsp;22.&nbsp;Reverse Engineering in Cayenne Modeler</title><link rel="stylesheet" type="text/css" href="css/cayenne-doc.css"><meta xmlns:d="http://docbook.org/ns/docbook" name="keywords" content="Cayenne 4.0 documentation"><meta xmlns:d="http://docbook.org/ns/docbook" name="description" content="User documentation for Apache Cayenne version 4.0"><link rel="home" href="index.html" title="Cayenne Guide"><link rel="up" href="cayenne-guide-part4.html" title="Part&nbsp;IV.&nbsp;DB-First Flow"><link rel="prev" href="re-relationships-loading-control.html" title="Chapter&nbsp;21.&nbsp;Other Settings"><link rel="next" href="cayenne-guide-part5.html" title="Part&nbsp;V.&nbsp;Cayenne Additional Modules"><script xmlns:d="http://docbook.org/ns/docbook" type="text/javascript">
   var _gaq = _gaq || [];
   _gaq.push(['_setAccount', 'UA-7036673-1']);
   _gaq.push(['_trackPageview']);
@@ -9,7 +9,7 @@
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
   })();
-        </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.B1)</th><th align="center">Chapter&nbsp;22.&nbsp;Reverse Engineering in Cayenne Modeler</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re-relationships-loading-control.html">Prev</a>&nbsp;</td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part4.html">Part&nbsp;IV.&nbsp;DB-First Flow</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="configuration-properties.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="re-modeler"></a>Chapter&nbsp;22.&nbsp;Reverse Engineering in Cayenne Modeler</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a h
 ref="re-modeler.html#modeler-re-datasource">DataSource selection</a></span></dt><dt><span class="section"><a href="re-modeler.html#modeler-re-options">Reverse engineering options</a></span></dt></dl></div><p>Alternative aproach to using <a class="link" href="re-introduction.html#what-is-cdbimport" title="&#34;DB-first&#34; Flow">cdbimport </a> is doing
+        </script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:d="http://docbook.org/ns/docbook" class="navheader"><table width="100%" summary="Navigation header"><tr><th class="versioninfo">v.4.0 (4.0.B2)</th><th align="center">Chapter&nbsp;22.&nbsp;Reverse Engineering in Cayenne Modeler</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re-relationships-loading-control.html">Prev</a>&nbsp;</td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part4.html">Part&nbsp;IV.&nbsp;DB-First Flow</a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="cayenne-guide-part5.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="re-modeler"></a>Chapter&nbsp;22.&nbsp;Reverse Engineering in Cayenne Modeler</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="
 re-modeler.html#modeler-re-datasource">DataSource selection</a></span></dt><dt><span class="section"><a href="re-modeler.html#modeler-re-options">Reverse engineering options</a></span></dt></dl></div><p>Alternative aproach to using <a class="link" href="re-introduction.html#what-is-cdbimport" title="&#34;DB-first&#34; Flow">cdbimport </a> is doing
         reverse engineering from <a class="link" href="setup.html#running-cayennemodeler" title="Running CayenneModeler">Cayenne Modeler</a>.
         Currently modeler GUI doesn't support all features of ant/maven tasks but it suffice for
         general DB import. Especially it's a good place to quickly start working on your data model. </p><p>
@@ -44,4 +44,4 @@
                         Use <code class="code">java.util.Date</code> for all columns with <code class="code">DATE/TIME/TIMESTAMP</code> types.
                         By default <code class="code">java.time.*</code> types will be used.
                     </p></li></ul></div><p>
-        </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re-relationships-loading-control.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="cayenne-guide-part4.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="configuration-properties.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;21.&nbsp;Other Settings&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Appendix&nbsp;A.&nbsp;Configuration Properties</td></tr></table></div></body></html>
\ No newline at end of file
+        </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re-relationships-loading-control.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="cayenne-guide-part4.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="cayenne-guide-part5.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;21.&nbsp;Other Settings&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;Part&nbsp;V.&nbsp;Cayenne Additional Modules</td></tr></table></div></body></html>
\ No newline at end of file