18 package com.mysql.clusterj.core.query;
20 import com.mysql.clusterj.ClusterJUserException;
22 import com.mysql.clusterj.core.spi.DomainFieldHandler;
23 import com.mysql.clusterj.core.spi.QueryExecutionContext;
24 import com.mysql.clusterj.core.store.IndexScanOperation;
25 import com.mysql.clusterj.core.store.Operation;
26 import com.mysql.clusterj.core.store.ScanFilter;
28 import com.mysql.clusterj.core.util.I18NHelper;
29 import com.mysql.clusterj.core.util.Logger;
30 import com.mysql.clusterj.core.util.LoggerFactoryService;
32 import com.mysql.clusterj.query.Predicate;
33 import com.mysql.clusterj.query.PredicateOperand;
44 protected QueryDomainTypeImpl<?>
dobj;
50 private boolean complexParameter =
false;
57 public void setComplexParameter() {
58 complexParameter =
true;
62 fmd.operationSetBounds(value,
type, op);
65 public void operationEqual(Object value, Operation op) {
66 fmd.operationEqual(value, op);
69 void objectSetValuesFor(Object value, Object row,
String indexName) {
70 fmd.objectSetValueFor(value, row, indexName);
73 void operationEqualFor(Object parameterValue, Operation op,
String indexName) {
74 fmd.operationEqualForIndex(parameterValue, op, indexName);
77 public void filterCmpValue(Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
78 fmd.filterCompareValue(value, condition, filter);
84 local.
message(
"ERR_Only_Parameters",
"equal"));
90 if (!((lower instanceof
ParameterImpl) && (upper instanceof ParameterImpl))) {
92 local.
message(
"ERR_Only_Parameters",
"between"));
100 local.
message(
"ERR_Only_Parameters",
"greaterThan"));
108 local.
message(
"ERR_Only_Parameters",
"greaterEqual"));
116 local.
message(
"ERR_Only_Parameters",
"lessThan"));
124 local.
message(
"ERR_Only_Parameters",
"lessEqual"));
132 local.
message(
"ERR_Only_Parameters",
"in"));
140 local.
message(
"ERR_Only_Parameters",
"like"));
146 fmd.markLowerBounds(candidateIndices, predicate, strict);
149 void markUpperBound(CandidateIndexImpl[] candidateIndices, PredicateImpl predicate,
boolean strict) {
150 fmd.markUpperBounds(candidateIndices, predicate, strict);
153 void markEqualBound(CandidateIndexImpl[] candidateIndices, PredicateImpl predicate) {
154 fmd.markEqualBounds(candidateIndices, predicate);
157 public void markInBound(CandidateIndexImpl[] candidateIndices, InPredicateImpl predicate) {
158 fmd.markInBounds(candidateIndices, predicate);
161 public Object getParameterValue(QueryExecutionContext context,
String parameterName) {
162 if (complexParameter) {
164 return context.getParameterValue(parameterName);
166 return fmd.getValue(context, parameterName);