chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1087227 - /chemistry/site/trunk/content/java/examples/example-process-query-results.mdtext
Date Thu, 31 Mar 2011 09:46:12 GMT
Author: fmui
Date: Thu Mar 31 09:46:12 2011
New Revision: 1087227

URL: http://svn.apache.org/viewvc?rev=1087227&view=rev
Log:
added simple qurey example

Modified:
    chemistry/site/trunk/content/java/examples/example-process-query-results.mdtext

Modified: chemistry/site/trunk/content/java/examples/example-process-query-results.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-process-query-results.mdtext?rev=1087227&r1=1087226&r2=1087227&view=diff
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-process-query-results.mdtext (original)
+++ chemistry/site/trunk/content/java/examples/example-process-query-results.mdtext Thu Mar
31 09:46:12 2011
@@ -1,6 +1,26 @@
 Title: Perform a query 
 
-# Perform a query and process results
+# Simple query pattern
+
+This example demonstrates a simple query that selects all properties from all documents and
then prints them.  
+(This query shouldn't be used in a real application. Always select only the properties and
objects you need!)
+
+    :::java
+    ItemIterable<QueryResult> results = session.query("SELECT * FROM cmis:document",
false);
+
+    for(QueryResult hit: results) {  
+        for(PropertyData<?> property: hit.getProperties()) {
+        
+            String queryName = property.getQueryName();
+            Object value = property.getFirstValue();
+    
+            System.out.println(queryName + ": " + value);
+        }
+        System.out.println("--------------------------------------");
+    }
+
+
+# Get document objects from a query
 
     :::java
     String myType = "my:documentType";



Mime
View raw message