|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.value.Value
org.h2.value.ValueLobDb
public class ValueLobDb
An alternate LOB implementation.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.h2.value.Value |
|---|
Value.ValueBlob, Value.ValueClob |
| Field Summary |
|---|
| Fields inherited from class org.h2.value.Value |
|---|
ARRAY, 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 |
| Method Summary | |
|---|---|
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. |
ValueLobDb |
copyToTemp()
Create an independent copy of this temporary value. |
static ValueLobDb |
create(int type,
LobStorage lobStorage,
int tableId,
long id,
long precision)
Create a LOB value. |
static ValueLobDb |
createSmallLob(int type,
byte[] small,
long precision)
Create a small lob using the given byte array. |
static ValueLobDb |
createTempBlob(java.io.InputStream in,
long length,
DataHandler handler)
Create a temporary BLOB value from a stream. |
static ValueLobDb |
createTempClob(java.io.Reader in,
long length,
DataHandler handler)
Create a temporary CLOB value from a stream. |
boolean |
equals(java.lang.Object other)
Check if the two values have the same hash code. |
byte[] |
getBytes()
|
byte[] |
getBytesNoCopy()
|
int |
getDisplaySize()
Get the display size in characters. |
java.io.InputStream |
getInputStream()
|
long |
getLobId()
|
int |
getMemory()
Get the memory used by this object. |
java.lang.Object |
getObject()
Get the value as an object. |
long |
getPrecision()
Get the precision. |
java.io.Reader |
getReader()
|
byte[] |
getSmall()
Get the data if this a small lob value. |
java.lang.String |
getSQL()
Get the SQL expression for this value. |
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. |
int |
getType()
Get the value type. |
int |
hashCode()
|
boolean |
isLinked()
Check if this value is linked to a specific table. |
boolean |
isStored()
|
Value |
link(DataHandler h,
int tabId)
Link a large value to a given table. |
void |
set(java.sql.PreparedStatement prep,
int parameterIndex)
Set the value as a parameter in a prepared statement. |
void |
setPrecision(long precision)
|
java.lang.String |
toString()
|
void |
unlink()
Mark any underlying resource as 'not linked to any table'. |
| Methods inherited from class org.h2.value.Value |
|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static ValueLobDb create(int type,
LobStorage lobStorage,
int tableId,
long id,
long precision)
type - the typelobStorage - the storagetableId - the table idid - the lob idprecision - the precision (number of bytes / characters)
public static ValueLobDb createSmallLob(int type,
byte[] small,
long precision)
type - the type (Value.BLOB or CLOB)small - the byte arrayprecision - the precision
public Value convertTo(int t)
convertTo in class Valuet - the new type
public boolean isLinked()
Value
isLinked in class Valuepublic boolean isStored()
public void close()
Value
close in class Valuepublic void unlink()
Value
unlink in class Value
public Value link(DataHandler h,
int tabId)
Value
link in class Valueh - the data handlertabId - the table to link to
public int getTableId()
getTableId in class Valuepublic int getType()
Value
getType in class Valuepublic long getPrecision()
Value
getPrecision in class Valuepublic java.lang.String getString()
Value
getString in class Valuepublic byte[] getBytes()
getBytes in class Valuepublic byte[] getBytesNoCopy()
getBytesNoCopy in class Valuepublic int hashCode()
hashCode in class Value
protected int compareSecure(Value v,
CompareMode mode)
Value
compareSecure in class Valuev - the other valuemode - the compare mode
public java.lang.Object getObject()
Value
getObject in class Valuepublic java.io.Reader getReader()
getReader in class Valuepublic java.io.InputStream getInputStream()
getInputStream in class Value
public void set(java.sql.PreparedStatement prep,
int parameterIndex)
throws java.sql.SQLException
Value
set in class Valueprep - the prepared statementparameterIndex - the parameter index
java.sql.SQLExceptionpublic java.lang.String getSQL()
Value
getSQL in class Valuepublic java.lang.String getTraceSQL()
Value
getTraceSQL in class Valuepublic byte[] getSmall()
getSmall in class Valuepublic int getDisplaySize()
Value
getDisplaySize in class Valuepublic boolean equals(java.lang.Object other)
Value
equals in class Valueother - the other value
public int getMemory()
Value
getMemory in class Valuepublic ValueLobDb copyToTemp()
copyToTemp in class Valuepublic long getLobId()
public void setPrecision(long precision)
public java.lang.String toString()
toString in class Value
public static ValueLobDb createTempClob(java.io.Reader in,
long length,
DataHandler handler)
in - the readerlength - the number of characters to read, or -1 for no limithandler - the data handler
public static ValueLobDb createTempBlob(java.io.InputStream in,
long length,
DataHandler handler)
in - the input streamlength - the number of characters to read, or -1 for no limithandler - the data handler
public Value convertPrecision(long precision,
boolean force)
Value
convertPrecision in class Valueprecision - the new precisionforce - true if losing numeric precision is allowed
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||