Beispiel #1
0
 public Long getObjectLong(Column storeColumn) {
   int index = storeColumn.getColumnId();
   NdbRecAttr ndbRecAttr = ndbRecAttrs[index];
   return (ndbRecAttr.isNULL() == 1)
       ? null
       : Utility.getLong(storeColumn, ndbRecAttr.int64_value());
 }
Beispiel #2
0
 public byte[] getBytes(Column storeColumn) {
   int index = storeColumn.getColumnId();
   NdbRecAttr ndbRecAttr = ndbRecAttrs[index];
   if (ndbRecAttr.isNULL() == 1) return null;
   int prefixLength = storeColumn.getPrefixLength();
   int actualLength = lengths[index];
   int offset = offsets[index];
   switch (prefixLength) {
     case 0:
       break;
     case 1:
       actualLength = (byteBuffer.get(offset) + 256) % 256;
       offset += 1;
       break;
     case 2:
       actualLength = (byteBuffer.get(offset) + 256) % 256;
       int length2 = (byteBuffer.get(offset + 1) + 256) % 256;
       actualLength += 256 * length2;
       offset += 2;
       break;
     default:
       throw new ClusterJFatalInternalException(
           local.message("ERR_Invalid_Prefix_Length", prefixLength));
   }
   byteBuffer.position(offset);
   byte[] result = new byte[actualLength];
   byteBuffer.get(result);
   return result;
 }
Beispiel #3
0
  public String getString(Column storeColumn) {
    int index = storeColumn.getColumnId();
    NdbRecAttr ndbRecAttr = ndbRecAttrs[index];
    if (ndbRecAttr.isNULL() == 1) return null;
    int prefixLength = storeColumn.getPrefixLength();
    int actualLength;
    int offset = offsets[index];
    byteBuffer.limit(byteBuffer.capacity());
    switch (prefixLength) {
      case 0:
        actualLength = lengths[index];
        break;
      case 1:
        actualLength = (byteBuffer.get(offset) + 256) % 256;
        offset += 1;
        break;
      case 2:
        actualLength = (byteBuffer.get(offset) + 256) % 256;
        int length2 = (byteBuffer.get(offset + 1) + 256) % 256;
        actualLength += 256 * length2;
        offset += 2;
        break;
      default:
        throw new ClusterJFatalInternalException(
            local.message("ERR_Invalid_Prefix_Length", prefixLength));
    }

    byteBuffer.position(offset);
    byteBuffer.limit(offset + actualLength);

    String result = Utility.decode(byteBuffer, storeColumn.getCharsetNumber(), bufferManager);
    byteBuffer.clear();
    return result;
  }
Beispiel #4
0
 public Boolean getObjectBoolean(Column storeColumn) {
   int index = storeColumn.getColumnId();
   NdbRecAttr ndbRecAttr = ndbRecAttrs[index];
   if (ndbRecAttr.isNULL() == 1) {
     return null;
   } else {
     byte value = ndbRecAttr.int8_value();
     Boolean result = (Boolean.valueOf((value & 0x01) == 0x01));
     return result;
   }
 }
Beispiel #5
0
 public Double getObjectDouble(Column storeColumn) {
   int index = storeColumn.getColumnId();
   NdbRecAttr ndbRecAttr = ndbRecAttrs[index];
   return (ndbRecAttr.isNULL() == 1) ? null : getDouble(storeColumn);
 }
Beispiel #6
0
 public Float getObjectFloat(Column storeColumn) {
   int index = storeColumn.getColumnId();
   NdbRecAttr ndbRecAttr = ndbRecAttrs[index];
   return (ndbRecAttr.isNULL() == 1) ? null : getFloat(storeColumn);
 }
Beispiel #7
0
 public Integer getObjectInteger(Column storeColumn) {
   int index = storeColumn.getColumnId();
   NdbRecAttr ndbRecAttr = ndbRecAttrs[index];
   return (ndbRecAttr.isNULL() == 1) ? null : Utility.getInt(storeColumn, ndbRecAttr);
 }
Beispiel #8
0
 public long getLong(Column storeColumn) {
   int index = storeColumn.getColumnId();
   NdbRecAttr ndbRecAttr = ndbRecAttrs[index];
   return Utility.getLong(storeColumn, ndbRecAttr.int64_value());
 }