Class QueryImpl
- java.lang.Object
-
- org.apache.jackrabbit.core.query.lucene.AbstractQueryImpl
-
- org.apache.jackrabbit.core.query.lucene.QueryImpl
-
- All Implemented Interfaces:
ExecutableQuery
public class QueryImpl extends AbstractQueryImpl
Implements theExecutableQueryinterface.
-
-
Field Summary
Fields Modifier and Type Field Description static NameDEFAULT_SELECTOR_NAMEThe default selector name 's'.protected QueryRootNoderootThe root node of the query tree-
Fields inherited from class org.apache.jackrabbit.core.query.lucene.AbstractQueryImpl
cache, index, propReg, sessionContext
-
-
Constructor Summary
Constructors Constructor Description QueryImpl(SessionContext sessionContext, SearchIndex index, PropertyTypeRegistry propReg, String statement, String language, QueryNodeFactory factory)Creates a new query instance from a query string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ColumnImplcolumnForName(Name propertyName)Returns a column for the given property name and the default selector name.QueryResultexecute(long offset, long limit)Executes this query and returns a.QueryResultprotected ColumnImpl[]getColumns()Returns the columns for this query.booleanneedsSystemTree()Returnstrueif 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
-
-
-
-
Field Detail
-
DEFAULT_SELECTOR_NAME
public static final Name DEFAULT_SELECTOR_NAME
The default selector name 's'.
-
root
protected final QueryRootNode root
The root node of the query tree
-
-
Constructor Detail
-
QueryImpl
public QueryImpl(SessionContext sessionContext, SearchIndex index, PropertyTypeRegistry propReg, String statement, String language, QueryNodeFactory factory) throws InvalidQueryException
Creates a new query instance from a query string.- Parameters:
sessionContext- component context of the current sessionindex- 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 specifiedlanguage.
-
-
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 setlimit- the maximum result size- Returns:
- a
QueryResult - Throws:
RepositoryException- if an error occurs
-
getColumns
protected ColumnImpl[] getColumns() throws RepositoryException
Returns the columns for this query.- Returns:
- array of columns.
- Throws:
RepositoryException- if an error occurs.
-
needsSystemTree
public boolean needsSystemTree()
Returnstrueif this query node needs items under /jcr:system to be queried.- Specified by:
needsSystemTreein classAbstractQueryImpl- Returns:
trueif this query node needs content under /jcr:system to be queried;falseotherwise.
-
columnForName
protected ColumnImpl columnForName(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.
-
-