org.outerj.daisy.query.model
Class UnaryPredicateExpr
java.lang.Object
org.outerj.daisy.query.model.AbstractPredicateExpr
org.outerj.daisy.query.model.UnaryPredicateExpr
- All Implemented Interfaces:
- Expression, PredicateExpr
- Direct Known Subclasses:
- Eq, Gt, GtEq, Lt, LtEq, NotEq
public abstract class UnaryPredicateExpr
- extends AbstractPredicateExpr
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. |
protected abstract boolean |
evaluate(java.lang.Object value1,
java.lang.Object value2)
|
void |
generateSql(java.lang.StringBuffer sql,
SqlGenerationContext context)
|
protected abstract java.lang.String |
getOperatorSqlSymbol()
|
AclConditionViolation |
isAclAllowed()
Checks if this PredicateExpr only uses stuff allowed in ACL object conditions. |
protected boolean |
makesSenseForNonOrderedValues()
|
void |
prepare(QueryContext context)
Needs to be called before usage of other methods. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
valueExpr1
protected final ValueExpr valueExpr1
valueExpr2
protected final ValueExpr valueExpr2
UnaryPredicateExpr
public UnaryPredicateExpr(ValueExpr valueExpr1,
ValueExpr valueExpr2)
prepare
public void prepare(QueryContext context)
throws org.outerj.daisy.repository.query.QueryException
- Description copied from interface:
PredicateExpr
- Needs to be called before usage of other methods.
- Throws:
org.outerj.daisy.repository.query.QueryException
makesSenseForNonOrderedValues
protected boolean makesSenseForNonOrderedValues()
generateSql
public void generateSql(java.lang.StringBuffer sql,
SqlGenerationContext context)
throws org.outerj.daisy.repository.query.QueryException
- Throws:
org.outerj.daisy.repository.query.QueryException
getOperatorSqlSymbol
protected abstract java.lang.String getOperatorSqlSymbol()
bindSql
public 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
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
public AclConditionViolation isAclAllowed()
- Description copied from interface:
PredicateExpr
- Checks if this PredicateExpr only uses stuff allowed in ACL object conditions.
Returns null if successfull.
evaluate
protected abstract boolean evaluate(java.lang.Object value1,
java.lang.Object value2)
evaluate
public 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
- Description copied from interface:
PredicateExpr
- 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
appliesTo
public Tristate appliesTo(org.outerj.daisy.repository.Document document)
throws org.outerj.daisy.repository.query.QueryException
- Description copied from interface:
PredicateExpr
- 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:
- yes, if the expression is guaranteed to evaluate
to true for such a document. For example, the simple
expression 'true' will always be true regardless
of the document.
- no,if the expression is guaranteed to evaluate to
false for such a document. For example, the expression
test "documentType = 'abc'" but the supplied document
object is of another type.
- maybe, if the epxression could apply but the exact
outcome depends on further information. For example,
when the expression depends on the value of a field.
- Throws:
org.outerj.daisy.repository.query.QueryException
Copyright © -2012 . All Rights Reserved.