18 package com.mysql.clusterj.core.metadata;
20 import com.mysql.clusterj.ClusterJDatastoreException;
21 import com.mysql.clusterj.ClusterJFatalInternalException;
22 import com.mysql.clusterj.ClusterJUserException;
23 import com.mysql.clusterj.ColumnMetadata;
24 import com.mysql.clusterj.ColumnType;
25 import com.mysql.clusterj.core.spi.QueryExecutionContext;
26 import com.mysql.clusterj.core.spi.ValueHandler;
27 import com.mysql.clusterj.core.spi.DomainTypeHandler;
28 import com.mysql.clusterj.core.query.CandidateIndexImpl;
29 import com.mysql.clusterj.core.query.InPredicateImpl;
30 import com.mysql.clusterj.core.query.PredicateImpl;
31 import com.mysql.clusterj.core.spi.DomainFieldHandler;
32 import com.mysql.clusterj.core.store.Blob;
33 import com.mysql.clusterj.core.store.IndexScanOperation;
34 import com.mysql.clusterj.core.store.Operation;
35 import com.mysql.clusterj.core.store.PartitionKey;
36 import com.mysql.clusterj.core.store.ResultData;
37 import com.mysql.clusterj.core.store.ScanFilter;
38 import com.mysql.clusterj.core.util.I18NHelper;
39 import com.mysql.clusterj.core.util.Logger;
40 import com.mysql.clusterj.core.util.LoggerFactoryService;
41 import java.lang.reflect.Proxy;
42 import java.math.BigDecimal;
43 import java.math.BigInteger;
46 import java.sql.Timestamp;
47 import java.text.ParseException;
48 import java.text.SimpleDateFormat;
49 import java.util.HashSet;
159 public void filterCompareValue(Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
161 if (
ScanFilter.BinaryCondition.COND_EQ.equals(condition)) {
166 local.
message(
"ERR_Null_Values_Can_Only_Be_Filtered_Equal",
172 }
catch (Exception ex) {
177 public String getColumnName() {
181 public String[] getColumnNames() {
185 public int getFieldNumber() {
189 public Class<?> getType() {
193 public String getTypeName() {
194 return (
type==null)?
"unknown":printableName(
type);
197 protected String printableName(Class<?> cls) {
199 return printableName(cls.getComponentType()) +
"[] ";
201 return cls.getName();
213 public boolean isPrimitive() {
221 public com.mysql.clusterj.core.store.Column getStoreColumn() {
225 public void markEqualBounds(CandidateIndexImpl[] candidateIndexImpls, PredicateImpl predicate) {
226 for (
int[] indexBounds :
indices) {
227 candidateIndexImpls[indexBounds[0]].markEqualBound(indexBounds[1], predicate);
231 public void markInBounds(CandidateIndexImpl[] candidateIndexImpls, InPredicateImpl predicate) {
232 for (
int[] indexBounds : indices) {
233 candidateIndexImpls[indexBounds[0]].markInBound(indexBounds[1], predicate);
237 public void markLowerBounds(CandidateIndexImpl[] candidateIndexImpls, PredicateImpl predicate,
boolean strict) {
238 for (
int[] indexBounds : indices) {
239 candidateIndexImpls[indexBounds[0]].markLowerBound(indexBounds[1], predicate, strict);
243 public void markUpperBounds(CandidateIndexImpl[] candidateIndexImpls, PredicateImpl predicate,
boolean strict) {
244 for (
int[] indexBounds : indices) {
245 candidateIndexImpls[indexBounds[0]].markUpperBound(indexBounds[1], predicate, strict);
249 public Object getValue(QueryExecutionContext context,
String index) {
253 void objectSetDefaultValue(ValueHandler
handler) {
257 public void objectSetKeyValue(Object key, ValueHandler handler) {
258 if (logger.isDetailEnabled()) {
259 logger.detail(
"Setting value " + key +
".");
264 public void objectSetValue(ResultData rs, ValueHandler handler) {
267 }
catch (Exception ex) {
272 public void objectSetValueExceptIndex(ResultData rs, ValueHandler handler,
String indexName) {
274 if (!includedInIndex(indexName)) {
277 }
catch (Exception ex) {
282 public void objectSetValueFor(Object value, Object row,
String indexName) {
283 if (includedInIndex(indexName)) {
284 ValueHandler handler = (ValueHandler) Proxy.getInvocationHandler(row);
289 public void operationEqual(Object value, Operation op) {
292 }
catch (Exception ex) {
293 ex.printStackTrace();
298 public void operationEqualForIndex(Object parameterValue, Operation op,
String indexName) {
299 throw new UnsupportedOperationException(
"Not yet implemented");
302 public void operationGetValue(Operation op) {
303 if (logger.isDetailEnabled()) {
308 }
catch (Exception ex) {
313 public void operationSetBounds(Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
314 if (logger.isDetailEnabled()) {
315 logger.detail(
"Column: " +
columnName +
" type: " +
type +
" value: " + value);
319 }
catch (Exception ex) {
324 public void operationSetModifiedValue(ValueHandler handler, Operation op) {
327 operationSetValue(handler, op);
331 public void operationSetValue(ValueHandler handler, Operation op) {
332 if (logger.isDetailEnabled()) {
337 }
catch (ClusterJDatastoreException ex) {
342 public void operationSetValue(Object value, Operation op) {
343 if (logger.isDetailEnabled()) {
348 }
catch (ClusterJDatastoreException ex) {
353 protected void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
356 }
catch (Exception ex) {
361 public void partitionKeySetPart(PartitionKey result, ValueHandler handler) {
364 }
catch (NullPointerException npe) {
365 throw new ClusterJUserException(
366 local.
message(
"ERR_Key_Must_Not_Be_Null",
371 protected static String formatBytes(
int length, byte[] data) {
372 int bytesToFormat = Math.min(length, data.length);
374 for (
int i = 0;
i < bytesToFormat; ++
i) {
376 buffer.append(data[
i]);
379 if (bytesToFormat < data.length) {
380 buffer.append(
"...");
382 return buffer.toString();
385 protected static java.util.Date
parse(
String dateString) {
387 return new SimpleDateFormat().parse(dateString);
388 }
catch (ParseException ex) {
389 throw new ClusterJUserException(local.
message(
"ERR_Parse_Exception", dateString));
393 protected String printIndices() {
395 buffer.append(
"indices[");
396 buffer.append(indices.length);
397 buffer.append(
"][]\n");
398 for (
int[] row : indices) {
399 buffer.append(
" row size ");
400 buffer.append(row == null ?
"null" : row.length);
402 buffer.append(row == null ?
"" : row[0]);
404 buffer.append(row == null ?
"" : row[1]);
407 return buffer.toString();
410 protected void reportErrors() {
417 public String toString() {
421 public void validateIndexType(
String indexName,
boolean hash) {
428 protected static interface ObjectOperationHandler {
430 boolean isPrimitive();
432 Object getValue(QueryExecutionContext context,
String index);
434 void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler);
436 void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op);
440 void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op);
442 void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op);
446 void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler);
448 void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op);
450 void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter);
452 void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op);
454 boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered);
456 void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd, PartitionKey
partitionKey, ValueHandler keyValueHandler);
459 protected static ObjectOperationHandler objectOperationHandlerByte =
new ObjectOperationHandler() {
461 public boolean isPrimitive() {
465 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
466 handler.setByte(fmd.fieldNumber, (byte) 0);
469 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
470 op.getValue(fmd.storeColumn);
474 return (Byte) (columnDefaultValue == null ? Byte.valueOf((byte)0) : Byte.valueOf(columnDefaultValue));
477 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
478 op.setByte(fmd.storeColumn, (Byte) value);
481 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
482 if (logger.isDetailEnabled()) {
483 logger.detail(
"Column " + fmd.columnName +
" set to value " + handler.getByte(fmd.fieldNumber));
485 op.setByte(fmd.storeColumn, handler.getObjectByte(fmd.fieldNumber).byteValue());
492 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
493 handler.setByte(fmd.fieldNumber, rs.getByte(fmd.storeColumn));
496 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
497 op.setBoundByte(fmd.storeColumn,
type, ((
Number)value).byteValue());
500 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
501 filter.cmpByte(condition, fmd.storeColumn, ((
Number) value).byteValue());
504 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
505 if (logger.isDetailEnabled()) {
506 logger.detail(
"setInt.setEqual " + fmd.columnName +
" to value " + value);
508 op.equalByte(fmd.storeColumn, ((
Number) value).byteValue());
511 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
515 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
516 PartitionKey
partitionKey, ValueHandler keyValueHandler) {
517 throw new ClusterJFatalInternalException(
518 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
521 public Object getValue(QueryExecutionContext context,
String index) {
522 return context.getByte(index);
527 protected static ObjectOperationHandler objectOperationHandlerBoolean =
new ObjectOperationHandler() {
529 public boolean isPrimitive() {
533 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
534 handler.setBoolean(fmd.fieldNumber,
false);
537 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
538 op.getValue(fmd.storeColumn);
541 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
542 return (Boolean) (columnDefaultValue == null ? Boolean.FALSE : Boolean.valueOf(columnDefaultValue));
545 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
546 op.setBoolean(fmd.storeColumn, (Boolean)value);
549 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
550 op.setBoolean(fmd.storeColumn, handler.getBoolean(fmd.fieldNumber));
557 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
558 handler.setBoolean(fmd.fieldNumber, rs.getBoolean(fmd.storeColumn));
561 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
562 throw new ClusterJFatalInternalException(local.
message(
"ERR_NotImplemented"));
565 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
566 filter.cmpBoolean(condition, fmd.storeColumn, ((Boolean) value).booleanValue());
569 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
570 op.equalBoolean(fmd.storeColumn, ((Boolean)value).booleanValue());
573 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
577 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
578 PartitionKey partitionKey, ValueHandler keyValueHandler) {
579 throw new ClusterJFatalInternalException(
580 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
583 public Object getValue(QueryExecutionContext context,
String index) {
584 return context.getBoolean(index);
589 protected static ObjectOperationHandler objectOperationHandlerObjectBoolean =
new ObjectOperationHandler() {
591 public boolean isPrimitive() {
595 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
596 handler.setBoolean(fmd.fieldNumber,
false);
599 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
600 op.getValue(fmd.storeColumn);
603 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
604 return (Boolean)(columnDefaultValue == null ? Boolean.FALSE : Boolean.valueOf(columnDefaultValue));
607 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
608 op.setBoolean(fmd.storeColumn, (Boolean)value);
611 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
612 if (handler.isNull(fmd.fieldNumber)) {
613 op.setNull(fmd.storeColumn);
615 op.setBoolean(fmd.storeColumn, handler.getBoolean(fmd.fieldNumber));
620 return "setObjectBoolean";
623 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
624 handler.setObjectBoolean(fmd.fieldNumber, rs.getObjectBoolean(fmd.storeColumn));
627 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
628 throw new ClusterJFatalInternalException(local.
message(
"ERR_NotImplemented"));
631 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
632 filter.cmpBoolean(condition, fmd.storeColumn, ((Boolean) value).booleanValue());
635 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
636 op.equalBoolean(fmd.storeColumn, ((Boolean)value).booleanValue());
639 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
643 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
644 PartitionKey partitionKey, ValueHandler keyValueHandler) {
645 throw new ClusterJFatalInternalException(
646 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
649 public Object getValue(QueryExecutionContext context,
String index) {
650 return context.getBoolean(index);
655 protected static ObjectOperationHandler objectOperationHandlerBytes =
new ObjectOperationHandler() {
657 public boolean isPrimitive() {
661 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
664 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
665 op.getValue(fmd.storeColumn);
668 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
669 if (columnDefaultValue == null) {
672 throw new UnsupportedOperationException(local.
message(
"ERR_Convert_String_To_Value", columnDefaultValue,
"byte[]"));
676 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
678 op.setNull(fmd.storeColumn);
680 op.setBytes(fmd.storeColumn, (byte[]) value);
684 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
685 byte[] value = handler.getBytes(fmd.fieldNumber);
687 op.setNull(fmd.storeColumn);
689 op.setBytes(fmd.storeColumn, value);
697 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
698 handler.setBytes(fmd.fieldNumber, rs.getBytes(fmd.storeColumn));
701 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
702 op.setBoundBytes(fmd.storeColumn,
type, (byte[]) value);
705 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
706 filter.cmpBytes(condition, fmd.storeColumn, (byte[]) value);
709 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
710 if (logger.isDetailEnabled()) {
711 logger.detail(
"setBytes.setEqual " + fmd.columnName +
" to value " + value);
713 op.equalBytes(fmd.storeColumn, (byte[]) value);
716 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
720 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
721 PartitionKey partitionKey, ValueHandler keyValueHandler) {
722 throw new ClusterJFatalInternalException(
723 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
726 public Object getValue(QueryExecutionContext context,
String index) {
727 return context.getBytes(index);
732 protected static ObjectOperationHandler objectOperationHandlerKeyBytes =
new ObjectOperationHandler() {
734 public boolean isPrimitive() {
738 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
741 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
742 op.getValue(fmd.storeColumn);
745 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
746 if (columnDefaultValue == null) {
749 throw new UnsupportedOperationException(local.
message(
"ERR_Convert_String_To_Value", columnDefaultValue,
"byte[]"));
753 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
754 op.equalBytes(fmd.storeColumn, (byte[]) value);
757 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
758 byte[] value = handler.getBytes(fmd.fieldNumber);
759 op.equalBytes(fmd.storeColumn, value);
763 return "setKeyBytes";
766 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
767 handler.setBytes(fmd.fieldNumber, rs.getBytes(fmd.storeColumn));
770 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
771 op.setBoundBytes(fmd.storeColumn,
type, (byte[]) value);
774 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
775 filter.cmpBytes(condition, fmd.storeColumn, (byte[]) value);
778 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
779 if (logger.isDetailEnabled()) {
780 logger.detail(
"setBytes.setEqual " + fmd.columnName +
" to value " + value);
782 op.equalBytes(fmd.storeColumn, (byte[]) value);
785 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
789 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
790 PartitionKey partitionKey, ValueHandler keyValueHandler) {
791 partitionKey.addBytesKey(fmd.storeColumn, keyValueHandler.getBytes(fmd.fieldNumber));
794 public Object getValue(QueryExecutionContext context,
String index) {
795 return context.getBytes(index);
800 protected static ObjectOperationHandler objectOperationHandlerBytesLob =
new ObjectOperationHandler() {
802 public boolean isPrimitive() {
806 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
809 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
810 op.getBlob(fmd.storeColumn);
813 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
814 if (columnDefaultValue == null) {
817 throw new UnsupportedOperationException(local.
message(
"ERR_Convert_String_To_Value", columnDefaultValue,
"byte[]"));
821 public void operationSetValue(
final AbstractDomainFieldHandlerImpl fmd,
final Object value,
final Operation op) {
822 Blob blob = op.getBlobHandle(fmd.storeColumn);
828 Runnable callback =
new Runnable() {
831 Blob blob = op.getBlobHandle(fmd.storeColumn);
832 byte[] data = (byte[]) value;
833 int length = data.length;
834 if (logger.isDetailEnabled()) {
835 logger.detail(
"Value to operation set blob value for field " + fmd.name +
" for column " + fmd.columnName +
" wrote length " + length + formatBytes(16, data));
837 blob.writeData(data);
840 op.postExecuteCallback(callback);
844 public void operationSetValue(
final AbstractDomainFieldHandlerImpl fmd,
final ValueHandler handler,
final Operation op) {
845 Blob blob = op.getBlobHandle(fmd.storeColumn);
846 if (handler.isNull(fmd.fieldNumber)) {
851 Runnable callback =
new Runnable() {
854 Blob blob = op.getBlobHandle(fmd.storeColumn);
855 byte[] data = handler.getBytes(fmd.fieldNumber);
856 int length = data.length;
857 if (logger.isDetailEnabled()) {
858 logger.detail(
"Value to operation set blob value for field " + fmd.name +
" for column " + fmd.columnName +
" wrote length " + length + formatBytes(16, data));
860 blob.writeData(data);
863 op.postExecuteCallback(callback);
868 return "setBytesLob";
871 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
872 Blob blob = rs.getBlob(fmd.storeColumn);
873 int length = blob.getLength().intValue();
874 byte[] data =
new byte[length];
875 blob.readData(data, length);
876 if (logger.isDetailEnabled()) {
877 logger.detail(
"ResultSet get blob value for field " + fmd.name +
" for column " + fmd.columnName +
" returned length " + length + formatBytes(16, data));
880 handler.setBytes(fmd.fieldNumber, data);
883 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
884 throw new UnsupportedOperationException(local.
message(
"ERR_NotImplemented"));
887 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
888 throw new UnsupportedOperationException(local.
message(
"ERR_NotImplemented"));
891 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
892 throw new UnsupportedOperationException(local.
message(
"ERR_NotImplemented"));
895 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
899 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
900 PartitionKey partitionKey, ValueHandler keyValueHandler) {
901 throw new ClusterJFatalInternalException(
902 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
905 public Object getValue(QueryExecutionContext context,
String index) {
906 return context.getBoolean(index);
911 protected static ObjectOperationHandler objectOperationHandlerStringLob =
new ObjectOperationHandler() {
913 public boolean isPrimitive() {
917 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
920 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
921 op.getBlob(fmd.storeColumn);
924 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
925 if (columnDefaultValue == null) {
932 public void operationSetValue(
final AbstractDomainFieldHandlerImpl fmd,
final Object value,
final Operation op) {
933 Blob blob = op.getBlobHandle(fmd.storeColumn);
939 Runnable callback =
new Runnable() {
942 Blob blob = op.getBlobHandle(fmd.storeColumn);
943 byte[] data = fmd.storeColumn.encode((
String)value);
944 int length = data.length;
945 if (logger.isDetailEnabled()) {
946 logger.detail(
"Value to operation set text value for field " + fmd.name +
" for column " + fmd.columnName +
" wrote length " + length + formatBytes(16, data));
948 blob.writeData(data);
951 op.postExecuteCallback(callback);
955 public void operationSetValue(
final AbstractDomainFieldHandlerImpl fmd,
final ValueHandler handler,
final Operation op) {
956 Blob blob = op.getBlobHandle(fmd.storeColumn);
957 if (handler.isNull(fmd.fieldNumber)) {
962 Runnable callback =
new Runnable() {
965 Blob blob = op.getBlobHandle(fmd.storeColumn);
966 byte[] data = fmd.storeColumn.encode(handler.getString(fmd.fieldNumber));
967 int length = data.length;
968 if (logger.isDetailEnabled()) {
969 logger.detail(
"Value to operation set text value for field " + fmd.name +
" for column " + fmd.columnName +
" wrote length " + length + formatBytes(16, data));
971 blob.writeData(data);
974 op.postExecuteCallback(callback);
979 return "setStringLob";
982 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
983 Blob blob = rs.getBlob(fmd.storeColumn);
984 int length = blob.getLength().intValue();
985 byte[] data =
new byte[length];
986 blob.readData(data, length);
987 if (logger.isDetailEnabled()) {
988 logger.detail(
"ResultSet get text value for field " + fmd.name +
" for column " + fmd.columnName +
" returned length " + length + formatBytes(16, data));
991 handler.setString(fmd.fieldNumber, fmd.storeColumn.decode(data));
994 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
995 throw new UnsupportedOperationException(local.
message(
"ERR_NotImplemented"));
998 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
999 throw new UnsupportedOperationException(local.
message(
"ERR_NotImplemented"));
1002 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1003 throw new UnsupportedOperationException(local.
message(
"ERR_NotImplemented"));
1006 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
1010 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1011 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1012 throw new ClusterJFatalInternalException(
1013 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
1016 public Object getValue(QueryExecutionContext context,
String index) {
1017 return context.getString(index);
1022 protected static ObjectOperationHandler objectOperationHandlerDecimal =
new ObjectOperationHandler() {
1024 public boolean isPrimitive() {
1028 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
1031 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
1032 op.getValue(fmd.storeColumn);
1035 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
1036 return (BigDecimal) (columnDefaultValue == null ? BigDecimal.ZERO :
new BigDecimal(columnDefaultValue));
1039 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1040 op.setDecimal(fmd.storeColumn, (BigDecimal) value);
1043 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1044 if (handler.isNull(fmd.fieldNumber)) {
1045 op.setNull(fmd.storeColumn);
1047 op.setDecimal(fmd.storeColumn, handler.getBigDecimal(fmd.fieldNumber));
1051 public String handler() {
1052 return "object BigDecimal";
1055 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
1056 handler.setBigDecimal(fmd.fieldNumber, rs.getDecimal(fmd.storeColumn));
1059 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
1060 op.setBoundDecimal(fmd.storeColumn,
type, (BigDecimal) value);
1063 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
1064 filter.cmpDecimal(condition, fmd.storeColumn, (BigDecimal) value);
1067 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1068 if (logger.isDetailEnabled()) {
1069 logger.detail(
"setDecimal.setEqual " + fmd.columnName +
" to value " + value);
1071 op.equalDecimal(fmd.storeColumn, (BigDecimal) value);
1074 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
1078 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1079 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1080 throw new ClusterJFatalInternalException(
1081 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
1084 public Object getValue(QueryExecutionContext context,
String index) {
1085 return context.getBigDecimal(index);
1090 protected static ObjectOperationHandler objectOperationHandlerBigInteger =
new ObjectOperationHandler() {
1092 public boolean isPrimitive() {
1096 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
1099 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
1100 op.getValue(fmd.storeColumn);
1103 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
1104 return (BigInteger)(columnDefaultValue == null ? BigInteger.ZERO :
new BigInteger(columnDefaultValue));
1107 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1108 op.setBigInteger(fmd.storeColumn, (BigInteger)value);
1111 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1112 if (handler.isNull(fmd.fieldNumber)) {
1113 op.setNull(fmd.storeColumn);
1115 op.setBigInteger(fmd.storeColumn, handler.getBigInteger(fmd.fieldNumber));
1119 public String handler() {
1120 return "object BigInteger";
1123 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
1124 handler.setBigInteger(fmd.fieldNumber, rs.getBigInteger(fmd.storeColumn));
1127 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
1128 op.setBoundBigInteger(fmd.storeColumn,
type, (BigInteger)value);
1131 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
1132 filter.cmpBigInteger(condition, fmd.storeColumn, (BigInteger)value);
1135 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1136 if (logger.isDetailEnabled()) {
1137 logger.detail(
"setDecimal.setEqual " + fmd.columnName +
" to value " + value);
1139 op.equalBigInteger(fmd.storeColumn, (BigInteger)value);
1142 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
1146 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1147 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1148 throw new ClusterJFatalInternalException(
1149 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
1152 public Object getValue(QueryExecutionContext context,
String index) {
1153 return context.getBigInteger(index);
1158 protected static ObjectOperationHandler objectOperationHandlerDouble =
new ObjectOperationHandler() {
1160 public boolean isPrimitive() {
1164 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
1165 handler.setDouble(fmd.fieldNumber, 0.0D);
1168 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
1169 op.getValue(fmd.storeColumn);
1172 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
1173 return (Double) (columnDefaultValue == null ? Double.valueOf(
"0") : Double.valueOf(columnDefaultValue));
1176 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1177 op.setDouble(fmd.storeColumn, (Double) value);
1180 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1181 op.setDouble(fmd.storeColumn, handler.getDouble(fmd.fieldNumber));
1184 public String handler() {
1185 return "primitive double";
1188 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
1189 handler.setDouble(fmd.fieldNumber, rs.getDouble(fmd.storeColumn));
1192 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
1193 op.setBoundDouble(fmd.storeColumn,
type, (Double) value);
1196 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
1197 filter.cmpDouble(condition, fmd.storeColumn, ((Double) value).doubleValue());
1200 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1201 op.equalDouble(fmd.storeColumn, (Double)value);
1204 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
1208 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1209 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1210 throw new ClusterJFatalInternalException(
1211 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
1214 public Object getValue(QueryExecutionContext context,
String index) {
1215 return context.getDouble(index);
1220 protected static ObjectOperationHandler objectOperationHandlerFloat =
new ObjectOperationHandler() {
1222 public boolean isPrimitive() {
1226 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
1227 handler.setFloat(fmd.fieldNumber, 0.0F);
1230 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
1231 op.getValue(fmd.storeColumn);
1234 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
1235 return (Float) (columnDefaultValue == null ? Float.valueOf(
"0") : Float.valueOf(columnDefaultValue));
1238 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1239 op.setFloat(fmd.storeColumn, (Float) value);
1242 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1243 op.setFloat(fmd.storeColumn, handler.getFloat(fmd.fieldNumber));
1246 public String handler() {
1247 return "primitive float";
1250 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
1251 handler.setFloat(fmd.fieldNumber, rs.getFloat(fmd.storeColumn));
1254 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
1255 op.setBoundFloat(fmd.storeColumn,
type, (Float) value);
1258 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
1259 filter.cmpFloat(condition, fmd.storeColumn, ((Float) value).floatValue());
1262 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1263 op.equalFloat(fmd.storeColumn, (Float)value);
1266 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
1270 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1271 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1272 throw new ClusterJFatalInternalException(
1273 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
1276 public Object getValue(QueryExecutionContext context,
String index) {
1277 return context.getFloat(index);
1282 protected abstract static class ObjectOperationHandlerInt
implements ObjectOperationHandler {
1284 public boolean isPrimitive() {
1288 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
1289 handler.setInt(fmd.fieldNumber, 0);
1292 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
1293 op.getValue(fmd.storeColumn);
1296 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
1297 return (Integer) (columnDefaultValue == null ? Integer.valueOf(0) : Integer.valueOf(columnDefaultValue));
1300 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1301 op.setInt(fmd.storeColumn, (Integer) value);
1304 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
1305 int value = rs.getInt(fmd.storeColumn);
1306 if (logger.isDetailEnabled()) {
1307 logger.detail(
"Field " + fmd.name +
" from column " + fmd.columnName +
" set to value " + value);
1309 handler.setInt(fmd.fieldNumber, value);
1312 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
1313 op.setBoundInt(fmd.storeColumn,
type, (Integer) value);
1316 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
1317 filter.cmpInt(condition, fmd.storeColumn, ((Integer) value).intValue());
1320 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1321 if (logger.isDetailEnabled()) {
1322 logger.detail(
"setEqual " + fmd.columnName +
" to value " + value);
1324 op.equalInt(fmd.storeColumn, ((Integer) value).intValue());
1327 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
1331 public Object getValue(QueryExecutionContext context,
String index) {
1332 return context.getInt(index);
1337 protected static ObjectOperationHandler objectOperationHandlerInt =
new ObjectOperationHandlerInt() {
1339 public String handler() {
1340 return "primitive int";
1343 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1344 if (logger.isDetailEnabled()) {
1345 logger.detail(
"Column " + fmd.columnName +
" set to value " + handler.getInt(fmd.fieldNumber));
1347 op.setInt(fmd.storeColumn, handler.getInt(fmd.fieldNumber));
1350 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1351 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1352 throw new ClusterJFatalInternalException(
1353 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
1358 protected static ObjectOperationHandler objectOperationHandlerKeyInt =
new ObjectOperationHandlerInt() {
1360 public String handler() {
1361 return "primitive key int";
1364 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1365 if (logger.isDetailEnabled()) {
1366 logger.detail(
"Key field " + fmd.name +
" set equal to value " + handler.getInt(fmd.getFieldNumber()));
1368 op.equalInt(fmd.storeColumn, handler.getInt(fmd.fieldNumber));
1371 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1372 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1373 partitionKey.addIntKey(fmd.storeColumn, keyValueHandler.getInt(fmd.fieldNumber));
1378 protected static ObjectOperationHandler objectOperationHandlerJavaSqlDate =
new ObjectOperationHandler() {
1380 public boolean isPrimitive() {
1384 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
1387 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
1388 op.getValue(fmd.storeColumn);
1391 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
1392 if (columnDefaultValue == null) {
1393 return new Date(
new java.util.Date().getTime());
1396 return Date.valueOf(columnDefaultValue);
1400 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1401 op.setLong(fmd.storeColumn, ((Date)value).getTime());
1404 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1405 if (handler.isNull(fmd.fieldNumber)) {
1406 op.setNull(fmd.storeColumn);
1408 op.setLong(fmd.storeColumn, (handler.getJavaSqlDate(fmd.fieldNumber)).getTime());
1412 public String handler() {
1413 return "object java.sql.Date";
1416 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
1418 handler.setJavaSqlDate(fmd.fieldNumber,
new Date(rs.getLong(fmd.storeColumn)));
1419 }
catch (Exception ex) {
1420 throw new ClusterJDatastoreException(local.
message(
"ERR_Set_Value", fmd.objectOperationHandlerDelegate.handler()), ex);
1424 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
1425 op.setBoundLong(fmd.storeColumn,
type, ((Date)value).getTime());
1428 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
1429 filter.cmpLong(condition, fmd.storeColumn, ((Date)value).getTime());
1432 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1433 op.equalLong(fmd.storeColumn, ((Date)value).getTime());
1436 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
1440 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1441 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1442 throw new ClusterJFatalInternalException(
1443 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
1446 public Object getValue(QueryExecutionContext context,
String index) {
1447 return context.getJavaSqlDate(index);
1452 protected static ObjectOperationHandler objectOperationHandlerJavaSqlTime =
new ObjectOperationHandler() {
1454 public boolean isPrimitive() {
1458 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
1461 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
1462 op.getValue(fmd.storeColumn);
1465 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
1466 if (columnDefaultValue == null) {
1467 return new Time(
new java.util.Date().getTime());
1470 return Time.valueOf(columnDefaultValue);
1474 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1475 op.setLong(fmd.storeColumn, ((Time)value).getTime());
1478 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1479 if (handler.isNull(fmd.fieldNumber)) {
1480 op.setNull(fmd.storeColumn);
1482 op.setLong(fmd.storeColumn, (handler.getJavaSqlTime(fmd.fieldNumber)).getTime());
1486 public String handler() {
1487 return "object java.sql.Time";
1490 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
1491 handler.setJavaSqlTime(fmd.fieldNumber,
new Time(rs.getLong(fmd.storeColumn)));
1494 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
1495 op.setBoundLong(fmd.storeColumn,
type, ((Time)value).getTime());
1498 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
1499 filter.cmpLong(condition, fmd.storeColumn, ((Time)value).getTime());
1502 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1503 op.equalLong(fmd.storeColumn, ((Time)value).getTime());
1506 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
1510 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1511 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1512 throw new ClusterJFatalInternalException(
1513 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
1516 public Object getValue(QueryExecutionContext context,
String index) {
1517 return context.getJavaSqlTime(index);
1522 protected static ObjectOperationHandler objectOperationHandlerJavaSqlTimestamp =
new ObjectOperationHandler() {
1524 public boolean isPrimitive() {
1528 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
1531 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
1532 op.getValue(fmd.storeColumn);
1535 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
1536 if (columnDefaultValue == null) {
1537 return new Timestamp(
new java.util.Date().getTime());
1540 return Timestamp.valueOf(columnDefaultValue);
1544 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1545 op.setLong(fmd.storeColumn, ((Timestamp)value).getTime());
1548 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1549 if (handler.isNull(fmd.fieldNumber)) {
1550 op.setNull(fmd.storeColumn);
1552 op.setLong(fmd.storeColumn, (handler.getJavaSqlTimestamp(fmd.fieldNumber).getTime()));
1556 public String handler() {
1557 return "object java.sql.Timestamp";
1560 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
1561 handler.setJavaSqlTimestamp(fmd.fieldNumber,
new Timestamp(rs.getLong(fmd.storeColumn)));
1564 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
1565 op.setBoundLong(fmd.storeColumn,
type, ((Timestamp)value).getTime());
1568 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
1569 filter.cmpLong(condition, fmd.storeColumn, ((Timestamp)value).getTime());
1572 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1573 op.equalLong(fmd.storeColumn, ((Timestamp)value).getTime());
1576 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
1580 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1581 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1582 throw new ClusterJFatalInternalException(
1583 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
1586 public Object getValue(QueryExecutionContext context,
String index) {
1587 return context.getJavaSqlTimestamp(index);
1592 protected static ObjectOperationHandler objectOperationHandlerJavaUtilDate =
new ObjectOperationHandler() {
1594 public boolean isPrimitive() {
1598 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
1601 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
1602 op.getValue(fmd.storeColumn);
1605 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
1606 if (columnDefaultValue == null) {
1607 return new java.util.Date();
1610 return parse(columnDefaultValue);
1614 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1615 op.setLong(fmd.storeColumn, ((java.util.Date)value).getTime());
1618 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1619 if (handler.isNull(fmd.fieldNumber)) {
1620 op.setNull(fmd.storeColumn);
1622 op.setLong(fmd.storeColumn, (handler.getJavaUtilDate(fmd.fieldNumber)).getTime());
1626 public String handler() {
1627 return "object java.util.Date";
1630 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
1631 handler.setJavaUtilDate(fmd.fieldNumber,
new java.util.Date(rs.getLong(fmd.storeColumn)));
1634 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
1635 op.setBoundLong(fmd.storeColumn,
type, ((java.util.Date)value).getTime());
1638 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
1639 filter.cmpLong(condition, fmd.storeColumn, ((java.util.Date)value).getTime());
1642 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1643 op.equalLong(fmd.storeColumn, ((java.util.Date)value).getTime());
1646 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
1650 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1651 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1652 throw new ClusterJFatalInternalException(
1653 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
1656 public Object getValue(QueryExecutionContext context,
String index) {
1657 return context.getJavaUtilDate(index);
1662 protected static ObjectOperationHandler objectOperationHandlerKeyString =
new ObjectOperationHandler() {
1664 public boolean isPrimitive() {
1668 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
1671 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
1672 op.getValue(fmd.storeColumn);
1675 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
1679 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1680 op.setString(fmd.storeColumn, (
String) value);
1683 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1684 op.equalString(fmd.storeColumn, handler.getString(fmd.fieldNumber));
1687 public String handler() {
1688 return "key String";
1691 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
1692 handler.setString(fmd.fieldNumber, rs.getString(fmd.storeColumn));
1695 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
1696 op.setBoundString(fmd.storeColumn,
type, (
String) value);
1699 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
1700 filter.cmpString(condition, fmd.storeColumn, (
String)value);
1703 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1704 if (logger.isDetailEnabled()) {
1705 logger.detail(
"setString.setEqual " + fmd.columnName +
" to value " + value);
1707 op.equalString(fmd.storeColumn, (
String)value);
1710 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
1714 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1715 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1716 partitionKey.addStringKey(fmd.storeColumn, keyValueHandler.getString(fmd.fieldNumber));
1719 public Object getValue(QueryExecutionContext context,
String index) {
1720 return context.getString(index);
1725 public abstract static class ObjectOperationHandlerLong
implements ObjectOperationHandler {
1727 public boolean isPrimitive() {
1731 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
1732 handler.setLong(fmd.fieldNumber, 0L);
1735 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
1736 op.getValue(fmd.storeColumn);
1739 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
1740 return (Long) (columnDefaultValue == null ? Long.valueOf(0) : Long.valueOf(columnDefaultValue));
1743 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1744 op.setLong(fmd.storeColumn, ((
Number) value).longValue());
1747 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
1748 handler.setLong(fmd.fieldNumber, rs.getLong(fmd.storeColumn));
1751 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
1752 op.setBoundLong(fmd.storeColumn,
type, ((
Number) value).longValue());
1755 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
1756 filter.cmpLong(condition, fmd.storeColumn, ((
Number) value).longValue());
1759 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1760 if (logger.isDetailEnabled()) {
1761 logger.detail(
"setLong.setEqual " + fmd.columnName +
" to value " + value);
1763 op.equalLong(fmd.storeColumn, ((
Number) value).longValue());
1766 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
1770 public Object getValue(QueryExecutionContext context,
String index) {
1771 return context.getLong(index);
1776 protected static ObjectOperationHandler objectOperationHandlerLong =
new ObjectOperationHandlerLong() {
1778 public String handler() {
1779 return "primitive long";
1782 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1783 if (logger.isDetailEnabled()) {
1784 logger.detail(
"Column " + fmd.columnName +
" set to value " + handler.getLong(fmd.fieldNumber));
1786 op.setLong(fmd.storeColumn, handler.getLong(fmd.fieldNumber));
1789 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1790 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1791 throw new ClusterJFatalInternalException(
1792 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
1797 protected static ObjectOperationHandler objectOperationHandlerKeyLong =
new ObjectOperationHandlerLong() {
1799 public String handler() {
1800 return "key primitive long";
1803 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1804 if (logger.isDetailEnabled()) {
1805 logger.detail(
"Column " + fmd.columnName +
" set to value " + handler.getLong(fmd.fieldNumber));
1807 op.equalLong(fmd.storeColumn, handler.getLong(fmd.fieldNumber));
1810 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1811 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1812 partitionKey.addLongKey(fmd.storeColumn, keyValueHandler.getLong(fmd.fieldNumber));
1816 protected static ObjectOperationHandler objectOperationHandlerObjectByte =
new ObjectOperationHandler() {
1818 public boolean isPrimitive() {
1822 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
1825 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
1826 op.getValue(fmd.storeColumn);
1829 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
1830 return (Byte) (columnDefaultValue == null ? Byte.valueOf((byte)0) : Byte.valueOf(columnDefaultValue));
1833 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1834 op.setByte(fmd.storeColumn, (Byte) value);
1837 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1838 if (handler.isNull(fmd.fieldNumber)) {
1839 op.setNull(fmd.storeColumn);
1841 op.setByte(fmd.storeColumn, handler.getObjectByte(fmd.fieldNumber).byteValue());
1845 public String handler() {
1846 return "object Byte";
1849 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
1850 handler.setObjectByte(fmd.fieldNumber, rs.getObjectByte(fmd.storeColumn));
1853 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
1854 op.setBoundByte(fmd.storeColumn,
type, ((
Number)value).byteValue());
1857 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
1858 filter.cmpByte(condition, fmd.storeColumn, ((
Number) value).byteValue());
1861 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1862 if (logger.isDetailEnabled()) {
1863 logger.detail(
"setObjectByte.setEqual " + fmd.columnName +
" to value " + value);
1865 op.equalByte(fmd.storeColumn, ((
Number) value).byteValue());
1868 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
1872 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1873 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1874 throw new ClusterJFatalInternalException(
1875 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
1878 public Object getValue(QueryExecutionContext context,
String index) {
1879 return context.getByte(index);
1884 protected static ObjectOperationHandler objectOperationHandlerObjectDouble =
new ObjectOperationHandler() {
1886 public boolean isPrimitive() {
1890 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
1893 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
1894 op.getValue(fmd.storeColumn);
1897 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
1898 return (Double) (columnDefaultValue == null ? Double.valueOf(
"0") : Double.valueOf(columnDefaultValue));
1901 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1902 op.setDouble(fmd.storeColumn, (Double) value);
1905 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1906 if (handler.isNull(fmd.fieldNumber)) {
1907 op.setNull(fmd.storeColumn);
1909 op.setDouble(fmd.storeColumn, handler.getObjectDouble(fmd.fieldNumber));
1913 public String handler() {
1914 return "object Double";
1917 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
1918 handler.setObjectDouble(fmd.fieldNumber, rs.getObjectDouble(fmd.storeColumn));
1921 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
1922 op.setBoundDouble(fmd.storeColumn,
type, (Double) value);
1925 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
1926 filter.cmpDouble(condition, fmd.storeColumn, ((Double) value).doubleValue());
1929 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1930 op.equalDouble(fmd.storeColumn, (Double)value);
1933 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
1937 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
1938 PartitionKey partitionKey, ValueHandler keyValueHandler) {
1939 throw new ClusterJFatalInternalException(
1940 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
1943 public Object getValue(QueryExecutionContext context,
String index) {
1944 return context.getDouble(index);
1949 protected static ObjectOperationHandler objectOperationHandlerObjectFloat =
new ObjectOperationHandler() {
1951 public boolean isPrimitive() {
1955 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
1958 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
1959 op.getValue(fmd.storeColumn);
1962 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
1963 return (Float) (columnDefaultValue == null ? Float.valueOf(
"0") : Float.valueOf(columnDefaultValue));
1966 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1967 op.setFloat(fmd.storeColumn, (Float) value);
1970 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
1971 if (handler.isNull(fmd.fieldNumber)) {
1972 op.setNull(fmd.storeColumn);
1974 op.setFloat(fmd.storeColumn, handler.getObjectFloat(fmd.fieldNumber));
1978 public String handler() {
1979 return "object Float";
1982 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
1983 handler.setObjectFloat(fmd.fieldNumber, rs.getObjectFloat(fmd.storeColumn));
1986 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
1987 op.setBoundFloat(fmd.storeColumn,
type, (Float) value);
1990 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
1991 filter.cmpFloat(condition, fmd.storeColumn, ((Float) value).floatValue());
1994 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
1995 op.equalFloat(fmd.storeColumn, (Float)value);
1998 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
2002 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
2003 PartitionKey partitionKey, ValueHandler keyValueHandler) {
2004 throw new ClusterJFatalInternalException(
2005 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
2008 public Object getValue(QueryExecutionContext context,
String index) {
2009 return context.getFloat(index);
2014 protected abstract static class ObjectOperationHandlerInteger
implements ObjectOperationHandler {
2016 public boolean isPrimitive() {
2020 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2023 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
2024 op.getValue(fmd.storeColumn);
2027 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
2028 return (Integer) (columnDefaultValue == null ? Integer.valueOf(0) : Integer.valueOf(columnDefaultValue));
2031 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2032 op.setInt(fmd.storeColumn, (Integer) value);
2035 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
2036 handler.setObjectInt(fmd.fieldNumber, rs.getObjectInteger(fmd.storeColumn));
2039 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
2040 op.setBoundInt(fmd.storeColumn,
type, (Integer) value);
2043 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
2044 filter.cmpInt(condition, fmd.storeColumn, ((Integer) value).intValue());
2047 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2048 if (logger.isDetailEnabled()) {
2049 logger.detail(
"setObjectInteger.setEqual " + fmd.columnName +
" to value " + value);
2051 op.equalInt(fmd.storeColumn, ((Integer) value).intValue());
2054 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
2058 public Object getValue(QueryExecutionContext context,
String index) {
2059 return context.getInt(index);
2064 protected static ObjectOperationHandler objectOperationHandlerObjectInteger =
new ObjectOperationHandlerInteger() {
2066 public String handler() {
2067 return "object Integer";
2070 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
2071 if (handler.isNull(fmd.fieldNumber)) {
2072 op.setNull(fmd.storeColumn);
2074 op.setInt(fmd.storeColumn, handler.getObjectInt(fmd.fieldNumber));
2078 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
2079 PartitionKey partitionKey, ValueHandler keyValueHandler) {
2080 throw new ClusterJFatalInternalException(
2081 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
2086 protected static ObjectOperationHandler objectOperationHandlerKeyObjectInteger =
new ObjectOperationHandlerInteger() {
2088 public String handler() {
2089 return "key object Integer";
2092 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
2093 if (handler.isNull(fmd.fieldNumber)) {
2094 op.setNull(fmd.storeColumn);
2096 op.equalInt(fmd.storeColumn, handler.getObjectInt(fmd.fieldNumber));
2100 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
2101 PartitionKey partitionKey, ValueHandler keyValueHandler) {
2102 partitionKey.addIntKey(fmd.storeColumn, keyValueHandler.getObjectInt(fmd.fieldNumber));
2107 public abstract static class ObjectOperationHandlerObjectLong
implements ObjectOperationHandler {
2109 public boolean isPrimitive() {
2113 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2116 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
2117 op.getValue(fmd.storeColumn);
2120 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
2121 return (Long) (columnDefaultValue == null ? Long.valueOf(0) : Long.valueOf(columnDefaultValue));
2124 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2125 op.setLong(fmd.storeColumn, ((
Number) value).longValue());
2128 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
2129 handler.setObjectLong(fmd.fieldNumber, rs.getObjectLong(fmd.storeColumn));
2132 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
2133 op.setBoundLong(fmd.storeColumn,
type, ((
Number) value).longValue());
2136 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
2137 filter.cmpLong(condition, fmd.storeColumn, ((
Number) value).longValue());
2140 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2141 if (logger.isDetailEnabled()) {
2142 logger.detail(
"setObjectLong.setEqual " + fmd.columnName +
" to value " + value);
2144 op.equalLong(fmd.storeColumn, ((
Number) value).longValue());
2147 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
2151 public Object getValue(QueryExecutionContext context,
String index) {
2152 return context.getLong(index);
2157 protected static ObjectOperationHandler objectOperationHandlerObjectLong =
new ObjectOperationHandlerObjectLong() {
2159 public String handler() {
2160 return "object Long";
2163 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
2164 if (handler.isNull(fmd.fieldNumber)) {
2165 op.setNull(fmd.storeColumn);
2167 op.setLong(fmd.storeColumn, handler.getObjectLong(fmd.fieldNumber));
2171 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
2172 PartitionKey partitionKey, ValueHandler keyValueHandler) {
2173 throw new ClusterJFatalInternalException(
2174 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
2179 protected static ObjectOperationHandler objectOperationHandlerKeyObjectLong =
new ObjectOperationHandlerObjectLong() {
2181 public String handler() {
2182 return "key object Long";
2185 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
2186 if (handler.isNull(fmd.fieldNumber)) {
2187 op.setNull(fmd.storeColumn);
2189 op.equalLong(fmd.storeColumn, handler.getObjectLong(fmd.fieldNumber));
2193 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
2194 PartitionKey partitionKey, ValueHandler keyValueHandler) {
2195 partitionKey.addLongKey(fmd.storeColumn, keyValueHandler.getObjectLong(fmd.fieldNumber));
2200 protected static ObjectOperationHandler objectOperationHandlerObjectShort =
new ObjectOperationHandler() {
2202 public boolean isPrimitive() {
2206 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2209 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
2210 op.getValue(fmd.storeColumn);
2213 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
2214 return (Short) (columnDefaultValue == null ? Short.valueOf((
short) 0) : Short.valueOf(columnDefaultValue));
2217 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2218 op.setShort(fmd.storeColumn, (Short) value);
2221 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
2222 if (handler.isNull(fmd.fieldNumber)) {
2223 op.setNull(fmd.storeColumn);
2225 op.setShort(fmd.storeColumn, handler.getObjectShort(fmd.fieldNumber));
2229 public String handler() {
2230 return "object Short";
2233 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
2234 handler.setObjectShort(fmd.fieldNumber, rs.getObjectShort(fmd.storeColumn));
2237 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
2239 op.setBoundShort(fmd.storeColumn,
type, ((
Number) value).shortValue());
2240 }
catch (ClassCastException ex) {
2241 throw new ClusterJUserException(local.
message(
"ERR_Parameter_Type",
"Number", value.getClass().getName()));
2245 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
2247 filter.cmpShort(condition, fmd.storeColumn, ((
Number) value).shortValue());
2248 }
catch (ClassCastException ex) {
2249 throw new ClusterJUserException(local.
message(
"ERR_Parameter_Type",
"Number", value.getClass().getName()));
2253 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2254 op.equalShort(fmd.storeColumn, ((
Number) value).shortValue());
2257 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
2261 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
2262 PartitionKey partitionKey, ValueHandler keyValueHandler) {
2263 throw new ClusterJFatalInternalException(
2264 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
2267 public Object getValue(QueryExecutionContext context,
String index) {
2268 return context.getShort(index);
2273 protected static ObjectOperationHandler objectOperationHandlerShort =
new ObjectOperationHandler() {
2275 public boolean isPrimitive() {
2279 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2280 handler.setShort(fmd.fieldNumber, (
short) 0);
2283 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
2284 op.getValue(fmd.storeColumn);
2287 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
2288 return (Short) (columnDefaultValue == null ? Short.valueOf((
short) 0) : Short.valueOf(columnDefaultValue));
2291 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2292 op.setShort(fmd.storeColumn, (Short) value);
2295 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
2296 if (logger.isDetailEnabled()) {
2297 logger.detail(
"Column " + fmd.columnName +
" set to value " + handler.getShort(fmd.fieldNumber));
2299 op.setShort(fmd.storeColumn, handler.getShort(fmd.fieldNumber));
2302 public String handler() {
2303 return "primitive short";
2306 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
2307 handler.setShort(fmd.fieldNumber, rs.getShort(fmd.storeColumn));
2310 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
2312 op.setBoundShort(fmd.storeColumn,
type, ((
Number) value).shortValue());
2313 }
catch (ClassCastException ex) {
2314 throw new ClusterJUserException(local.
message(
"ERR_Parameter_Type",
"Number", value.getClass().getName()));
2318 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
2320 filter.cmpShort(condition, fmd.storeColumn, ((
Number) value).shortValue());
2321 }
catch (ClassCastException ex) {
2322 throw new ClusterJUserException(local.
message(
"ERR_Parameter_Type",
"Number", value.getClass().getName()));
2326 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2327 op.equalShort(fmd.storeColumn, ((
Number) value).shortValue());
2330 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
2334 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
2335 PartitionKey partitionKey, ValueHandler keyValueHandler) {
2336 throw new ClusterJFatalInternalException(
2337 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
2340 public Object getValue(QueryExecutionContext context,
String index) {
2341 return context.getShort(index);
2346 protected static ObjectOperationHandler objectOperationHandlerShortYear =
new ObjectOperationHandler() {
2348 public boolean isPrimitive() {
2352 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2353 handler.setShort(fmd.fieldNumber, (
short) 1900);
2356 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
2357 op.getValue(fmd.storeColumn);
2360 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
2361 return (Short) (columnDefaultValue == null ? Short.valueOf((
short) 1900) : Short.valueOf(columnDefaultValue));
2364 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2365 op.setByte(fmd.storeColumn, (byte)((Short)value - 1900));
2368 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
2369 op.setByte(fmd.storeColumn, (byte)(handler.getShort(fmd.fieldNumber) - 1900));
2372 public String handler() {
2373 return "primitive short year";
2376 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
2377 handler.setShort(fmd.fieldNumber, (
short)(rs.getByte(fmd.storeColumn) + 1900));
2380 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
2382 op.setBoundByte(fmd.storeColumn,
type, (byte)(((
Number) value).shortValue() - 1900));
2383 }
catch (ClassCastException ex) {
2384 throw new ClusterJUserException(local.
message(
"ERR_Parameter_Type",
"Number", value.getClass().getName()));
2388 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
2390 filter.cmpByte(condition, fmd.storeColumn, (byte)(((
Number) value).shortValue() - 1900));
2391 }
catch (ClassCastException ex) {
2392 throw new ClusterJUserException(local.
message(
"ERR_Parameter_Type",
"Number", value.getClass().getName()));
2396 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2397 op.equalByte(fmd.storeColumn, (byte)(((
Number) value).shortValue() - 1900));
2400 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
2404 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
2405 PartitionKey partitionKey, ValueHandler keyValueHandler) {
2406 throw new ClusterJFatalInternalException(
2407 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
2410 public Object getValue(QueryExecutionContext context,
String index) {
2411 return context.getShort(index);
2416 protected static ObjectOperationHandler objectOperationHandlerObjectShortYear =
new ObjectOperationHandler() {
2418 public boolean isPrimitive() {
2422 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2423 handler.setShort(fmd.fieldNumber, (
short) 1900);
2426 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
2427 op.getValue(fmd.storeColumn);
2430 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
2431 return (Short) (columnDefaultValue == null ? Short.valueOf((
short) 1900) : Short.valueOf(columnDefaultValue));
2434 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2435 op.setByte(fmd.storeColumn, (byte)((Short)value - 1900));
2438 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
2439 if (handler.isNull(fmd.fieldNumber)) {
2440 op.setNull(fmd.storeColumn);
2442 op.setByte(fmd.storeColumn, (byte)(handler.getShort(fmd.fieldNumber) - 1900));
2446 public String handler() {
2447 return "object short year";
2450 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
2451 handler.setShort(fmd.fieldNumber, (
short)(rs.getByte(fmd.storeColumn) + 1900));
2454 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
2456 op.setBoundByte(fmd.storeColumn,
type, (byte)(((
Number) value).shortValue() - 1900));
2457 }
catch (ClassCastException ex) {
2458 throw new ClusterJUserException(local.
message(
"ERR_Parameter_Type",
"Number", value.getClass().getName()));
2462 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
2464 filter.cmpByte(condition, fmd.storeColumn, (byte)(((
Number) value).shortValue() - 1900));
2465 }
catch (ClassCastException ex) {
2466 throw new ClusterJUserException(local.
message(
"ERR_Parameter_Type",
"Number", value.getClass().getName()));
2470 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2471 op.equalByte(fmd.storeColumn, (byte)(((
Number) value).shortValue() - 1900));
2474 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
2478 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
2479 PartitionKey partitionKey, ValueHandler keyValueHandler) {
2480 throw new ClusterJFatalInternalException(
2481 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
2484 public Object getValue(QueryExecutionContext context,
String index) {
2485 return context.getShort(index);
2490 protected static ObjectOperationHandler objectOperationHandlerString =
new ObjectOperationHandler() {
2492 public boolean isPrimitive() {
2496 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2499 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
2500 op.getValue(fmd.storeColumn);
2503 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
2507 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2508 if (value == null) {
2509 op.setNull(fmd.storeColumn);
2511 op.setString(fmd.storeColumn, (
String)value);
2515 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
2516 if (handler.isNull(fmd.fieldNumber)) {
2517 op.setNull(fmd.storeColumn);
2519 op.setString(fmd.storeColumn, handler.getString(fmd.fieldNumber));
2523 public String handler() {
2524 return "object String";
2527 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
2528 if (logger.isDetailEnabled()) {
2529 logger.detail(
"field " + fmd.name +
" set to value " + rs.getString(fmd.storeColumn));
2531 handler.setString(fmd.fieldNumber, rs.getString(fmd.storeColumn));
2534 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
2535 op.setBoundString(fmd.storeColumn,
type, (
String)value);
2538 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
2539 filter.cmpString(condition, fmd.storeColumn, (
String)value);
2542 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2543 op.equalString(fmd.storeColumn, (
String)value);
2546 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
2550 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
2551 PartitionKey partitionKey, ValueHandler keyValueHandler) {
2552 throw new ClusterJFatalInternalException(
2553 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
2556 public Object getValue(QueryExecutionContext context,
String index) {
2557 return context.getString(index);
2562 protected static ObjectOperationHandler objectOperationHandlerUnsupportedType =
new ObjectOperationHandler() {
2564 public boolean isPrimitive() {
2568 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2569 throw new ClusterJUserException(local.
message(
"ERR_Unsupported_Field_Type", fmd.getTypeName(), fmd.getName()));
2572 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd, Operation op) {
2573 throw new ClusterJUserException(local.
message(
"ERR_Unsupported_Field_Type", fmd.getTypeName(), fmd.getName()));
2576 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
2580 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2581 throw new ClusterJUserException(local.
message(
"ERR_Unsupported_Field_Type", fmd.getTypeName(), fmd.getName()));
2584 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
2585 throw new ClusterJUserException(local.
message(
"ERR_Unsupported_Field_Type", fmd.getTypeName(), fmd.getName()));
2588 public String handler() {
2589 return "unsupported Type";
2592 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
2593 throw new ClusterJUserException(local.
message(
"ERR_Unsupported_Field_Type", fmd.getTypeName(), fmd.getName()));
2596 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
2597 throw new ClusterJUserException(local.
message(
"ERR_Unsupported_Field_Type", fmd.getTypeName(), fmd.getName()));
2600 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
2601 throw new ClusterJUserException(local.
message(
"ERR_Unsupported_Field_Type", fmd.getTypeName(), fmd.getName()));
2604 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2605 throw new ClusterJUserException(local.
message(
"ERR_Unsupported_Field_Type", fmd.getTypeName(), fmd.getName()));
2608 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
2612 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd, PartitionKey partitionKey, ValueHandler keyValueHandler) {
2613 throw new ClusterJUserException(local.
message(
"ERR_Unsupported_Field_Type", fmd.getTypeName(), fmd.getName()));
2616 public Object getValue(QueryExecutionContext context,
String index) {
2617 throw new ClusterJFatalInternalException(local.
message(
"ERR_Implementation_Should_Not_Occur"));
2629 public boolean isPrimitive() {
2653 public String handler() {
2654 return "Virtual Type (field with no columns)";
2680 local.
message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
2689 protected static abstract class ObjectOperationHandlerNotPersistent
implements ObjectOperationHandler {
2691 public boolean isPrimitive() {
2695 public void operationGetValue(AbstractDomainFieldHandlerImpl fmd,
Operation op) {
2699 public Object getDefaultValueFor(AbstractDomainFieldHandlerImpl fmd,
String columnDefaultValue) {
2704 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2705 throw new ClusterJFatalInternalException(local.message(
"ERR_Implementation_Should_Not_Occur"));
2708 public void operationSetValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler, Operation op) {
2709 throw new ClusterJFatalInternalException(local.message(
"ERR_Implementation_Should_Not_Occur"));
2712 public void objectSetValue(AbstractDomainFieldHandlerImpl fmd, ResultData rs, ValueHandler handler) {
2713 throw new ClusterJFatalInternalException(local.message(
"ERR_Implementation_Should_Not_Occur"));
2716 public void operationSetBounds(AbstractDomainFieldHandlerImpl fmd, Object value, IndexScanOperation.BoundType
type, IndexScanOperation op) {
2717 throw new ClusterJFatalInternalException(local.message(
"ERR_Implementation_Should_Not_Occur"));
2720 public void filterCompareValue(AbstractDomainFieldHandlerImpl fmd, Object value,
ScanFilter.BinaryCondition condition,
ScanFilter filter) {
2721 throw new ClusterJFatalInternalException(local.message(
"ERR_Implementation_Should_Not_Occur"));
2724 public void operationEqual(AbstractDomainFieldHandlerImpl fmd, Object value, Operation op) {
2725 throw new ClusterJFatalInternalException(local.message(
"ERR_Implementation_Should_Not_Occur"));
2728 public boolean isValidIndexType(AbstractDomainFieldHandlerImpl fmd,
boolean hashNotOrdered) {
2729 throw new ClusterJFatalInternalException(local.message(
"ERR_Implementation_Should_Not_Occur"));
2732 public void partitionKeySetPart(AbstractDomainFieldHandlerImpl fmd,
2733 PartitionKey partitionKey, ValueHandler keyValueHandler) {
2734 throw new ClusterJFatalInternalException(
2735 local.message(
"ERR_Operation_Not_Supported",
"partitionKeySetPart",
"non-key fields"));
2738 public Object getValue(QueryExecutionContext context,
String index) {
2739 throw new ClusterJFatalInternalException(local.message(
"ERR_Implementation_Should_Not_Occur"));
2744 protected static ObjectOperationHandler objectOperationHandlerNotPersistentByte =
new ObjectOperationHandlerNotPersistent() {
2746 public String handler() {
2747 return "not persistent primitive byte";
2750 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2751 handler.setByte(fmd.fieldNumber, (byte) 0);
2754 protected static ObjectOperationHandler objectOperationHandlerNotPersistentDouble =
new ObjectOperationHandlerNotPersistent() {
2756 public String handler() {
2757 return "not persistent primitive double";
2760 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2761 handler.setDouble(fmd.fieldNumber, 0.0D);
2764 protected static ObjectOperationHandler objectOperationHandlerNotPersistentFloat =
new ObjectOperationHandlerNotPersistent() {
2766 public String handler() {
2767 return "not persistent primitive float";
2770 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2771 handler.setFloat(fmd.fieldNumber, 0.0F);
2774 protected static ObjectOperationHandler objectOperationHandlerNotPersistentInt =
new ObjectOperationHandlerNotPersistent() {
2776 public String handler() {
2777 return "not persistent primitive int";
2780 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2781 handler.setInt(fmd.fieldNumber, 0);
2784 protected static ObjectOperationHandler objectOperationHandlerNotPersistentLong =
new ObjectOperationHandlerNotPersistent() {
2786 public String handler() {
2787 return "not persistent primitive long";
2790 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2791 handler.setLong(fmd.fieldNumber, 0L);
2794 protected static ObjectOperationHandler objectOperationHandlerNotPersistentObject =
new ObjectOperationHandlerNotPersistent() {
2796 public String handler() {
2797 return "not persistent Object";
2801 public boolean isPrimitive() {
2805 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2808 protected static ObjectOperationHandler objectOperationHandlerNotPersistentShort =
new ObjectOperationHandlerNotPersistent() {
2810 public String handler() {
2811 return "not persistent primitive short";
2814 public void objectInitializeJavaDefaultValue(AbstractDomainFieldHandlerImpl fmd, ValueHandler handler) {
2815 handler.setShort(fmd.fieldNumber, (
short) 0);
2822 protected void initializeColumnMetadata(com.mysql.clusterj.core.store.Column
storeColumn) {