chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1079420 - /chemistry/site/trunk/content/java/opencmis-cookbook.mdtext
Date Tue, 08 Mar 2011 16:32:26 GMT
Author: fmui
Date: Tue Mar  8 16:32:26 2011
New Revision: 1079420

URL: http://svn.apache.org/viewvc?rev=1079420&view=rev
Log:
Fixed query example

Modified:
    chemistry/site/trunk/content/java/opencmis-cookbook.mdtext

Modified: chemistry/site/trunk/content/java/opencmis-cookbook.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/opencmis-cookbook.mdtext?rev=1079420&r1=1079419&r2=1079420&view=diff
==============================================================================
--- chemistry/site/trunk/content/java/opencmis-cookbook.mdtext (original)
+++ chemistry/site/trunk/content/java/opencmis-cookbook.mdtext Tue Mar  8 16:32:26 2011
@@ -195,13 +195,14 @@ There are multiple ways to deal with tha
 
     :::java
     String myType = "my:documentType";
-    String queryString = "SELECT * FROM " + myType;
-    
+ 
     // get the query name of cmis:objectId
     ObjectType type = session.getTypeDefinition(myType);
     PropertyDefinition<?> objectIdPropDef = type.getPropertyDefinitions().get(PropertyIds.OBJECT_ID);
     String objectIdQueryName = objectIdPropDef.getQueryName();
     
+    String queryString = "SELECT " + objectIdQueryName + " FROM " + type.getQueryName();
+
     // execute query
     ItemIterable<QueryResult> results = session.query(queryString, false);
     



Mime
View raw message