Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.slide.search.basic
Class BasicQuery

    java.lang.Object
      org.apache.slide.search.SearchQuery
          org.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,

### limit

    protected int limit

### orderBy

    protected OrderBy orderBy

  ORDER BY

### limitDefined

    protected boolean limitDefined

  indicates, if a limit is defined

### store

    protected AbstractStore store

  The store for this query, may be used to access store parameters

### rootExpression

    protected IBasicExpression rootExpression

  the top level expression in the clause

### slideUri

    protected SlideUri slideUri

  used to get the slidePath

### propertyProvider

    protected PropertyProvider propertyProvider

  The provider for the properties

Constructor Detail

### BasicQuery

    protected BasicQuery()

### BasicQuery

    protected BasicQuery(SearchToken searchToken)

Method Detail

### init

    public void init(SearchToken token)

  Description copied from interface: `IBasicQuery`
  Method init

  Specified by:
    `init` in interface `IBasicQuery`
  Parameters:
    `token` - a SearchToken

### getContentExpressionFactory

    public IBasicExpressionFactory getContentExpressionFactory()

  returns the factory for content expressions. May be null, if store does not provide search capabilities and no indexer is defined.

  Specified by:
    `getContentExpressionFactory` in interface `IBasicQuery`
  Returns:
    an IBasicExpressionFactory

### getPropertiesExpressionFactory

    public IBasicExpressionFactory getPropertiesExpressionFactory()

  returns the factory for property expressions. May be null, if store does not provide search capabilities and no indexer is defined.

  Specified by:
    `getPropertiesExpressionFactory` in interface `IBasicQuery`
  Returns:
    an IBasicExpressionFactory

### getStore

    public AbstractStore getStore()

  Method getStore

  Specified by:
    `getStore` in interface `IBasicQuery`
  Returns:
    an AbstractStore

### getSlidePath

    public java.lang.String getSlidePath()
                                  throws InvalidScopeException

  Method getSlidePath

  Specified by:
    `getSlidePath` in interface `IBasicQuery`
  Returns:
    a String
  Throws:
    `InvalidScopeException`

### getSearchToken

    public SearchToken getSearchToken()

  Method getSearchToken

  Specified by:
    `getSearchToken` in interface `IBasicQuery`
  Returns:
    a SearchToken

### getPropertyProvider

    public PropertyProvider getPropertyProvider()

  Method getPropertyProvider

  Specified by:
    `getPropertyProvider` in interface `IBasicQuery`
  Returns:
    a PropertyProvider

### parseQueryElement

    public void parseQueryElement(org.jdom.Element basicSearchElement,
                                  PropertyProvider propertyProvider)
                           throws BadQueryException

  Builds the internal structure from the JDOM tree. Concrete implementations may use parseQueryElementWithoutExpression to create most of the objects describing the query.

  Specified by:
    `parseQueryElement` in interface `IBasicQuery`
  Parameters:
    `basicSearchElement` - the (root) expression Element.
    `propertyProvider` - the PropertyProvider to use (may be `null`).
  Throws:
    `BadQueryException`

### parseQuery

    public abstract void parseQuery(org.jdom.Element basicSearchElement,
                                    PropertyProvider propertyProvider)
                             throws BadQueryException

  builds the internal structure from the JDOM tree. Concrete implementations may use `parseQueryWithoutExpression` to create most of the objects describing the query.

  Parameters:
    `basicSearchElement` - the (root) expression Element.
    `propertyProvider` - the PropertyProvider to use (may be `null`).
  Throws:
    `BadQueryException`

### execute

    public abstract SearchQueryResult execute()
                                       throws ServiceAccessException

  Executes a request. A store specific implementation should overwrite this to optimize the execution.

  Specified by:
    `execute` in interface `IBasicQuery`
  Specified by:
    `execute` in class `SearchQuery`
  Returns:
    a SearchQueryResult
  Throws:
    `ServiceAccessException`

### parseQueryWithoutExpression

    protected void parseQueryWithoutExpression(org.jdom.Element basicSearchElement)
                                        throws BadQueryException

  builds the internal structure from the JDOM tree. It may be used by the concrete implementation of BasicQuery. It does NOT create the tree of Expressions. This must be done in the specific implementation.

  Parameters:
    `basicSearchElement` - an Element
  Throws:
    `BadQueryException`

### getScope

    public QueryScope getScope()

  QueryScope accessor

  Specified by:
    `getScope` in interface `IBasicQuery`
  Returns:
    the Scope

### requestedProperties

    public RequestedProperties requestedProperties()

  Method getSelectedProperties

  Specified by:
    `requestedProperties` in interface `IBasicQuery`
  Specified by:
    `requestedProperties` in class `SearchQuery`
  Returns:
    a SelectedPropertyList

### getExpression

    public IBasicExpression getExpression()

  Method getExpression

  Specified by:
    `getExpression` in interface `IBasicQuery`
  Returns:
    a BasicExpression

### isLimitDefined

    public boolean isLimitDefined()

  Method isLimitDefined

  Specified by:
    `isLimitDefined` in interface `IBasicQuery`
  Returns:
    true if was specified

### getLimit

    public int getLimit()

  Method getLimit

  Specified by:
    `getLimit` in interface `IBasicQuery`
  Returns:
    the value of

### setScope

    public void setScope(QueryScope queryScope)

  Method setScope

  Parameters:
    `queryScope` - a QueryScope

### getOrderBy

    public OrderBy getOrderBy()

  Method getOrderBy

  Returns:
    an OrderBy

### toString

    public java.lang.String toString()

  For debugging purpose.

  Returns:
    this query in string representation

### getScope

    public static QueryScope getScope(org.jdom.Element basicSearchElementJDOM)
                               throws BadQueryException

  Needed to decide, which implementation of BasicQuery to load

  Parameters:
    `basicSearchElementJDOM` - an Element
  Returns:
    a QueryScope
  Throws:
    `BadQueryException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD