org.apache.chemistry.opencmis.client.api
Interface QueryStatement

All Superinterfaces:
Cloneable

public interface QueryStatement
extends Cloneable

Query Statement.

Example:

 Calendar cal = ...
 Folder folder = ...
 
 QueryStatement qs = session.createQueryStatement("SELECT ?, ? FROM ? WHERE ? > TIMESTAMP ? AND IN_FOLDER(?) OR ? IN (?)");
 
 qs.setProperty(1, "cmis:document", "cmis:name");
 qs.setProperty(2, "cmis:document", "cmis:objectId");
 qs.setType(3, "cmis:document");
 
 qs.setProperty(4, "cmis:document", "cmis:creationDate");
 qs.setDateTime(5, cal);
 
 qs.setId(6, folder);
 
 qs.setProperty(7, "cmis:document", "cmis:createdBy");
 qs.setString(8, "bob", "tom", "lisa"); 
 
 String statement = qs.toQueryString();
 


Method Summary
 ItemIterable<QueryResult> query(boolean searchAllVersions)
          Executes the query.
 ItemIterable<QueryResult> query(boolean searchAllVersions, OperationContext context)
          Executes the query.
 void setBoolean(int parameterIndex, boolean... bool)
          Sets the designated parameter to the given boolean.
 void setDateTime(int parameterIndex, Calendar... cal)
          Sets the designated parameter to the given timestamp.
 void setDateTime(int parameterIndex, Date... date)
          Sets the designated parameter to the given timestamp.
 void setDateTime(int parameterIndex, long... ms)
          Sets the designated parameter to the given timestamp.
 void setId(int parameterIndex, ObjectId... id)
          Sets the designated parameter to the given object id.
 void setNumber(int parameterIndex, Number... num)
          Sets the designated parameter to the given number.
 void setProperty(int parameterIndex, PropertyDefinition<?> propertyDefinition)
          Sets the designated parameter to the query name of the given property.
 void setProperty(int parameterIndex, String typeId, String propertyId)
          Sets the designated parameter to the query name of the given property.
 void setString(int parameterIndex, String... str)
          Sets the designated parameter to the given string.
 void setStringLike(int parameterIndex, String str)
          Sets the designated parameter to the given string.
 void setType(int parameterIndex, ObjectType type)
          Sets the designated parameter to the query name of the given type.
 void setType(int parameterIndex, String typeId)
          Sets the designated parameter to the query name of the given type id.
 void setUri(int parameterIndex, URI... uri)
          Sets the designated parameter to the given URI.
 void setUrl(int parameterIndex, URL... url)
          Sets the designated parameter to the given URL.
 String toQueryString()
          Returns the query statement.
 

Method Detail

setType

void setType(int parameterIndex,
             String typeId)
Sets the designated parameter to the query name of the given type id.


setType

void setType(int parameterIndex,
             ObjectType type)
Sets the designated parameter to the query name of the given type.


setProperty

void setProperty(int parameterIndex,
                 String typeId,
                 String propertyId)
Sets the designated parameter to the query name of the given property.


setProperty

void setProperty(int parameterIndex,
                 PropertyDefinition<?> propertyDefinition)
Sets the designated parameter to the query name of the given property.


setNumber

void setNumber(int parameterIndex,
               Number... num)
Sets the designated parameter to the given number.


setString

void setString(int parameterIndex,
               String... str)
Sets the designated parameter to the given string.


setStringLike

void setStringLike(int parameterIndex,
                   String str)
Sets the designated parameter to the given string. It does not escape backslashes ('\') in front of "%' and '_'.


setId

void setId(int parameterIndex,
           ObjectId... id)
Sets the designated parameter to the given object id.


setUri

void setUri(int parameterIndex,
            URI... uri)
Sets the designated parameter to the given URI.


setUrl

void setUrl(int parameterIndex,
            URL... url)
Sets the designated parameter to the given URL.


setBoolean

void setBoolean(int parameterIndex,
                boolean... bool)
Sets the designated parameter to the given boolean.


setDateTime

void setDateTime(int parameterIndex,
                 Calendar... cal)
Sets the designated parameter to the given timestamp.


setDateTime

void setDateTime(int parameterIndex,
                 Date... date)
Sets the designated parameter to the given timestamp.


setDateTime

void setDateTime(int parameterIndex,
                 long... ms)
Sets the designated parameter to the given timestamp.


toQueryString

String toQueryString()
Returns the query statement.


query

ItemIterable<QueryResult> query(boolean searchAllVersions)
Executes the query.

See Also:
Session.query(String, boolean)

query

ItemIterable<QueryResult> query(boolean searchAllVersions,
                                OperationContext context)
Executes the query.

See Also:
Session.query(String, boolean, OperationContext)


Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.