org.apache.jackrabbit.core.query
Class QueryObjectModelImpl

java.lang.Object
  extended by org.apache.jackrabbit.core.query.AbstractQueryImpl
      extended by org.apache.jackrabbit.core.query.QueryImpl
          extended by org.apache.jackrabbit.core.query.QueryObjectModelImpl
All Implemented Interfaces:
QueryObjectModel, Query

public class QueryObjectModelImpl
extends QueryImpl
implements QueryObjectModel

QueryObjectModelImpl implements the query object model.


Field Summary
protected  QueryObjectModelTree qomTree
          The query object model tree.
 
Fields inherited from class org.apache.jackrabbit.core.query.QueryImpl
handler, language, node, query, session, statement
 
Fields inherited from interface javax.jcr.query.Query
JCR_JQOM, JCR_SQL2, SQL, XPATH
 
Constructor Summary
QueryObjectModelImpl()
           
 
Method Summary
 Column[] getColumns()
          Gets the columns for this query.
 Constraint getConstraint()
          Gets the constraint for this query.
 Ordering[] getOrderings()
          Gets the orderings for this query.
 Source getSource()
          Gets the node-tuple source for this query.
 void init(SessionImpl session, ItemManager itemMgr, QueryHandler handler, QueryObjectModelTree qomTree, String language, Node node)
          Initializes a query instance from a query object model.
 void init(SessionImpl session, ItemManager itemMgr, QueryHandler handler, String statement, String language, Node node)
          Initializes a query instance from a query string.
 
Methods inherited from class org.apache.jackrabbit.core.query.QueryImpl
bindValue, checkInitialized, checkNotInitialized, execute, getBindVariableNames, getLanguage, getStatement, getStoredQueryPath, setInitialized, setLimit, setOffset, storeAsNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jcr.query.Query
bindValue, execute, getBindVariableNames, getLanguage, getStatement, getStoredQueryPath, setLimit, setOffset, storeAsNode
 

Field Detail

qomTree

protected QueryObjectModelTree qomTree
The query object model tree.

Constructor Detail

QueryObjectModelImpl

public QueryObjectModelImpl()
Method Detail

init

public void init(SessionImpl session,
                 ItemManager itemMgr,
                 QueryHandler handler,
                 String statement,
                 String language,
                 Node node)
          throws InvalidQueryException
Initializes a query instance from a query string.

Overrides:
init in class QueryImpl
Parameters:
session - the session of the user executing this query.
itemMgr - the item manager of the session executing this query.
handler - the query handler of the search index.
statement - the query statement.
language - the syntax of the query statement.
node - a nt:query node where the query was read from or null if it is not a stored query.
Throws:
UnsupportedOperationException - always.
InvalidQueryException - if the query statement is invalid according to the specified language.

init

public void init(SessionImpl session,
                 ItemManager itemMgr,
                 QueryHandler handler,
                 QueryObjectModelTree qomTree,
                 String language,
                 Node node)
          throws InvalidQueryException,
                 RepositoryException
Initializes a query instance from a query object model.

Parameters:
session - the session of the user executing this query.
itemMgr - the item manager of the session executing this query.
handler - the query handler of the search index.
qomTree - the query object model tree.
language - the original query syntax from where the JQOM was created.
node - a nt:query node where the query was read from or null if it is not a stored query.
Throws:
InvalidQueryException - if the qom tree cannot be serialized according to the given language.
RepositoryException - if another error occurs

getSource

public Source getSource()
Gets the node-tuple source for this query.

Specified by:
getSource in interface QueryObjectModel
Returns:
the node-tuple source; non-null

getConstraint

public Constraint getConstraint()
Gets the constraint for this query.

Specified by:
getConstraint in interface QueryObjectModel
Returns:
the constraint, or null if none

getOrderings

public Ordering[] getOrderings()
Gets the orderings for this query.

Specified by:
getOrderings in interface QueryObjectModel
Returns:
an array of zero or more orderings; non-null

getColumns

public Column[] getColumns()
Gets the columns for this query.

Specified by:
getColumns in interface QueryObjectModel
Returns:
an array of zero or more columns; non-null


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