public class ValueLob extends Value
ARRAY, BLOB, BOOLEAN, BYTE, BYTES, CLOB, DATE, DECIMAL, DOUBLE, ENUM, FLOAT, GEOMETRY, INT, INTERVAL_DAY, INTERVAL_DAY_TO_HOUR, INTERVAL_DAY_TO_MINUTE, INTERVAL_DAY_TO_SECOND, INTERVAL_HOUR, INTERVAL_HOUR_TO_MINUTE, INTERVAL_HOUR_TO_SECOND, INTERVAL_MINUTE, INTERVAL_MINUTE_TO_SECOND, INTERVAL_MONTH, INTERVAL_SECOND, INTERVAL_YEAR, INTERVAL_YEAR_TO_MONTH, JAVA_OBJECT, JSON, LONG, MIN_LONG_DECIMAL, NULL, RESULT_SET, ROW, SHORT, STRING, STRING_FIXED, STRING_IGNORECASE, TIME, TIME_TZ, TIMESTAMP, TIMESTAMP_TZ, TYPE_COUNT, UNKNOWN, UUIDDUMMY| Modifier and Type | Method and Description |
|---|---|
int |
compareTypeSafe(Value v,
CompareMode mode,
CastDataProvider provider)
Compare this value against another value given that the values are of the
same data type.
|
Value |
convertPrecision(long precision)
Convert the precision to the requested value.
|
protected Value |
convertTo(int targetType,
ExtTypeInfo extTypeInfo,
CastDataProvider provider,
boolean forComparison,
java.lang.Object column)
Convert a lob to another data type.
|
Value |
copy(DataHandler h,
int tabId)
Copy a large value, to be used in the given table.
|
ValueLobDb |
copyToTemp()
Create an independent copy of this temporary value.
|
boolean |
equals(java.lang.Object other)
Check if the two values have the same hash code.
|
byte[] |
getBytes() |
byte[] |
getBytesNoCopy() |
java.lang.String |
getFileName()
Get the current file name where the lob is saved.
|
java.io.InputStream |
getInputStream() |
java.io.InputStream |
getInputStream(long oneBasedOffset,
long length)
Get the input stream
|
int |
getMemory()
Get the memory used by this object.
|
java.lang.Object |
getObject()
Get the value as an object.
|
int |
getObjectId()
Get the current object id of this lob.
|
java.io.Reader |
getReader() |
java.io.Reader |
getReader(long oneBasedOffset,
long length)
Get the reader
|
byte[] |
getSmall()
Get the data if this a small lob value.
|
java.lang.StringBuilder |
getSQL(java.lang.StringBuilder builder)
Appends the SQL expression for this value to the specified builder.
|
java.lang.String |
getString()
Get the value as a string.
|
int |
getTableId()
Get the current table id of this lob.
|
java.lang.String |
getTraceSQL()
Get a medium size SQL expression for debugging or tracing.
|
TypeInfo |
getType()
Returns the data type.
|
int |
getValueType()
Get the value type.
|
int |
hashCode() |
boolean |
isCompressed()
Check if this lob value is compressed.
|
boolean |
isLinkedToTable()
Check if this value is linked to a specific table.
|
static ValueLob |
openLinked(int type,
DataHandler handler,
int tableId,
int objectId,
long precision,
boolean compression)
Create a LOB value with the given parameters.
|
static ValueLob |
openUnlinked(int type,
DataHandler handler,
int tableId,
int objectId,
long precision,
boolean compression,
java.lang.String fileName)
Create a LOB value with the given parameters.
|
void |
remove()
Remove the underlying resource, if any.
|
void |
set(java.sql.PreparedStatement prep,
int parameterIndex)
Set the value as a parameter in a prepared statement.
|
add, checkPrecision, clearCache, compareTo, compareWithNull, containsNull, convertScale, convertTo, convertTo, convertTo, convertToInt, copyToResult, divide, getBigDecimal, getBoolean, getByte, getDataHandler, getDate, getDouble, getFloat, getHigherOrder, getHigherType, getInt, getLong, getResult, getShort, getSignum, getSQL, getTime, getTimestamp, getUnsupportedExceptionForOperation, modulus, multiply, negate, subtract, toStringgetCommittedValue, getCurrentValue, getOperationId, isCommittedpublic static ValueLob openLinked(int type, DataHandler handler, int tableId, int objectId, long precision, boolean compression)
type - the data type, either Value.BLOB or Value.CLOBhandler - the file handlertableId - the table object idobjectId - the object idprecision - the precision (length in elements)compression - if compression is usedpublic static ValueLob openUnlinked(int type, DataHandler handler, int tableId, int objectId, long precision, boolean compression, java.lang.String fileName)
type - the data type, either Value.BLOB or Value.CLOBhandler - the file handlertableId - the table object idobjectId - the object idprecision - the precision (length in elements)compression - if compression is usedfileName - the file nameprotected Value convertTo(int targetType, ExtTypeInfo extTypeInfo, CastDataProvider provider, boolean forComparison, java.lang.Object column)
convertTo in class ValuetargetType - the new typeextTypeInfo - the extended data type information, or nullprovider - the cast information providerforComparison - if true, perform cast for comparison operationcolumn - the column (if any), used for to improve the error message if conversion failspublic boolean isLinkedToTable()
ValueisLinkedToTable in class Valuepublic java.lang.String getFileName()
public void remove()
Valuepublic Value copy(DataHandler h, int tabId)
Valuepublic int getTableId()
getTableId in class Valuepublic int getObjectId()
public int getValueType()
ValuegetValueType in class Valuepublic java.lang.String getString()
Valuepublic byte[] getBytesNoCopy()
getBytesNoCopy in class Valuepublic int compareTypeSafe(Value v, CompareMode mode, CastDataProvider provider)
ValuecompareTypeSafe in class Valuev - the other valuemode - the compare modeprovider - the cast information providerpublic java.lang.Object getObject()
Valuepublic java.io.Reader getReader(long oneBasedOffset,
long length)
Valuepublic java.io.InputStream getInputStream()
getInputStream in class Valuepublic java.io.InputStream getInputStream(long oneBasedOffset,
long length)
ValuegetInputStream in class ValueoneBasedOffset - the offset (1 means no offset)length - the requested lengthpublic void set(java.sql.PreparedStatement prep,
int parameterIndex)
throws java.sql.SQLException
Valuepublic java.lang.StringBuilder getSQL(java.lang.StringBuilder builder)
Valuepublic java.lang.String getTraceSQL()
ValuegetTraceSQL in class Valuepublic byte[] getSmall()
public boolean equals(java.lang.Object other)
Valuepublic boolean isCompressed()
public int getMemory()
Valuepublic ValueLobDb copyToTemp()
copyToTemp in class Valuepublic Value convertPrecision(long precision)
ValueconvertPrecision in class Valueprecision - the new precision