org.outerj.daisy.query.model
Class Query

java.lang.Object
  extended by org.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(ValueExprList selectClause, PredicateExpr whereClause, FullTextQuery fullTextQuery, ValueExprList orderByClause, java.util.List sortOrders, int limit)
           
 
Method Summary
 void bindSql(java.sql.PreparedStatement stmt, int bindPos, org.outerj.daisy.repository.query.EvaluationContext evaluationContext)
           
 boolean getAnnotateLinkFields()
           
 FullTextQuery getFullTextQuery()
           
 int getLimit()
           
 org.outerj.daisy.repository.query.SortOrder[] getOrderBySortOrders()
           
 ValueExpr[] getOrderByValueExprs()
           
 boolean getSearchLastVersion()
           
 ValueExpr[] getSelectValueExprs()
           
 java.lang.String getSql(org.outerj.daisy.jdbcutil.JdbcHelper jdbcHelper)
          This method should only be called if hasSql() return true.
 java.lang.String getStyleHint()
           
 boolean hasSql()
           
 void mergeCondition(PredicateExpr predicateExpr)
          Merges the where clause of this query with the given condition using the AND operator.
 void prepare(QueryContext context)
           
 void setAnnotateLinkFields(boolean annotateLinkFields)
           
 void setIncludeRetired(boolean includeRetired)
           
 void setOption(java.lang.String name, java.lang.String value)
           
 void setOptions(java.util.Map options)
           
 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(ValueExprList selectClause,
             PredicateExpr whereClause,
             FullTextQuery fullTextQuery,
             ValueExprList orderByClause,
             java.util.List sortOrders,
             int limit)
Method Detail

prepare

public void prepare(QueryContext context)
             throws org.outerj.daisy.repository.query.QueryException
Throws:
org.outerj.daisy.repository.query.QueryException

hasSql

public boolean hasSql()

getSql

public java.lang.String getSql(org.outerj.daisy.jdbcutil.JdbcHelper jdbcHelper)
                        throws org.outerj.daisy.repository.query.QueryException
This method should only be called if hasSql() return true.

Throws:
org.outerj.daisy.repository.query.QueryException

getFullTextQuery

public FullTextQuery getFullTextQuery()

bindSql

public void bindSql(java.sql.PreparedStatement stmt,
                    int bindPos,
                    org.outerj.daisy.repository.query.EvaluationContext evaluationContext)
             throws java.sql.SQLException,
                    org.outerj.daisy.repository.query.QueryException
Throws:
java.sql.SQLException
org.outerj.daisy.repository.query.QueryException

getSelectValueExprs

public ValueExpr[] getSelectValueExprs()

getOrderByValueExprs

public ValueExpr[] getOrderByValueExprs()

getOrderBySortOrders

public org.outerj.daisy.repository.query.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)

getAnnotateLinkFields

public boolean getAnnotateLinkFields()

setAnnotateLinkFields

public void setAnnotateLinkFields(boolean annotateLinkFields)

setOption

public void setOption(java.lang.String name,
                      java.lang.String value)

setOptions

public void setOptions(java.util.Map options)

mergeCondition

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



Copyright © -2012 . All Rights Reserved.