com.spoledge.audao.parser.gql
Class GqlDynamic

java.lang.Object
  extended by com.spoledge.audao.parser.gql.GqlDynamic
All Implemented Interfaces:
GQLDynamicQuery

public class GqlDynamic
extends java.lang.Object
implements GQLDynamicQuery

Parses GQL queries to low-level GAE API calls. This class is not thread safe. Synchronization must be done externally.


Field Summary
protected  DatastoreService ds
           
protected  FetchOptions fo
           
protected  boolean keysOnly
           
protected  Log log
          The logger.
protected  boolean multipleQueries
           
 
Constructor Summary
GqlDynamic()
           
 
Method Summary
protected  java.lang.String formatError(java.lang.String gql, java.lang.Throwable t)
          Formats error message.
 FetchOptions getFetchOptions()
          Returns the FetchOptions of the last query.
 Query parseQuery(java.lang.String gql, java.lang.Object... params)
          Parses GQL query.
 Query parseQueryCond(Query query, java.lang.String gql, java.lang.Object... params)
          Parses GQL query condition.
 PreparedQuery prepareMultipleQueries(Query query, boolean keysOnly)
          Prepares a GQL query.
 PreparedQuery prepareQuery(java.lang.String gql, java.lang.Object... params)
          Prepares a GQL query.
 void setDatastoreService(DatastoreService ds)
          Sets the DatastoreService which is needed for multiple queries.
 boolean wasMultipleQueries()
          Returns true iff the last query was a multiple query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected Log log
The logger.


ds

protected DatastoreService ds

fo

protected FetchOptions fo

multipleQueries

protected boolean multipleQueries

keysOnly

protected boolean keysOnly
Constructor Detail

GqlDynamic

public GqlDynamic()
Method Detail

setDatastoreService

public void setDatastoreService(DatastoreService ds)
Sets the DatastoreService which is needed for multiple queries.

Specified by:
setDatastoreService in interface GQLDynamicQuery

parseQuery

public Query parseQuery(java.lang.String gql,
                        java.lang.Object... params)
Parses GQL query. The result is a "raw" query.

Specified by:
parseQuery in interface GQLDynamicQuery
Parameters:
gql - the GQL query
params - the parameters to the GQL (referenced by :1, :2, ...)

prepareQuery

public PreparedQuery prepareQuery(java.lang.String gql,
                                  java.lang.Object... params)
Prepares a GQL query. Currently it prepares the "raw" query.

Specified by:
prepareQuery in interface GQLDynamicQuery
Parameters:
gql - the GQL query
params - the parameters to the GQL (referenced by :1, :2, ...)

parseQueryCond

public Query parseQueryCond(Query query,
                            java.lang.String gql,
                            java.lang.Object... params)
Parses GQL query condition. This method parses "raw" queries.

Specified by:
parseQueryCond in interface GQLDynamicQuery
Parameters:
query - the initial query
gql - the GQL query
params - the parameters to the GQL (referenced by :1, :2, ...)

prepareMultipleQueries

public PreparedQuery prepareMultipleQueries(Query query,
                                            boolean keysOnly)
Prepares a GQL query.

Specified by:
prepareMultipleQueries in interface GQLDynamicQuery

wasMultipleQueries

public boolean wasMultipleQueries()
Returns true iff the last query was a multiple query. The "multipleQueries" flag has currently no effect, it is reserved for future.

Specified by:
wasMultipleQueries in interface GQLDynamicQuery

getFetchOptions

public FetchOptions getFetchOptions()
Returns the FetchOptions of the last query.

Specified by:
getFetchOptions in interface GQLDynamicQuery
Returns:
always not-null if the query was syntactically ok

formatError

protected java.lang.String formatError(java.lang.String gql,
                                       java.lang.Throwable t)
Formats error message.



Copyright © 2010 Spolecne s.r.o. All Rights Reserved.