2 Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; version 2 of the License.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 package com.mysql.clusterj.core.query;
20 import com.mysql.clusterj.core.spi.QueryExecutionContext;
21 import com.mysql.clusterj.core.store.IndexScanOperation;
23 /** This is an abstract superclass for all of the comparison predicates:
24 * GreaterEqualPredicate, GreaterThanPredicate, LessEqualPredicate, and
27 public abstract class ComparativePredicateImpl extends PredicateImpl {
31 protected ParameterImpl param;
35 protected PropertyImpl property;
37 public ComparativePredicateImpl(QueryDomainTypeImpl<?> dobj) {
41 public ComparativePredicateImpl(QueryDomainTypeImpl<?> dobj,
42 PropertyImpl property, ParameterImpl param) {
44 this.property = property;
46 param.setProperty(property);
49 public void markParameters() {
53 public void unmarkParameters() {
58 public void objectSetValuesFor(QueryExecutionContext context,
59 Object row, String indexName) {
60 property.objectSetValuesFor(param.getParameterValue(context), row, indexName);
64 public void operationSetLowerBound(QueryExecutionContext context,
65 IndexScanOperation op, boolean lastColumn) {
66 // delegate to setBounds for most operations
67 operationSetBounds(context, op, lastColumn);
71 public void operationSetUpperBound(QueryExecutionContext context,
72 IndexScanOperation op, boolean lastColumn) {
73 // delegate to setBounds for most operations
74 operationSetBounds(context, op, lastColumn);