chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r786688 - in /websites/production/chemistry: ./ content/java/opencmis-cookbook.html
Date Tue, 08 Mar 2011 16:34:01 GMT
Author: fmui
Date: Tue Mar  8 16:34:01 2011
New Revision: 786688

Log:
Fixed query example

Modified:
    websites/production/chemistry/   (props changed)
    websites/production/chemistry/content/java/opencmis-cookbook.html

Propchange: websites/production/chemistry/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar  8 16:34:01 2011
@@ -1 +1 @@
-/websites/staging/chemistry/trunk:785583-786685
+/websites/staging/chemistry/trunk:785583-786687

Modified: websites/production/chemistry/content/java/opencmis-cookbook.html
==============================================================================
--- websites/production/chemistry/content/java/opencmis-cookbook.html (original)
+++ websites/production/chemistry/content/java/opencmis-cookbook.html Tue Mar  8 16:34:01
2011
@@ -377,13 +377,14 @@ So it might return stale objects.<br />
 
 <h3 id="retrieving_document_objects_from_query_results">Retrieving Document objects
from query results</h3>
 <div class="codehilite"><pre><span class="n">String</span> <span
class="n">myType</span> <span class="o">=</span> <span class="s">&quot;my:documentType&quot;</span><span
class="o">;</span>
-<span class="n">String</span> <span class="n">queryString</span>
<span class="o">=</span> <span class="s">&quot;SELECT * FROM &quot;</span>
<span class="o">+</span> <span class="n">myType</span><span class="o">;</span>
 
 <span class="c1">// get the query name of cmis:objectId</span>
 <span class="n">ObjectType</span> <span class="n">type</span> <span
class="o">=</span> <span class="n">session</span><span class="o">.</span><span
class="na">getTypeDefinition</span><span class="o">(</span><span class="n">myType</span><span
class="o">);</span>
 <span class="n">PropertyDefinition</span><span class="o">&lt;?&gt;</span>
<span class="n">objectIdPropDef</span> <span class="o">=</span> <span
class="n">type</span><span class="o">.</span><span class="na">getPropertyDefinitions</span><span
class="o">().</span><span class="na">get</span><span class="o">(</span><span
class="n">PropertyIds</span><span class="o">.</span><span class="na">OBJECT_ID</span><span
class="o">);</span>
 <span class="n">String</span> <span class="n">objectIdQueryName</span>
<span class="o">=</span> <span class="n">objectIdPropDef</span><span
class="o">.</span><span class="na">getQueryName</span><span class="o">();</span>
 
+<span class="n">String</span> <span class="n">queryString</span>
<span class="o">=</span> <span class="s">&quot;SELECT &quot;</span>
<span class="o">+</span> <span class="n">objectIdQueryName</span>
<span class="o">+</span> <span class="s">&quot; FROM &quot;</span>
<span class="o">+</span> <span class="n">type</span><span class="o">.</span><span
class="na">getQueryName</span><span class="o">();</span>
+
 <span class="c1">// execute query</span>
 <span class="n">ItemIterable</span><span class="o">&lt;</span><span
class="n">QueryResult</span><span class="o">&gt;</span> <span
class="n">results</span> <span class="o">=</span> <span class="n">session</span><span
class="o">.</span><span class="na">query</span><span class="o">(</span><span
class="n">queryString</span><span class="o">,</span> <span class="kc">false</span><span
class="o">);</span>
 



Mime
View raw message