19 package com.mysql.clusterj.bindings;
21 import com.mysql.cluster.ndbj.NdbApiException;
22 import com.mysql.cluster.ndbj.NdbIndexScanOperation;
24 import com.mysql.clusterj.ClusterJDatastoreException;
25 import com.mysql.clusterj.ClusterJFatalInternalException;
27 import com.mysql.clusterj.core.store.Column;
28 import com.mysql.clusterj.core.store.IndexScanOperation;
29 import com.mysql.clusterj.core.util.I18NHelper;
30 import com.mysql.clusterj.core.util.Logger;
31 import com.mysql.clusterj.core.util.LoggerFactoryService;
33 import java.math.BigDecimal;
37 import java.sql.Timestamp;
42 class IndexScanOperationImpl
extends ScanOperationImpl implements IndexScanOperation {
45 static final I18NHelper local = I18NHelper.getInstance(ClusterConnectionImpl.class);
48 static final Logger logger = LoggerFactoryService.getFactory()
49 .getInstance(IndexScanOperationImpl.class);
54 ClusterTransactionImpl transaction) {
55 super(selectIndexScanOperation, transaction);
56 this.ndbIndexScanOperation = selectIndexScanOperation;
59 public void setBoundByte(Column storeColumn, BoundType
type, byte byteValue) {
61 ndbIndexScanOperation.setBoundInt(storeColumn.getName(), convertBoundType(type), (int)byteValue);
62 }
catch (NdbApiException ndbApiException) {
63 throw new ClusterJDatastoreException(local.message(
"ERR_Datastore"),
68 public void setBoundBytes(Column storeColumn, BoundType type, byte[] value) {
70 ndbIndexScanOperation.setBoundBytes(storeColumn.getName(), convertBoundType(type), value);
71 }
catch (NdbApiException ndbApiException) {
72 throw new ClusterJDatastoreException(local.message(
"ERR_Datastore"),
77 public void setBoundDatetime(Column storeColumn, BoundType type, Timestamp value) {
79 ndbIndexScanOperation.setBoundDatetime(storeColumn.getName(), convertBoundType(type), value);
80 }
catch (NdbApiException ndbApiException) {
81 throw new ClusterJDatastoreException(local.message(
"ERR_Datastore"),
86 public void setBoundDate(Column storeColumn, BoundType type, Date value) {
88 Timestamp timestamp =
new Timestamp(value.getTime());
89 ndbIndexScanOperation.setBoundDatetime(storeColumn.getName(), convertBoundType(type), timestamp);
90 }
catch (NdbApiException ndbApiException) {
91 throw new ClusterJDatastoreException(local.message(
"ERR_Datastore"),
96 public void setBoundTime(Column storeColumn, BoundType type, Time value) {
98 Timestamp timestamp =
new Timestamp(value.getTime());
99 ndbIndexScanOperation.setBoundDatetime(storeColumn.getName(), convertBoundType(type), timestamp);
100 }
catch (NdbApiException ndbApiException) {
101 throw new ClusterJDatastoreException(local.message(
"ERR_Datastore"),
106 public void setBoundDecimal(Column storeColumn, BoundType type, BigDecimal value) {
108 ndbIndexScanOperation.setBoundDecimal(storeColumn.getName(), convertBoundType(type), value);
109 }
catch (NdbApiException ndbApiException) {
110 throw new ClusterJDatastoreException(local.message(
"ERR_Datastore"),
115 public void setBoundDouble(Column storeColumn, BoundType type, Double value) {
117 ndbIndexScanOperation.setBoundDouble(storeColumn.getName(), convertBoundType(type), value);
118 }
catch (NdbApiException ndbApiException) {
119 throw new ClusterJDatastoreException(local.message(
"ERR_Datastore"),
124 public void setBoundFloat(Column storeColumn, BoundType type, Float value) {
126 ndbIndexScanOperation.setBoundFloat(storeColumn.getName(), convertBoundType(type), value);
127 }
catch (NdbApiException ndbApiException) {
128 throw new ClusterJDatastoreException(local.message(
"ERR_Datastore"),
133 public void setBoundInt(Column storeColumn, BoundType type, Integer value) {
135 ndbIndexScanOperation.setBoundInt(storeColumn.getName(), convertBoundType(type), value);
136 }
catch (NdbApiException ndbApiException) {
137 throw new ClusterJDatastoreException(local.message(
"ERR_Datastore"),
142 public void setBoundLong(Column storeColumn, BoundType type,
long value) {
144 ndbIndexScanOperation.setBoundLong(storeColumn.getName(), convertBoundType(type), value);
145 }
catch (NdbApiException ndbApiException) {
146 throw new ClusterJDatastoreException(local.message(
"ERR_Datastore"),
151 public void setBoundString(Column storeColumn, BoundType type,
String value) {
153 ndbIndexScanOperation.setBoundString(storeColumn.getName(), convertBoundType(type), value);
154 }
catch (NdbApiException ndbApiException) {
155 throw new ClusterJDatastoreException(local.message(
"ERR_Datastore"),
160 public void setBoundTimestamp(Column storeColumn, BoundType type, Timestamp value) {
162 ndbIndexScanOperation.setBoundTimestamp(storeColumn.getName(), convertBoundType(type), value);
163 }
catch (NdbApiException ndbApiException) {
164 throw new ClusterJDatastoreException(local.message(
"ERR_Datastore"),
182 throw new ClusterJFatalInternalException(
183 local.message(
"ERR_Implementation_Should_Not_Occur"));