chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r787180 - /websites/staging/chemistry/trunk/content/java/how-to/how-to-process-query.html
Date Fri, 18 Mar 2011 13:15:48 GMT
Author: buildbot
Date: Fri Mar 18 13:15:48 2011
New Revision: 787180

Log:
Staging update by buildbot

Modified:
    websites/staging/chemistry/trunk/content/java/how-to/how-to-process-query.html

Modified: websites/staging/chemistry/trunk/content/java/how-to/how-to-process-query.html
==============================================================================
--- websites/staging/chemistry/trunk/content/java/how-to/how-to-process-query.html (original)
+++ websites/staging/chemistry/trunk/content/java/how-to/how-to-process-query.html Fri Mar
18 13:15:48 2011
@@ -192,6 +192,7 @@ Apache Chemistry - Query Integration
 <li><a href="#use_predefined_query_walker">Use predefined query walker</a></li>
 <li><a href="#using_queryobject">Using QueryObject</a></li>
 <li><a href="#processing_a_node_and_referencing_types_and_properties">Processing
a node and referencing types and properties</a></li>
+<li><a href="#building_the_result_list">Building the result list</a></li>
 </ul>
 </li>
 </ul>
@@ -313,6 +314,11 @@ example the statement</p>
 
 <p>will result in calling the method <code>onLessThan()</code> in your
walker callback
 implementation:</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span
class="kt">void</span> <span class="nf">onLessThan</span><span class="o">(</span><span
class="n">Tree</span> <span class="n">ltNode</span><span class="o">,</span>
<span class="n">Tree</span> <span class="n">leftNode</span><span
class="o">,</span> <span class="n">Tree</span> <span class="n">rightNode</span><span
class="o">)</span> <span class="o">{</span>
+<span class="o">}</span>
+</pre></div>
+
+
 <p>The right child node is a literal and you will get an Integer object with
 value 123. The left node is a reference to property and
 <code>getColumnReference()</code> will either give you a function (currently
the only
@@ -320,7 +326,18 @@ supported function is <code>SCORE()</cod
 your type system. The query object maintains several maps to resolve
 references. The key to the map is always the token index in the incoming
 token stream (an integer value). You can get the token index for each node
-by calling <code>getTokenStartIndex()</code> on the node.</p></div>
+by calling <code>getTokenStartIndex()</code> on the node.</p>
+<h2 id="building_the_result_list">Building the result list</h2>
+<p>After processing the query an <code>ObjectList</code> has to be returned
containing the
+requested properties and function results. You can ask the query object for
+the requested information:</p>
+<div class="codehilite"><pre><span class="n">Map</span> <span
class="n">props</span> <span class="o">=</span> <span class="n">queryObj</span><span
class="o">.</span><span class="na">getRequestedProperties</span><span
class="o">();</span>
+<span class="n">Map</span> <span class="n">funcs</span> <span
class="o">=</span> <span class="n">queryObj</span><span class="o">.</span><span
class="na">getRequestedFuncs</span><span class="o">();</span>
+</pre></div>
+
+
+<p>Key of the map is the query name and value is the alias if an alias was
+used in the statement or the query name otherwise.</p></div>
              <!-- Content -->
            </td>
           </tr>



Mime
View raw message