public class ValueLob extends Value
Value.ValueBlob, Value.ValueClobARRAY, BLOB, BOOLEAN, BYTE, BYTES, CLOB, DATE, DECIMAL, DOUBLE, FLOAT, INT, JAVA_OBJECT, LONG, NULL, RESULT_SET, SHORT, STRING, STRING_FIXED, STRING_IGNORECASE, TIME, TIMESTAMP, TYPE_COUNT, UNKNOWN, UUID| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the underlying resource, if any.
|
protected int |
compareSecure(Value v,
CompareMode mode)
Compare the value with another value of the same type.
|
Value |
convertPrecision(long precision,
boolean force)
Convert the precision to the requested value.
|
Value |
convertTo(int t)
Convert a lob to another data type.
|
void |
convertToFileIfRequired(DataHandler h)
Store the lob data to a file if the size of the buffer it larger than the
maximum size for an in-place lob.
|
ValueLob |
copyToTemp()
Create an independent copy of this temporary value.
|
static ValueLob |
createBlob(InputStream in,
long length,
DataHandler handler)
Create a BLOB value from a stream.
|
static ValueLob |
createClob(Reader in,
long length,
DataHandler handler)
Create a CLOB value from a stream.
|
static ValueLob |
createSmallLob(int type,
byte[] small)
Create a small lob using the given byte array.
|
boolean |
equals(Object other)
Check if the two values have the same hash code.
|
byte[] |
getBytes() |
byte[] |
getBytesNoCopy() |
int |
getDisplaySize()
Get the display size in characters.
|
String |
getFileName()
Get the current file name where the lob is saved.
|
InputStream |
getInputStream() |
int |
getMemory()
Get the memory used by this object.
|
Object |
getObject()
Get the value as an object.
|
int |
getObjectId()
Get the current object id of this lob.
|
long |
getPrecision()
Get the precision.
|
Reader |
getReader() |
byte[] |
getSmall()
Get the data if this a small lob value.
|
String |
getSQL()
Get the SQL expression for this value.
|
String |
getString()
Get the value as a string.
|
int |
getTableId()
Get the current table id of this lob.
|
String |
getTraceSQL()
Get a medium size SQL expression for debugging or tracing.
|
int |
getType()
Get the value type.
|
int |
hashCode() |
boolean |
isFileBased()
Check if this value is stored in it's own file.
|
boolean |
isLinked()
Check if this value is linked to a specific table.
|
Value |
link(DataHandler h,
int tabId)
Link a large value to a given table.
|
static ValueLob |
open(int type,
DataHandler handler,
int tableId,
int objectId,
long precision,
boolean compression)
Create a LOB value with the given parameters.
|
static void |
removeAllForTable(DataHandler handler,
int tableId)
Remove all lobs for a given table id.
|
static void |
resetDirCounter()
Reset the directory counter as if the process was stopped.
|
void |
set(PreparedStatement prep,
int parameterIndex)
Set the value as a parameter in a prepared statement.
|
void |
setFileName(String fileName,
boolean linked)
Set the file name of this lob value.
|
void |
unlink()
Mark any underlying resource as 'not linked to any table'.
|
boolean |
useCompression()
Check if this lob value is compressed.
|
add, checkPrecision, clearCache, compareTo, compareTypeSave, convertScale, divide, getBigDecimal, getBoolean, getByte, getDate, getDouble, getFloat, getHigherOrder, getInt, getLong, getResultSet, getScale, getShort, getSignum, getTime, getTimestamp, modulus, multiply, negate, subtract, throwUnsupportedExceptionForType, toStringpublic static ValueLob createSmallLob(int type, byte[] small)
type - the type (Value.BLOB or CLOB)small - the byte arraypublic static ValueLob open(int type, DataHandler handler, int tableId, int objectId, long precision, boolean compression)
type - the data typehandler - the file handlertableId - the table object idobjectId - the object idprecision - the precision (length in elements)compression - if compression is usedpublic static ValueLob createClob(Reader in, long length, DataHandler handler)
in - the readerlength - the number of characters to read, or -1 for no limithandler - the data handlerpublic static void resetDirCounter()
public static ValueLob createBlob(InputStream in, long length, DataHandler handler)
in - the input streamlength - the number of characters to read, or -1 for no limithandler - the data handlerpublic Value convertTo(int t)
public boolean isLinked()
Valuepublic String getFileName()
public void close()
Valuepublic void unlink()
Valuepublic Value link(DataHandler h, int tabId)
Valuepublic int getTableId()
getTableId in class Valuepublic int getObjectId()
public int getType()
Valuepublic long getPrecision()
ValuegetPrecision in class Valuepublic byte[] getBytesNoCopy()
getBytesNoCopy in class Valueprotected int compareSecure(Value v, CompareMode mode)
ValuecompareSecure in class Valuev - the other valuemode - the compare modepublic Object getObject()
Valuepublic InputStream getInputStream()
getInputStream in class Valuepublic void set(PreparedStatement prep, int parameterIndex) throws SQLException
Valueset in class Valueprep - the prepared statementparameterIndex - the parameter indexSQLExceptionpublic String getSQL()
Valuepublic String getTraceSQL()
ValuegetTraceSQL in class Valuepublic byte[] getSmall()
public int getDisplaySize()
ValuegetDisplaySize in class Valuepublic boolean equals(Object other)
Valuepublic void convertToFileIfRequired(DataHandler h)
h - the data handlerpublic static void removeAllForTable(DataHandler handler, int tableId)
handler - the data handlertableId - the table idpublic boolean useCompression()
public boolean isFileBased()
ValueisFileBased in class Valuepublic void setFileName(String fileName, boolean linked)
fileName - the file namelinked - if the lob is linkedpublic int getMemory()
Valuepublic ValueLob copyToTemp()
copyToTemp in class Valuepublic Value convertPrecision(long precision, boolean force)
ValueconvertPrecision in class Valueprecision - the new precisionforce - true if losing numeric precision is allowedCopyright © 2012 JBoss by Red Hat. All Rights Reserved.