org.apache.slide.search.basic
Class BasicQuery

java.lang.Object
  extended byorg.apache.slide.search.SearchQuery
      extended byorg.apache.slide.search.basic.BasicQuery
All Implemented Interfaces:
IBasicQuery
Direct Known Subclasses:
BasicQueryImpl

public abstract class BasicQuery
extends SearchQuery
implements IBasicQuery

A BasicQuery represents the query and is able to deliver a SearchQueryResult using the execute method. It serves as a base class for store specific implementations. It hosts the information about the SELECT, FROM, WHERE, ORDERBY and LIMIT. It also holds a tree of BasicSearchExpressions.

Version:
$Revision: 1.21 $

Nested Class Summary
static class BasicQuery.ExpressionCompilerProvider
          This IBasicExpressionCompilerProvider implementation returns a BasicQueryCompiler instance in method getCompiler().
 
Field Summary
protected  IBasicExpressionCompilerProvider expressionCompilerProvider
          The provider which delivers the expression compiler to use.
static java.lang.String FROM_ELEMENT_MISSING
          Message of a BadQueryException that is thrown if the query element does not contain a <from> element.
protected  int limit
          
protected  boolean limitDefined
          indicates, if a limit is defined
protected  org.jdom.Namespace namespace
          the namespace for this query
static java.lang.String NO_QUERY_ELEMENT
          Message of a BadQueryException that is thrown if the query element is null.
protected  OrderBy orderBy
          ORDER BY
static java.lang.String PROP_OR_ALLPROP_ELEMENT_MISSING
          Message of a BadQueryException that is thrown if the query element neither contains a <prop> nor a <allprop> element.
protected  PropertyProvider propertyProvider
          The provider for the properties
protected  org.jdom.Element queryElement
          the element describing this query
protected  QueryScope queryScope
          the scope of this query,
protected  RequestedProperties requestedProperties
          List of requested properties,
protected  IBasicExpression rootExpression
          the top level expression in the clause
static java.lang.String SELECT_ELEMENT_MISSING
          Message of a BadQueryException that is thrown if the query element does not contain a <select> element.
protected  SlideUri slideUri
          used to get the slidePath
protected  AbstractStore store
          The store for this query, may be used to access store parameters
protected  org.jdom.Element whereElement
          the element describing the WHERE clauise
 
Fields inherited from class org.apache.slide.search.SearchQuery
searchToken, structureHelper
 
Constructor Summary
protected BasicQuery()
           
protected BasicQuery(SearchToken searchToken)
           
 
Method Summary
abstract  SearchQueryResult execute()
          Executes a request.
 IBasicExpressionFactory getContentExpressionFactory()
          returns the factory for content expressions.
 IBasicExpression getExpression()
          Method getExpression
 int getLimit()
          Method getLimit
 OrderBy getOrderBy()
          Method getOrderBy
 IBasicExpressionFactory getPropertiesExpressionFactory()
          returns the factory for property expressions.
 PropertyProvider getPropertyProvider()
          Method getPropertyProvider
 QueryScope getScope()
          QueryScope accessor
static QueryScope getScope(org.jdom.Element basicSearchElementJDOM)
          Needed to decide, which implementation of BasicQuery to load
 SearchToken getSearchToken()
          Method getSearchToken
 java.lang.String getSlidePath()
          Method getSlidePath
 AbstractStore getStore()
          Method getStore
 void init(SearchToken token)
          Method init
 boolean isLimitDefined()
          Method isLimitDefined
abstract  void parseQuery(org.jdom.Element basicSearchElement, PropertyProvider propertyProvider)
          builds the internal structure from the JDOM tree.
 void parseQueryElement(org.jdom.Element basicSearchElement, PropertyProvider propertyProvider)
          Builds the internal structure from the JDOM tree.
protected  void parseQueryWithoutExpression(org.jdom.Element basicSearchElement)
          builds the internal structure from the JDOM tree.
 RequestedProperties requestedProperties()
          Method getSelectedProperties
 void setScope(QueryScope queryScope)
          Method setScope
 java.lang.String toString()
          For debugging purpose.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_QUERY_ELEMENT

public static final java.lang.String NO_QUERY_ELEMENT
Message of a BadQueryException that is thrown if the query element is null.

See Also:
Constant Field Values

expressionCompilerProvider

protected IBasicExpressionCompilerProvider expressionCompilerProvider
The provider which delivers the expression compiler to use.


SELECT_ELEMENT_MISSING

public static final java.lang.String SELECT_ELEMENT_MISSING
Message of a BadQueryException that is thrown if the query element does not contain a <select> element.

See Also:
Constant Field Values

FROM_ELEMENT_MISSING

public static final java.lang.String FROM_ELEMENT_MISSING
Message of a BadQueryException that is thrown if the query element does not contain a <from> element.

See Also:
Constant Field Values

PROP_OR_ALLPROP_ELEMENT_MISSING

public static final java.lang.String PROP_OR_ALLPROP_ELEMENT_MISSING
Message of a BadQueryException that is thrown if the query element neither contains a <prop> nor a <allprop> element.

See Also:
Constant Field Values

queryElement

protected org.jdom.Element queryElement
the element describing this query


namespace

protected org.jdom.Namespace namespace
the namespace for this query


queryScope

protected QueryScope queryScope
the scope of this query,


whereElement

protected org.jdom.Element whereElement
the element describing the WHERE clauise


requestedProperties

protected RequestedProperties requestedProperties
List of requested properties,