chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r786687 - /websites/staging/chemistry/trunk/content/java/opencmis-cookbook.html
Date Tue, 08 Mar 2011 16:32:31 GMT
Author: buildbot
Date: Tue Mar  8 16:32:31 2011
New Revision: 786687

Log:
Staging update by buildbot

Modified:
    websites/staging/chemistry/trunk/content/java/opencmis-cookbook.html

Modified: websites/staging/chemistry/trunk/content/java/opencmis-cookbook.html
==============================================================================
--- websites/staging/chemistry/trunk/content/java/opencmis-cookbook.html (original)
+++ websites/staging/chemistry/trunk/content/java/opencmis-cookbook.html Tue Mar  8 16:32:31
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