public final boolean isNull(int index) { return getType(index) < 0; }
public final int setNotNull(int index) { int snappyType = getType(index); if (snappyType < 0) { snappyType = -snappyType; setType(index, snappyType); } return snappyType; }
public final void setNull(int index) { int snappyType = getType(index); if (snappyType > 0) { setType(index, -snappyType); } }
if (index != 0) sb.append(','); final int snappyType = getType(index); sb.append("TYPE=").append(SnappyType.findByValue(Math.abs(snappyType))) .append(" VALUE=");
public final void setObject(int index, Object value, SnappyType type) { if (value != null) { this.nonPrimitives[(int)this.primitives[headerSize + index]] = value; // we force change the type below for non-primitives which will work // fine since conversions will be changed on server if (getType(index) != type.getValue()) { setType(index, type.getValue()); } } else { setNull(index, type.getValue()); } }
public final void initializeLobs(LobService lobService) throws SQLException { if (!hasLobs || nonPrimitives == null) return; final Object[] nonPrimitives = this.nonPrimitives; final long[] primitives = this.primitives; final int headerSize = this.headerSize; final int size = primitives.length - headerSize; for (int index = 0; index < size; index++) { final int type = getType(index); if (type == SnappyType.BLOB.getValue()) { final int lobIndex = (int)primitives[headerSize + index]; if (nonPrimitives[lobIndex] instanceof BlobChunk) { BlobChunk chunk = (BlobChunk)nonPrimitives[lobIndex]; nonPrimitives[lobIndex] = lobService.createBlob(chunk, false); } } else if (type == SnappyType.CLOB.getValue()) { final int lobIndex = (int)primitives[headerSize + index]; if (nonPrimitives[lobIndex] instanceof ClobChunk) { ClobChunk chunk = (ClobChunk)nonPrimitives[lobIndex]; nonPrimitives[lobIndex] = lobService.createClob(chunk, false); } } } }
final int snappyType = getType(index);