Package org.infinispan.objectfilter.impl.hql.predicate

Source Code of org.infinispan.objectfilter.impl.hql.predicate.FilterComparisonPredicate

package org.infinispan.objectfilter.impl.hql.predicate;

import org.hibernate.hql.ast.spi.predicate.ComparisonPredicate;
import org.infinispan.objectfilter.impl.syntax.BooleanExpr;
import org.infinispan.objectfilter.impl.syntax.ComparisonExpr;
import org.infinispan.objectfilter.impl.syntax.ConstantValueExpr;
import org.infinispan.objectfilter.impl.syntax.PropertyValueExpr;

/**
* @author anistor@redhat.com
* @since 7.0
*/
class FilterComparisonPredicate extends ComparisonPredicate<BooleanExpr> {

   public FilterComparisonPredicate(String propertyName, Type comparisonType, Object comparisonValue) {
      super(propertyName, comparisonType, comparisonValue);
   }

   @Override
   protected BooleanExpr getStrictlyLessQuery() {
      return new ComparisonExpr(new PropertyValueExpr(propertyName), new ConstantValueExpr((Comparable) value), ComparisonExpr.Type.LESS);
   }

   @Override
   protected BooleanExpr getLessOrEqualsQuery() {
      return new ComparisonExpr(new PropertyValueExpr(propertyName), new ConstantValueExpr((Comparable) value), ComparisonExpr.Type.LESS_OR_EQUAL);
   }

   @Override
   protected BooleanExpr getEqualsQuery() {
      return new ComparisonExpr(new PropertyValueExpr(propertyName), new ConstantValueExpr((Comparable) value), ComparisonExpr.Type.EQUAL);
   }

   @Override
   protected BooleanExpr getGreaterOrEqualsQuery() {
      return new ComparisonExpr(new PropertyValueExpr(propertyName), new ConstantValueExpr((Comparable) value), ComparisonExpr.Type.GREATER_OR_EQUAL);
   }

   @Override
   protected BooleanExpr getStrictlyGreaterQuery() {
      return new ComparisonExpr(new PropertyValueExpr(propertyName), new ConstantValueExpr((Comparable) value), ComparisonExpr.Type.GREATER);
   }
}
TOP

Related Classes of org.infinispan.objectfilter.impl.hql.predicate.FilterComparisonPredicate

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.