Oracle ADF Business Components Domains API Reference 10.1.2 B14023-02


oracle.jbo.domain
Class ClobDomain

java.lang.Object
  extended byoracle.jbo.domain.BaseLobDomain
      extended byoracle.jbo.domain.ClobDomain

All Implemented Interfaces:
java.io.Serializable

public class ClobDomain
extends BaseLobDomain
implements java.io.Serializable

This class provides a lightweight wrapper for oracle.sql.Clob, the Java representation of the CLOB database type. This wrapper allows an instance of the oracle.sql.Clob to be used as a domain object.

Since:
JDeveloper 3.0
See Also:
Serialized Form

Constructor Summary
ClobDomain()
Constructor for this class.
ClobDomain(byte[] data)
Deprecated. since 9.0.3.5. Use ClobDomain(char[] data) Constructor instead.
ClobDomain(char[] data)
Constructs an instance of this class, given a char array.
ClobDomain(CLOB clob, byte[] clobData)
Deprecated. since 9.0.3.5. Use ClobDomain(CLOB clob, char[] clobData) Constructor instead.
ClobDomain(CLOB clob, char[] clobData)
Internal: Applications should not use this constructor.
ClobDomain(java.lang.String str)
Constructs an instance of this class, given a string.

Method Summary
void closeCharacterOutputStream()
void closeCharacterStream()
Close the Clob contents as a Unicode reader.
void closeOutputStream()
static CLOB createEmptyCLOB(java.lang.Object context)
Creates an empty CLOB object.
boolean equals(java.lang.Object obj)
Converts all the data into a String and compares the two strings.
java.io.OutputStream getAsciiOutputStream()
Deprecated. since 9.0.3.5. Use getCharacterOutputStream() instead.
java.io.InputStream getAsciiStream()
Gets the CLOB value designated by this Clob object as a stream of Ascii bytes.
int getBufferSize()
Get ideal LOB db access buffer size.
java.io.Writer getCharacterOutputStream()
Returns a Writer for Unicode stream to the CLOB that uses the default character encoding.
java.io.Writer getCharacterOutputStream(java.lang.String enc)
Deprecated. since 9.0.3.5. Use getCharacterOutputStream() instead.
java.io.Reader getCharacterStream()
Gets the Clob contents as a Unicode reader.
java.io.Reader getCharacterStream(java.lang.String enc)
Deprecated. since 9.0.3.5. Use getCharacterStream() instead.
java.lang.Object getData()
Internal: Applications should not use this method.
java.io.InputStream getInputStream()
Deprecated. since 9.0.3.5. Use getCharacterStream() instead.
long getLength()
Returns the number of characters in the CLOB value designated by this Clob object.
java.io.OutputStream getOutputStream()
Deprecated. since 9.0.3.5. Use getCharacterOutputStream() instead.
byte[] getStorageByteArray()
Deprecated. since 9.0.3.5. Use getStorageCharArray() instead.
byte[] getStorageByteArray(java.lang.String enc)
Deprecated. since 9.0.3.5. Use getStorageCharArray() instead.
char[] getStorageCharArray()
Converts this CLOB contents into a char array.
java.lang.String getSubString(long offset, int length)
Returns a copy of the specified substring in the CLOB value designated by this Clob object.
static XMLDomainFactory getXMLDomainFactory(java.lang.Class attrClass)
Internal: Applications should not use this method.
ResponseValues marshal()
Internal: Applications should not use this method.
void prepareForDML(java.lang.Object context)
Internal: Applications should not use this method.
protected void resetCachedData()
void saveToDatabase(Transaction xAct)
Internal: Applications should not use this method.
void saveToDatabase(Transaction xAct, java.lang.Object emptySQLObject)
Internal: Applications should not use this method.
void setBytes(byte[] clobData)
Deprecated. since 9.0.3.5. Use setChars(char[] clobData) instead.
void setChars(char[] clobData)
Sets the Clob data for this object.
void syncClientLob(LobInterface oldObj)
Internal: Applications should not use this function.
void syncServerLob(LobInterface oldObj)
Internal: Applications should not use this function.
char[] toCharArray()
Converts this cLOB contents into a char array.
Datum toDatum(OracleConnection c)
java.lang.String toString()
Converts this ClobDomain object to a string.
void useCLOB(CLOB newClob)
Internal: Applications should not use this method.

Methods inherited from class oracle.jbo.domain.BaseLobDomain
closeInputStream, getInvokeDomainMethod, getOwner, getOwnerAttributeIndex, getOwnerRow, getRemoteBufferSize, getRemoteIdString, getRemoteLength, getSize, isCacheDataModified, loadFromDatabase, setContext, toByteArray, toDatum

Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ClobDomain

public ClobDomain()
Constructor for this class.

ClobDomain

public ClobDomain(java.lang.String str)
Constructs an instance of this class, given a string.

ClobDomain

public ClobDomain(byte[] data)
Deprecated. since 9.0.3.5. Use ClobDomain(char[] data) Constructor instead.
Constructs an instance of this class, given a byte array.

ClobDomain

public ClobDomain(char[] data)
Constructs an instance of this class, given a char array.

ClobDomain

public ClobDomain(CLOB clob,
                  byte[] clobData)
Deprecated. since 9.0.3.5. Use ClobDomain(CLOB clob, char[] clobData) Constructor instead.
Internal: Applications should not use this constructor.

Creates an instance of this class with data as described in clobData and using the transaction context from clob to use the CLOB locator in the database.

Parameters:
clob - name of the CLOB to use as a ClobDomain.
clobData - data to fill the CLOB.

ClobDomain

public ClobDomain(CLOB clob,
                  char[] clobData)
Internal: Applications should not use this constructor.

Creates an instance of this class with char data as described in clobData and using the transaction context from clob to use the CLOB locator in the database.

Parameters:
clob - name of the CLOB to use as a ClobDomain.
clobData - data to fill the CLOB.

Method Detail

useCLOB

public void useCLOB(CLOB newClob)
Internal: Applications should not use this method.

If this object does not have a transaction context, shares the transaction and CLOB locator from newClob.

Parameters:
newClob - name of the CLOB with which this CLOB will share its transaction and CLOB locator information.

marshal

public ResponseValues marshal()
Internal: Applications should not use this method.
Overrides:
marshal in class BaseLobDomain

prepareForDML

public void prepareForDML(java.lang.Object context)
Internal: Applications should not use this method.

toDatum

public Datum toDatum(OracleConnection c)
              throws java.sql.SQLException
Overrides:
toDatum in class BaseLobDomain
Throws:
java.sql.SQLException

saveToDatabase

public void saveToDatabase(Transaction xAct)
                    throws java.sql.SQLException
Internal: Applications should not use this method.

Uses the given transaction context to store data back into the database using the blob-locator which should be set before this method is invoked.

Overrides:
saveToDatabase in class BaseLobDomain
Parameters:
xAct - name of the transaction context.
Throws:
java.sql.SQLException

saveToDatabase

public void saveToDatabase(Transaction xAct,
                           java.lang.Object emptySQLObject)
                    throws java.sql.SQLException
Internal: Applications should not use this method.

Uses the given transaction context to store data back into the database using the blob-locator which should be set before this method is invoked.

Overrides:
saveToDatabase in class BaseLobDomain
Throws:
java.sql.SQLException

equals

public boolean equals(java.lang.Object obj)
Converts all the data into a String and compares the two strings. This is a default implementation of equals which could be overridden to perform more scalable application-specific comparision.
Overrides:
equals in class BaseLobDomain
Parameters:
obj - the object to compare to this ClobDomain.

getXMLDomainFactory

public static XMLDomainFactory getXMLDomainFactory(java.lang.Class attrClass)
Internal: Applications should not use this method.

createEmptyCLOB

public static CLOB createEmptyCLOB(java.lang.Object context)
Creates an empty CLOB object.
Parameters:
context - an internal framework context.

getSubString

public java.lang.String getSubString(long offset,
                                     int length)
Returns a copy of the specified substring in the CLOB value designated by this Clob object. The substring begins at position offset and has up to length consecutive characters.
Parameters:
offset - the first character of the substring to be extracted. The first character is at position 0.
length - the number of consecutive characters to be copied
Returns:
a String that is the specified substring in the CLOB value designated by this Clob object
Throws:
java.sql.SQLException - if there is an error accessing the CLOB

getAsciiOutputStream

public java.io.OutputStream getAsciiOutputStream()
Deprecated. since 9.0.3.5. Use getCharacterOutputStream() instead.
get ascii OutputStream of the CLOB.
Returns:
a ascii output stream.

getInputStream

public java.io.InputStream getInputStream()
Deprecated. since 9.0.3.5. Use getCharacterStream() instead.
Gets the CLOB value designated by this Clob object as a stream of Ascii bytes.
Overrides:
getInputStream in class BaseLobDomain
Returns:
an InputStream containing the CLOB data CLOB value

getAsciiStream

public java.io.InputStream getAsciiStream()
Gets the CLOB value designated by this Clob object as a stream of Ascii bytes.
Returns:
an ascii stream containing the CLOB data CLOB value

resetCachedData

protected void resetCachedData()
Overrides:
resetCachedData in class BaseLobDomain

getStorageCharArray

public char[] getStorageCharArray()
Converts this CLOB contents into a char array.
Returns:
a Char array containing the contents of the CLOB.

getStorageByteArray

public byte[] getStorageByteArray()
Deprecated. since 9.0.3.5. Use getStorageCharArray() instead.
Overrides:
getStorageByteArray in class BaseLobDomain

getStorageByteArray

public byte[] getStorageByteArray(java.lang.String enc)
Deprecated. since 9.0.3.5. Use getStorageCharArray() instead.

getOutputStream

public java.io.OutputStream getOutputStream()
Deprecated. since 9.0.3.5. Use getCharacterOutputStream() instead.
get OutputStream of the Domain.
Overrides:
getOutputStream in class BaseLobDomain
Returns:
an outputStream.

getCharacterOutputStream

public java.io.Writer getCharacterOutputStream()
Returns a Writer for Unicode stream to the CLOB that uses the default character encoding.
Returns:
a Unicode character writer.

getCharacterOutputStream

public java.io.Writer getCharacterOutputStream(java.lang.String enc)
Deprecated. since 9.0.3.5. Use getCharacterOutputStream() instead.
Returns a Writer for Unicode stream to the CLOB that uses the named character encoding
Returns:
a Unicode character writer.

closeCharacterStream

public void closeCharacterStream()
Close the Clob contents as a Unicode reader. CLOB
Overrides:
closeCharacterStream in class BaseLobDomain

getCharacterStream

public java.io.Reader getCharacterStream()
Gets the Clob contents as a Unicode reader.
Overrides:
getCharacterStream in class BaseLobDomain
Returns:
a Unicode reader containing the CLOB data
Throws:
java.sql.SQLException - if there is an error accessing the CLOB

getCharacterStream

public java.io.Reader getCharacterStream(java.lang.String enc)
Deprecated. since 9.0.3.5. Use getCharacterStream() instead.
Gets the Clob contents as a Unicode stream that uses the named character encoding.
Returns:
a Unicode stream containing the CLOB data
Throws:
java.sql.SQLException - if there is an error accessing the CLOB

setBytes

public void setBytes(byte[] clobData)
Deprecated. since 9.0.3.5. Use setChars(char[] clobData) instead.
Sets the Clob data for this object. On the client side, if there's a context available with this object, the bytes are streamed to the middle-tier object right-away. However if there's no context object, it's assumed that there will be a setAttribute call invoked on a containing row with this object as argument to stream the bytes via piggy-back.
Overrides:
setBytes in class BaseLobDomain
Parameters:
clobData - data to fill the Blob.

setChars

public void setChars(char[] clobData)
Sets the Clob data for this object. On the client side, if there's a context available with this object, the bytes are streamed to the middle-tier object right-away. However if there's no context object, it's assumed that there will be a setAttribute call invoked on a containing row with this object as argument to stream the bytes via piggy-back.
Parameters:
clobData - data to fill the Blob.

syncClientLob

public void syncClientLob(LobInterface oldObj)
Internal: Applications should not use this function.
Overrides:
syncClientLob in class BaseLobDomain

syncServerLob

public void syncServerLob(LobInterface oldObj)
Internal: Applications should not use this function.
Overrides:
syncServerLob in class BaseLobDomain

toString

public java.lang.String toString()
Converts this ClobDomain object to a string.
Overrides:
toString in class BaseLobDomain
Returns:
this ClobDomain as a string.

getData

public java.lang.Object getData()
Internal: Applications should not use this method.
Overrides:
getData in class BaseLobDomain

toCharArray

public char[] toCharArray()
Converts this cLOB contents into a char array.
Returns:
a char array containing the contents of the BLOB.

getLength

public long getLength()
Returns the number of characters in the CLOB value designated by this Clob object.
Returns:
length of the CLOB in characters

getBufferSize

public int getBufferSize()
Get ideal LOB db access buffer size.
Returns:
the size in terms of characters.

closeOutputStream

public void closeOutputStream()
Overrides:
closeOutputStream in class BaseLobDomain

closeCharacterOutputStream

public void closeCharacterOutputStream()

Oracle ADF Business Components Domains API Reference 10.1.2 B14023-02


Copyright © 1997, 2005, Oracle. All rights reserved.