org.outerj.daisy.query.model
Interface PredicateExpr

All Superinterfaces:
Expression
All Known Implementing Classes:
AbstractMultiArgPredicate, AbstractPredicateExpr, AlwaysSatisfiedPredicate, And, Between, DoesNotHaveVariant, Eq, Gt, GtEq, HasAll, HasAny, HasNone, HasPart, HasPartWithMimeType, In, InCollection, IsLinked, IsNotNull, IsNull, Like, LinksToOrFrom, Lt, LtEq, NotEq, Or, UnaryPredicateExpr

public interface PredicateExpr
extends Expression

Interface for predicate expressions, these are expression which evaluate to either "true" or "false". They are used in the "where" part of the query, or can be evaluated stand-alone.


Method Summary
 Tristate appliesTo(org.outerj.daisy.repository.Document document)
          Checks if this conditionl expression could evaluate to true for a document, without really knowing everything about the document.
 int bindSql(java.sql.PreparedStatement stmt, int bindPos, org.outerj.daisy.repository.query.EvaluationContext evaluationContext)
           
 boolean evaluate(org.outerj.daisy.repository.Document document, org.outerj.daisy.repository.Version version, org.outerj.daisy.repository.query.EvaluationContext evaluationContext)
          Evaluates the expression for the given document and version.
 void generateSql(java.lang.StringBuffer sql, SqlGenerationContext context)
           
 AclConditionViolation isAclAllowed()
          Checks if this PredicateExpr only uses stuff allowed in ACL object conditions.
 void prepare(QueryContext context)
          Needs to be called before usage of other methods.
 
Methods inherited from interface org.outerj.daisy.query.model.Expression
getColumn, getLine, getLocation, setLocation
 

Method Detail

prepare

void prepare(QueryContext context)
             throws org.outerj.daisy.repository.query.QueryException
Needs to be called before usage of other methods.

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

evaluate

boolean evaluate(org.outerj.daisy.repository.Document document,
                 org.outerj.daisy.repository.Version version,
                 org.outerj.daisy.repository.query.EvaluationContext evaluationContext)
                 throws org.outerj.daisy.repository.query.QueryException
Evaluates the expression for the given document and version. The version parameter is allowed to be null, in which case version-dependent information will be retrieved from the document object.

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

generateSql

void generateSql(java.lang.StringBuffer sql,
                 SqlGenerationContext context)
                 throws org.outerj.daisy.repository.query.QueryException
Throws:
org.outerj.daisy.repository.query.QueryException

bindSql

int bindSql(java.sql.PreparedStatement stmt,
            int bindPos,
            org.outerj.daisy.repository.query.EvaluationContext evaluationContext)
            throws java.sql.SQLException,
                   org.outerj.daisy.repository.query.QueryException
Parameters:
bindPos - the binding position on which to bind the next value
Returns:
the next binding position
Throws:
java.sql.SQLException
org.outerj.daisy.repository.query.QueryException

isAclAllowed

AclConditionViolation isAclAllowed()
Checks if this PredicateExpr only uses stuff allowed in ACL object conditions. Returns null if successfull.


appliesTo

Tristate appliesTo(org.outerj.daisy.repository.Document document)
                   throws org.outerj.daisy.repository.query.QueryException
Checks if this conditionl expression could evaluate to true for a document, without really knowing everything about the document. The supplied Document object only needs to return the document type and collections, the other methods do not need to be implemented.

The result can be:

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


Copyright © -2012 . All Rights Reserved.