Ejemplo n.º 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());
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
  }
Ejemplo n.º 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;
   }
 }
Ejemplo n.º 5
0
 public Double getObjectDouble(Column storeColumn) {
   int index = storeColumn.getColumnId();
   NdbRecAttr ndbRecAttr = ndbRecAttrs[index];
   return (ndbRecAttr.isNULL() == 1) ? null : getDouble(storeColumn);
 }
Ejemplo n.º 6
0
 public Float getObjectFloat(Column storeColumn) {
   int index = storeColumn.getColumnId();
   NdbRecAttr ndbRecAttr = ndbRecAttrs[index];
   return (ndbRecAttr.isNULL() == 1) ? null : getFloat(storeColumn);
 }
Ejemplo n.º 7
0
 public Integer getObjectInteger(Column storeColumn) {
   int index = storeColumn.getColumnId();
   NdbRecAttr ndbRecAttr = ndbRecAttrs[index];
   return (ndbRecAttr.isNULL() == 1) ? null : Utility.getInt(storeColumn, ndbRecAttr);
 }
Ejemplo n.º 8
0
 public long getLong(Column storeColumn) {
   int index = storeColumn.getColumnId();
   NdbRecAttr ndbRecAttr = ndbRecAttrs[index];
   return Utility.getLong(storeColumn, ndbRecAttr.int64_value());
 }