atg.repository.rql
Class RqlStatement

java.lang.Object
  extended by atg.repository.rql.RqlStatement
All Implemented Interfaces:
java.io.Serializable

public class RqlStatement
extends java.lang.Object
implements java.io.Serializable

This represents a single RqlStatement, which contains a query, an order by clause, a range clause, and a property hints clause.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
           
 
Constructor Summary
RqlStatement(atg.repository.rql.RqlQuery pQuery, atg.repository.rql.OrderByClause pOrderBy, atg.repository.rql.RangeClause pRange, atg.repository.rql.PropertyHintsClause pPropertyHints)
           
 
Method Summary
 int executeCountQuery(RepositoryView pView, java.lang.Object[] pParams)
          Executes the query represented by this RqlStatement and returns the number of results in the result set.
 RepositoryItem[] executeQuery(RepositoryView pView, java.lang.Object[] pParams)
          Executes the query represented by this RqlStatement, including the sorting, range and property hints clauses, and returns the results.
 RepositoryItem[] executeQueryUncached(RepositoryView pView, java.lang.Object[] pParams)
          Executes the query represented by this RqlStatement, including the sorting, range and property hints clauses, and returns the results.
 atg.repository.rql.OrderByClause getOrderBy()
           
 atg.repository.rql.PropertyHintsClause getPropertyHints()
           
 atg.repository.rql.RqlQuery getQuery()
           
 atg.repository.rql.RangeClause getRange()
           
static void main(java.lang.String[] pArgs)
          This reads an RQL statement from an input file, the prints the RQL statement back out again.
static RqlStatement parseRqlStatement(java.io.InputStream pIn)
          Parses an RqlStatement from the specified input stream.
static RqlStatement parseRqlStatement(java.io.Reader pIn)
          Parses an RqlStatement from the specified Reader.
static RqlStatement parseRqlStatement(java.lang.String pStatement)
          Parses an RqlStatement from the given String.
static RqlStatement parseRqlStatement(java.lang.String pStatement, boolean pCacheRqlStatement)
          Parses an RqlStatement from the given String.
 java.lang.String toString()
          Returns a String representation of this
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

RqlStatement

public RqlStatement(atg.repository.rql.RqlQuery pQuery,
                    atg.repository.rql.OrderByClause pOrderBy,
                    atg.repository.rql.RangeClause pRange,
                    atg.repository.rql.PropertyHintsClause pPropertyHints)
Method Detail

getQuery

public atg.repository.rql.RqlQuery getQuery()

getOrderBy

public atg.repository.rql.OrderByClause getOrderBy()

getRange

public atg.repository.rql.RangeClause getRange()

getPropertyHints

public atg.repository.rql.PropertyHintsClause getPropertyHints()

executeQuery

public RepositoryItem[] executeQuery(RepositoryView pView,
                                     java.lang.Object[] pParams)
                              throws RepositoryException
Executes the query represented by this RqlStatement, including the sorting, range and property hints clauses, and returns the results. The pParams represent parameter values to be inserted into the query at points represented by ?{x} expressions - for example, the value of pParams[0] would be inserted into ?0.

Throws:
RepositoryException

executeQueryUncached

public RepositoryItem[] executeQueryUncached(RepositoryView pView,
                                             java.lang.Object[] pParams)
                                      throws RepositoryException
Executes the query represented by this RqlStatement, including the sorting, range and property hints clauses, and returns the results. The pParams represent parameter values to be inserted into the query at points represented by ?{x} expressions - for example, the value of pParams[0] would be inserted into ?0. The underlying atg.reposiroty implmentation is instructed to not cache this query

Throws:
RepositoryException

executeCountQuery

public int executeCountQuery(RepositoryView pView,
                             java.lang.Object[] pParams)
                      throws RepositoryException
Executes the query represented by this RqlStatement and returns the number of results in the result set. Note that sorting, range, and property hints clauses are ignored in this operation. The pParams represent parameter values to be inserted into the query at points represented by ?{x} expressions - for example, the value of pParams[0] would be inserted into ?0.

Throws:
RepositoryException

parseRqlStatement

public static RqlStatement parseRqlStatement(java.io.InputStream pIn)
                                      throws RepositoryException
Parses an RqlStatement from the specified input stream. The caller is responsible for creating and closing the input stream.

Throws:
RepositoryException

parseRqlStatement

public static RqlStatement parseRqlStatement(java.io.Reader pIn)
                                      throws RepositoryException
Parses an RqlStatement from the specified Reader. The caller is responsible for creating and closing the Reader.

Throws:
RepositoryException

parseRqlStatement

public static RqlStatement parseRqlStatement(java.lang.String pStatement)
                                      throws RepositoryException
Parses an RqlStatement from the given String.

Throws:
RepositoryException

parseRqlStatement

public static RqlStatement parseRqlStatement(java.lang.String pStatement,
                                             boolean pCacheRqlStatement)
                                      throws RepositoryException
Parses an RqlStatement from the given String. If pCacheRqlStatement is true, then the RqlStatement that is created from this operation will be saved in an internal cache with the String pStatement as the key. The next time this same string is passed to parseRqlStatement, the cached RqlStatement will be returned, so we don't have to re-parse the same string over and over again. Only use this method for statements that you'll definitely be re-using over again, and if the code you're using does NOT cache the statement already

Parameters:
pStatement - the rql String to parse
pCacheRqlStatement - if true, this RqlStatement will be cached in an internal cache
Returns:
an RqlStatement object representing the rql string
Throws:
RepositoryException - if an error occurs while parsing the rql string

toString

public java.lang.String toString()
Returns a String representation of this

Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] pArgs)
                 throws java.io.IOException,
                        RepositoryException
This reads an RQL statement from an input file, the prints the RQL statement back out again.

Throws:
java.io.IOException
RepositoryException