org.outerj.daisy.query.model
Class Query

java.lang.Object
  extended byorg.outerj.daisy.query.model.Query

public class Query
extends java.lang.Object

Describes a query. Obtained from the QueryFactory.

A query contains the following parts:

Once a query has been obtained from the QueryFactory, it should be prepared by calling prepare(org.outerj.daisy.query.QueryContext).

This class also has methods to generate SQL for performing the 'where clause'.


Constructor Summary
Query(IdentifierList selectClause, CondExpr whereClause, FullTextQuery fullTextQuery, IdentifierList orderByClause, java.util.List sortOrders, int limit)
           
 
Method Summary
 void bindSql(java.sql.PreparedStatement stmt, int bindPos)
           
 FullTextQuery getFullTextQuery()
           
 int getLimit()
           
 Identifier[] getOrderByIdentifiers()
           
 SortOrder[] getOrderBySortOrders()
           
 boolean getSearchLastVersion()
           
 Identifier[] getSelectIdentifiers()
           
 java.lang.String getSql()
          This method should only be called if hasSql() return true.
 java.lang.String getStyleHint()
           
 boolean hasSql()
           
 void mergeCondition(CondExpr condExpr)
          Merges the where clause of this query with the given condition using the AND operator.
 void prepare(QueryContext context)
           
 void setIncludeRetired(boolean includeRetired)
           
 void setSearchLastVersion(boolean searchLastVersion)
           
 void setStyleHint(java.lang.String styleHint)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Query

public Query(IdentifierList selectClause,
             CondExpr whereClause,
             FullTextQuery fullTextQuery,
             IdentifierList orderByClause,
             java.util.List sortOrders,
             int limit)
Method Detail

prepare

public void prepare(QueryContext context)
             throws QueryException
Throws:
QueryException

hasSql

public boolean hasSql()

getSql

public java.lang.String getSql()
                        throws QueryException
This method should only be called if hasSql() return true.

Throws:
QueryException

getFullTextQuery

public FullTextQuery getFullTextQuery()

bindSql

public void bindSql(java.sql.PreparedStatement stmt,
                    int bindPos)
             throws java.sql.SQLException
Throws:
java.sql.SQLException

getSelectIdentifiers

public Identifier[] getSelectIdentifiers()

getOrderByIdentifiers

public Identifier[] getOrderByIdentifiers()

getOrderBySortOrders

public SortOrder[] getOrderBySortOrders()

getLimit

public int getLimit()

setIncludeRetired

public void setIncludeRetired(boolean includeRetired)

setSearchLastVersion

public void setSearchLastVersion(boolean searchLastVersion)

getSearchLastVersion

public boolean getSearchLastVersion()

getStyleHint

public java.lang.String getStyleHint()

setStyleHint

public void setStyleHint(java.lang.String styleHint)

mergeCondition

public void mergeCondition(CondExpr condExpr)
Merges the where clause of this query with the given condition using the AND operator.



Copyright © -2005 . All Rights Reserved.