org.outerj.daisy.query.model
Class UnaryCondExpr

java.lang.Object
  extended byorg.outerj.daisy.query.model.UnaryCondExpr
All Implemented Interfaces:
CondExpr
Direct Known Subclasses:
Eq, Gt, GtEq, Lt, LtEq, NotEq

public abstract class UnaryCondExpr
extends java.lang.Object
implements CondExpr


Field Summary
protected  Identifier identifier
           
protected  Literal literal
           
 
Constructor Summary
UnaryCondExpr(Identifier identifier, Literal literal)
           
 
Method Summary
 Tristate appliesTo(long documentType, long collection)
          Checks if this conditionl expression could evaluate to true for a document which has the given documentType id and collection id.
 int bindSql(java.sql.PreparedStatement stmt, int bindPos)
           
 boolean evaluate(org.outerj.daisy.repository.Document document)
           
protected abstract  boolean evaluate(java.lang.Object value)
           
 void generateSql(java.lang.StringBuffer sql, SqlGenerationContext context)
           
protected abstract  java.lang.String getOperatorSqlSymbol()
           
 AclConditionViolation isAclAllowed()
          Checks if this CondExpr only uses stuff allowed in ACL object conditions.
protected  boolean makesSenseNotComparableIdentifiers()
           
 void prepare(QueryContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identifier

protected final Identifier identifier

literal

protected final Literal literal
Constructor Detail

UnaryCondExpr

public UnaryCondExpr(Identifier identifier,
                     Literal literal)
Method Detail

prepare

public void prepare(QueryContext context)
             throws QueryException
Specified by:
prepare in interface CondExpr
Throws:
QueryException

makesSenseNotComparableIdentifiers

protected boolean makesSenseNotComparableIdentifiers()

generateSql

public void generateSql(java.lang.StringBuffer sql,
                        SqlGenerationContext context)
                 throws QueryException
Specified by:
generateSql in interface CondExpr
Throws:
QueryException

getOperatorSqlSymbol

protected abstract java.lang.String getOperatorSqlSymbol()

bindSql

public int bindSql(java.sql.PreparedStatement stmt,
                   int bindPos)
            throws java.sql.SQLException
Specified by:
bindSql in interface CondExpr
Parameters:
bindPos - the binding position on which to bind the next value
Returns:
the next binding position
Throws:
java.sql.SQLException

isAclAllowed

public AclConditionViolation isAclAllowed()
Description copied from interface: CondExpr
Checks if this CondExpr only uses stuff allowed in ACL object conditions. Returns null if successfull.

Specified by:
isAclAllowed in interface CondExpr

evaluate

protected abstract boolean evaluate(java.lang.Object value)

evaluate

public boolean evaluate(org.outerj.daisy.repository.Document document)
                 throws QueryException
Specified by:
evaluate in interface CondExpr
Throws:
QueryException

appliesTo

public Tristate appliesTo(long documentType,
                          long collection)
Description copied from interface: CondExpr
Checks if this conditionl expression could evaluate to true for a document which has the given documentType id and collection id. The collection id is optional, specify -1 to ignore.

The result can be:

Specified by:
appliesTo in interface CondExpr


Copyright © -2005 . All Rights Reserved.