cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject svn commit: r1811298 [44/46] - in /cayenne/site/cms/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/apache/...
Date Fri, 06 Oct 2017 07:40:57 GMT
Modified: cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/queries.html
URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/queries.html?rev=1811298&r1=1811297&r2=1811298&view=diff
==============================================================================
--- cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/queries.html (original)
+++ cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/queries.html Fri Oct  6 07:40:21 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: cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-filtering.html
URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-filtering.html?rev=1811298&r1=1811297&r2=1811298&view=diff
==============================================================================
--- cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-filtering.html (original)
+++ cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-filtering.html Fri Oct  6 07:40:21 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: cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-introduction.html
URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-introduction.html?rev=1811298&r1=1811297&r2=1811298&view=diff
==============================================================================
--- cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-introduction.html (original)
+++ cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-introduction.html Fri Oct  6 07:40:21 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: cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-modeler.html
URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-modeler.html?rev=1811298&r1=1811297&r2=1811298&view=diff
==============================================================================
--- cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-modeler.html (original)
+++ cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-modeler.html Fri Oct  6 07:40:21 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

Modified: cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-relationships-loading-control.html
URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-relationships-loading-control.html?rev=1811298&r1=1811297&r2=1811298&view=diff
==============================================================================
--- cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-relationships-loading-control.html (original)
+++ cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/re-relationships-loading-control.html Fri Oct  6 07:40:21 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;21.&nbsp;Other Settings</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re-filtering.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-modeler.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="re-relationships-loading-control"></a>Chapter&nbsp;21.&nbsp;Other Settings</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="re-relationships-loading-control.html#skip-relationship
 s-loading">Skip Relationships Loading</a></span></dt><dt><span class="section"><a href="re-relationships-loading-control.html#skip-pk-loading">Skip Primary Keys Loading</a></span></dt><dt><span class="section"><a href="re-relationships-loading-control.html#d0e3666">Table Types</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;21.&nbsp;Other Settings</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re-filtering.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-modeler.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="re-relationships-loading-control"></a>Chapter&nbsp;21.&nbsp;Other Settings</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="re-relationships-loading-control.html#skip-relationship
 s-loading">Skip Relationships Loading</a></span></dt><dt><span class="section"><a href="re-relationships-loading-control.html#skip-pk-loading">Skip Primary Keys Loading</a></span></dt><dt><span class="section"><a href="re-relationships-loading-control.html#d0e3889">Table Types</a></span></dt></dl></div><p>
         In databases relations are defined via foreign keys and there are a lot of different politics according to the level of relationships and 
         ways how those relationships could be modeled in database. Anyway, cdbimport is able to recognize basic patterns of relationships, such as
         OneToMany, OneToOne and ManyToMany. 
@@ -24,7 +24,7 @@
         </p><pre class="programlisting">
     <span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;dbimport&gt;</span>
         <span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;skipPrimaryKeyLoading&gt;</span>true<span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;/skipPrimaryKeyLoading&gt;</span>
-    <span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;/dbimport&gt;</span></pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="d0e3666"></a>Table Types</h2></div></div></div><p>By default, cdbimport imports tables and views. Some databases may support other
+    <span xmlns="http://www.w3.org/1999/xhtml" class="hl-tag">&lt;/dbimport&gt;</span></pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="d0e3889"></a>Table Types</h2></div></div></div><p>By default, cdbimport imports tables and views. Some databases may support other
             table-like objects, e.g. <code class="code">SYSTEM TABLE, GLOBAL TEMPORARY, LOCAL TEMPORARY, ALIAS,
                 SYNONYM</code>, etc. To control which types should be included <code class="code">&lt;tableType&gt;&lt;/tableType&gt;</code> element is used. Some examples:</p><p> Import tables only (skip views and others and other
             types):</p><pre class="programlisting">

Modified: cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/rop-deployment.html
URL: http://svn.apache.org/viewvc/cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/rop-deployment.html?rev=1811298&r1=1811297&r2=1811298&view=diff
==============================================================================
--- cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/rop-deployment.html (original)
+++ cayenne/site/cms/trunk/content/docs/4.0/cayenne-guide/rop-deployment.html Fri Oct  6 07:40:21 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;17.&nbsp;ROP Deployment</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="implementing-rop-client.html">Prev</a>&nbsp;</td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part3.html">Part&nbsp;III.&nbsp;Cayenne Framework - Remote Object Persistence </a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="current-limitations.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="rop-deployment"></a>Chapter&nbsp;17.&nbsp;ROP Deployment</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="rop-deployment.html
 #deploying-rop-server">Deploying ROP Server</a></span></dt><dt><span class="section"><a href="rop-deployment.html#deploying-rop-client">Deploying ROP Client</a></span></dt><dt><span class="section"><a href="rop-deployment.html#rop-security">Security</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="deploying-rop-server"></a>Deploying ROP Server</h2></div></div></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>Recent versions of Tomcat and Jetty containers (e.g. Tomcat 6 and 7, Jetty 8) contain code
+        </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;17.&nbsp;ROP Deployment</th><th></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="implementing-rop-client.html">Prev</a>&nbsp;</td><th width="60%" align="center"><a accesskey="u" href="cayenne-guide-part3.html">Part&nbsp;III.&nbsp;Cayenne Framework - Remote Object Persistence </a></th><td width="20%" align="right">&nbsp;<a accesskey="n" href="current-limitations.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="rop-deployment"></a>Chapter&nbsp;17.&nbsp;ROP Deployment</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="rop-deployment.html
 #deploying-rop-server">Deploying ROP Server</a></span></dt><dt><span class="section"><a href="rop-deployment.html#deploying-rop-client">Deploying ROP Client</a></span></dt><dt><span class="section"><a href="rop-deployment.html#rop-security">Security</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title"><a name="deploying-rop-server"></a>Deploying ROP Server</h2></div></div></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>Recent versions of Tomcat and Jetty containers (e.g. Tomcat 6 and 7, Jetty 8) contain code
                 addressing a security concern related to "session fixation problem" by resetting the
                 existing session ID of any request that requires BASIC authentcaition. If ROP
                 service is protected with declarative security (see the ROP tutorial and the



Mime
View raw message