org.apache.jackrabbit.core.query.lucene
Class QueryImpl

java.lang.Object
  extended by org.apache.jackrabbit.core.query.lucene.AbstractQueryImpl
      extended by org.apache.jackrabbit.core.query.lucene.QueryImpl
All Implemented Interfaces:
ExecutableQuery

public class QueryImpl
extends AbstractQueryImpl

Implements the ExecutableQuery interface.


Field Summary
static org.apache.jackrabbit.spi.Name DEFAULT_SELECTOR_NAME
          The default selector name 's'.
protected  org.apache.jackrabbit.spi.commons.query.QueryRootNode root
          The root node of the query tree
 
Fields inherited from class org.apache.jackrabbit.core.query.lucene.AbstractQueryImpl
cache, index, propReg, sessionContext
 
Constructor Summary
QueryImpl(SessionContext sessionContext, SearchIndex index, PropertyTypeRegistry propReg, String statement, String language, org.apache.jackrabbit.spi.commons.query.QueryNodeFactory factory)
          Creates a new query instance from a query string.
 
Method Summary
protected  org.apache.jackrabbit.spi.commons.query.qom.ColumnImpl columnForName(org.apache.jackrabbit.spi.Name propertyName)
          Returns a column for the given property name and the default selector name.
 QueryResult execute(long offset, long limit)
          Executes this query and returns a QueryResult.
protected  org.apache.jackrabbit.spi.commons.query.qom.ColumnImpl[] getColumns()
          Returns the columns for this query.
 boolean needsSystemTree()
          Returns true if this query node needs items under /jcr:system to be queried.
 
Methods inherited from class org.apache.jackrabbit.core.query.lucene.AbstractQueryImpl
getQOMFactory, getRespectDocumentOrder, setRespectDocumentOrder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SELECTOR_NAME

public static final org.apache.jackrabbit.spi.Name DEFAULT_SELECTOR_NAME
The default selector name 's'.


root

protected final org.apache.jackrabbit.spi.commons.query.QueryRootNode root
The root node of the query tree

Constructor Detail

QueryImpl

public QueryImpl(SessionContext sessionContext,
                 SearchIndex index,
                 PropertyTypeRegistry propReg,
                 String statement,
                 String language,
                 org.apache.jackrabbit.spi.commons.query.QueryNodeFactory factory)
          throws InvalidQueryException
Creates a new query instance from a query string.

Parameters:
sessionContext - component context of the current session
index - the search index.
propReg - the property type registry.
statement - the query statement.
language - the syntax of the query statement.
factory - the query node factory.
Throws:
InvalidQueryException - if the query statement is invalid according to the specified language.
Method Detail

execute

public QueryResult execute(long offset,
                           long limit)
                    throws RepositoryException
Executes this query and returns a QueryResult.

Parameters:
offset - the offset in the total result set
limit - the maximum result size
Returns:
a QueryResult
Throws:
RepositoryException - if an error occurs

getColumns

protected org.apache.jackrabbit.spi.commons.query.qom.ColumnImpl[] getColumns()
                                                                       throws RepositoryException
Returns the columns for this query.

Returns:
array of columns.
Throws:
RepositoryException - if an error occurs.

needsSystemTree

public boolean needsSystemTree()
Returns true if this query node needs items under /jcr:system to be queried.

Specified by:
needsSystemTree in class AbstractQueryImpl
Returns:
true if this query node needs content under /jcr:system to be queried; false otherwise.

columnForName

protected org.apache.jackrabbit.spi.commons.query.qom.ColumnImpl columnForName(org.apache.jackrabbit.spi.Name propertyName)
                                                                        throws RepositoryException
Returns a column for the given property name and the default selector name.

Parameters:
propertyName - the name of the property as well as the column.
Returns:
a column.
Throws:
RepositoryException - if an error occurs while creating the column.


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