org.axiondb.types
Class LOBType

java.lang.Object
  extended byorg.axiondb.types.BaseDataType
      extended byorg.axiondb.types.LOBType
All Implemented Interfaces:
Comparator, DataType, DataTypeFactory, Serializable
Direct Known Subclasses:
CompressedLOBType

public class LOBType
extends BaseDataType

A DataType representing a Large Object (LOB), for example a Clob or Blob.

Version:
$Revision: 1.12 $ $Date: 2004/09/09 23:47:42 $
See Also:
Serialized Form

Constructor Summary
LOBType()
           
 
Method Summary
 boolean accepts(Object value)
          Return true if a field of my type can be assigned the given non- null value , false otherwise.
 Object convert(Object value)
          Converts an acceptablevalue to one of the appropriate type.
 int getJdbcType()
          Returns the JDBC type codemost closely matching this type.
 File getLobDir()
           
protected  RandomAccessFile getLobFile()
           
 short getSearchableCode()
          Code indicating how much WHERE ...
 boolean isCaseSensitive()
          For character and string-related types, indicates whether type acknowledges case when storing and retrieving values
protected  BlobSource makeBlobSource(LobLocator loc)
           
protected  ClobSource makeClobSource(LobLocator loc)
           
 DataType makeNewInstance()
           
 Object read(DataInput in)
          Instantiate an object of my type from the given DataInput.
 void setLobDir(File lobDir)
           
 Blob toBlob(Object value)
          Convert the given non- null value to a Blob, or throw a AxionException.
 Clob toClob(Object value)
          Convert the given non- null value to a Clob, or throw a AxionException.
 String toString()
           
 String toString(Object value)
          Convert the given non- null value to a String, or throw a AxionException.
 void write(Object value, DataOutput out)
          Write an object of my type to the given DataOutput.
protected  LobLocator writeByteArrayBlob(ByteArrayBlob value)
           
protected  LobLocator writeStringClob(StringClob value)
           
 
Methods inherited from class org.axiondb.types.BaseDataType
compare, getColumnDisplaySize, getComparator, getLiteralPrefix, getLiteralSuffix, getNullableCode, getPrecision, getPreferredValueClassName, getScale, isCurrency, isUnsigned, successor, supportsSuccessor, toBigDecimal, toBigInteger, toBoolean, toByte, toByteArray, toDate, toDouble, toFloat, toInt, toLong, toNumber, toShort, toTime, toTimestamp, toURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

LOBType

public LOBType()
Method Detail

getJdbcType

public int getJdbcType()
Description copied from interface: DataType
Returns the JDBC type codemost closely matching this type.

Specified by:
getJdbcType in interface DataType
Specified by:
getJdbcType in class BaseDataType

isCaseSensitive

public boolean isCaseSensitive()
Description copied from interface: DataType
For character and string-related types, indicates whether type acknowledges case when storing and retrieving values

Specified by:
isCaseSensitive in interface DataType
Overrides:
isCaseSensitive in class BaseDataType

accepts

public boolean accepts(Object value)
Description copied from interface: DataType
Return true if a field of my type can be assigned the given non- null value , false otherwise.

Specified by:
accepts in interface DataType
Specified by:
accepts in class BaseDataType

convert

public Object convert(Object value)
               throws IllegalArgumentException
Description copied from interface: DataType
Converts an acceptablevalue to one of the appropriate type.

Specified by:
convert in interface DataType
Specified by:
convert in class BaseDataType
Throws:
IllegalArgumentException

toBlob

public Blob toBlob(Object value)
            throws AxionException
Description copied from interface: DataType
Convert the given non- null value to a Blob, or throw a AxionException.

Specified by:
toBlob in interface DataType
Overrides:
toBlob in class BaseDataType
Throws:
AxionException

toClob

public Clob toClob(Object value)
            throws AxionException
Description copied from interface: DataType
Convert the given non- null value to a Clob, or throw a AxionException.

Specified by:
toClob in interface DataType
Overrides:
toClob in class BaseDataType
Throws:
AxionException

toString

public String toString(Object value)
                throws AxionException
Description copied from interface: DataType
Convert the given non- null value to a String, or throw a AxionException.

Specified by:
toString in interface DataType
Overrides:
toString in class BaseDataType
Throws:
AxionException

toString

public String toString()

makeNewInstance

public DataType makeNewInstance()
Specified by:
makeNewInstance in interface DataTypeFactory
Specified by:
makeNewInstance in class BaseDataType

read

public Object read(DataInput in)
            throws IOException
Description copied from interface: DataType
Instantiate an object of my type from the given DataInput. The next sequence of bytes to be read from the DataInput will have been written by DataType.write(java.lang.Object, java.io.DataOutput).

Specified by:
read in interface DataType
Specified by:
read in class BaseDataType
Throws:
IOException

write

public void write(Object value,
                  DataOutput out)
           throws IOException
Description copied from interface: DataType
Write an object of my type to the given DataOutput.

Specified by:
write in interface DataType
Specified by:
write in class BaseDataType
Throws:
IOException

getLobDir

public File getLobDir()

setLobDir

public void setLobDir(File lobDir)

getSearchableCode

public short getSearchableCode()
Description copied from interface: DataType
Code indicating how much WHERE ... LIKE support is available across a column of this type

Specified by:
getSearchableCode in interface DataType
Overrides:
getSearchableCode in class BaseDataType

getLobFile

protected RandomAccessFile getLobFile()

writeStringClob

protected LobLocator writeStringClob(StringClob value)
                              throws IOException
Throws:
IOException

writeByteArrayBlob

protected LobLocator writeByteArrayBlob(ByteArrayBlob value)
                                 throws IOException
Throws:
IOException

makeBlobSource

protected BlobSource makeBlobSource(LobLocator loc)
                             throws AxionException
Throws:
AxionException

makeClobSource

protected ClobSource makeClobSource(LobLocator loc)
                             throws AxionException
Throws:
AxionException