1 16 package org.outerj.daisy.query.model; 17 18 import org.outerj.daisy.query.QueryContext; 19 import org.outerj.daisy.repository.query.QueryException; 20 import org.outerj.daisy.repository.query.EvaluationContext; 21 import org.outerj.daisy.repository.Document; 22 import org.outerj.daisy.repository.Version; 23 24 import java.sql.PreparedStatement ; 25 import java.sql.SQLException ; 26 27 public class AlwaysSatisfiedPredicate extends AbstractPredicateExpr { 28 29 public void prepare(QueryContext context) throws QueryException { 30 } 31 32 public boolean evaluate(Document document, Version version, EvaluationContext evaluationContext) throws QueryException { 33 return true; 34 } 35 36 public AclConditionViolation isAclAllowed() { 37 return null; 38 } 39 40 public Tristate appliesTo(Document document) { 41 return Tristate.YES; 42 } 43 44 public void generateSql(StringBuffer sql, SqlGenerationContext context) throws QueryException { 45 sql.append(" 1 = 1"); 46 } 47 48 public int bindSql(PreparedStatement stmt, int bindPos, EvaluationContext evaluationContext) throws SQLException { 49 return bindPos; 50 } 51 } 52 | Popular Tags |