MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NotPredicateImpl.java
1 /*
2  Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
3 
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.
7 
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.
12 
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
16 */
17 
18 package com.mysql.clusterj.core.query;
19 
20 import com.mysql.clusterj.ClusterJException;
21 import com.mysql.clusterj.core.spi.QueryExecutionContext;
22 import com.mysql.clusterj.core.store.ScanFilter;
23 import com.mysql.clusterj.core.store.ScanOperation;
24 import com.mysql.clusterj.core.store.ScanFilter.Group;
25 
26 public class NotPredicateImpl extends PredicateImpl {
27 
29  private PredicateImpl predicate;
30 
31  public NotPredicateImpl(PredicateImpl predicate) {
32  super(predicate.dobj);
33  this.predicate = predicate;
34  }
35 
36  @Override
37  public void markParameters() {
38  // Nothing to do because "not" can't use indexes
39  }
40 
41  @Override
42  public void unmarkParameters() {
43  // Nothing to do because "not" can't use indexes
44  }
45 
46  void markBoundsForCandidateIndices(QueryExecutionContext context,
47  CandidateIndexImpl[] candidateIndices) {
48  // Nothing to do because "not" can't use indexes
49  }
50 
57  ScanOperation op) {
58  try {
59  ScanFilter filter = op.getScanFilter(context);
60  filter.begin(Group.GROUP_NAND);
61  predicate.filterCmpValue(context, op, filter);
62  filter.end();
63  } catch (ClusterJException ex) {
64  throw ex;
65  } catch (Exception ex) {
66  throw new ClusterJException(
67  local.message("ERR_Get_NdbFilter"), ex);
68  }
69  }
70 
78  ScanOperation op, ScanFilter filter) {
79  try {
80  filter.begin(Group.GROUP_NAND);
81  predicate.filterCmpValue(context, op, filter);
82  filter.end();
83  } catch (ClusterJException ex) {
84  throw ex;
85  } catch (Exception ex) {
86  throw new ClusterJException(
87  local.message("ERR_Get_NdbFilter"), ex);
88  }
89  }
90 
91 }