org.axiondb.types
Class LOBType

java.lang.Object
  extended by org.axiondb.types.BaseDataType
      extended by org.axiondb.types.LOBType
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator, DataType, DataTypeFactory
Direct Known Subclasses:
BLOBType, CLOBType, CompressedLOBType

public class LOBType
extends BaseDataType

A DataTyperepresenting a Large Object (LOB), for example a Clobor Blob.

Version:
$Revision: 1.17 $ $Date: 2005/05/02 22:29:40 $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.axiondb.DataType
DataType.BinaryRepresentation, DataType.ExactNumeric, DataType.NonFixedPrecision
 
Constructor Summary
LOBType()
           
 
Method Summary
 boolean accepts(java.lang.Object value)
          Return true if a field of my type can be assigned the given non- null value , false otherwise.
 java.lang.Object convert(java.lang.Object value)
          Converts an acceptablevalue to one of the appropriate type.
 int getColumnDisplaySize()
          Value returned by ResultSetMetaData#getColumnDisplaySizefor this data type.
 int getJdbcType()
          Returns the JDBC type codemost closely matching this type.
 java.io.File getLobDir()
           
protected  BufferedDataInputStream 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()
          Creates a new instance of this DataType implementation.
 java.lang.Object read(java.io.DataInput in)
          Instantiate an object of my type from the given DataInput.
 void setLobDir(java.io.File lobDir)
           
 java.sql.Blob toBlob(java.lang.Object value)
          Convert the given non- null value to a Blob, or throw a AxionException.
 java.sql.Clob toClob(java.lang.Object value)
          Convert the given non- null value to a Clob, or throw a AxionException.
 java.lang.String toString()
           
 java.lang.String toString(java.lang.Object value)
          Convert the given non- null value to a String, or throw a AxionException.
 void write(java.lang.Object value, java.io.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, getComparator, getLiteralPrefix, getLiteralSuffix, getNullableCode, getPrecision, getPrecisionRadix, 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
See Also:
DatabaseMetaData.getTypeInfo(), ResultSetMetaData.isCaseSensitive(int)

accepts

public boolean accepts(java.lang.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
Parameters:
value - non- null value

getColumnDisplaySize

public int getColumnDisplaySize()
Description copied from interface: DataType
Value returned by ResultSetMetaData#getColumnDisplaySizefor this data type.

Specified by:
getColumnDisplaySize in interface DataType
Overrides:
getColumnDisplaySize in class BaseDataType
See Also:
ResultSetMetaData.getColumnDisplaySize(int)

convert

public java.lang.Object convert(java.lang.Object value)
                         throws java.lang.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:
java.lang.IllegalArgumentException

toBlob

public java.sql.Blob toBlob(java.lang.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
See Also:
ResultSet.getBlob(int)

toClob

public java.sql.Clob toClob(java.lang.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
See Also:
ResultSet.getClob(int)

toString

public java.lang.String toString(java.lang.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
See Also:
ResultSet.getString(int)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

makeNewInstance

public DataType makeNewInstance()
Description copied from interface: DataType
Creates a new instance of this DataType implementation.

Specified by:
makeNewInstance in interface DataType
Specified by:
makeNewInstance in interface DataTypeFactory
Specified by:
makeNewInstance in class BaseDataType
Returns:
new instance of this DataType implementation.

read

public java.lang.Object read(java.io.DataInput in)
                      throws java.io.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:
java.io.IOException

write

public void write(java.lang.Object value,
                  java.io.DataOutput out)
           throws java.io.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
Parameters:
value - the value to write, which must be acceptableto this DataType
Throws:
java.io.IOException

getLobDir

public java.io.File getLobDir()

setLobDir

public void setLobDir(java.io.File lobDir)
               throws AxionException
Throws:
AxionException

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
See Also:
DatabaseMetaData.getTypeInfo()

getLobFile

protected BufferedDataInputStream getLobFile()

writeStringClob

protected LobLocator writeStringClob(StringClob value)
                              throws java.io.IOException
Throws:
java.io.IOException

writeByteArrayBlob

protected LobLocator writeByteArrayBlob(ByteArrayBlob value)
                                 throws java.io.IOException
Throws:
java.io.IOException

makeBlobSource

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

makeClobSource

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