Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.4.0)

E10653-05

oracle.jbo.domain
Class BlobDomain

java.lang.Object
  extended by oracle.jbo.domain.BaseLobDomain
      extended by oracle.jbo.domain.BlobDomain
All Implemented Interfaces:
java.io.Serializable, BlobDomainInterface, DomainInterface, LobInterface, LobStreamInterface, MarshalledDomain, MutableDomainInterface, XMLDomainInterface, oracle.jdbc.internal.ObjectData, ORAData

public class BlobDomain
extends BaseLobDomain
implements LobStreamInterface, XMLDomainInterface, java.io.Serializable

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

Since:
JDeveloper 3.0
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.jbo.domain.BaseLobDomain
BaseLobDomain.BlobOutputStream
 
Field Summary
 
Fields inherited from class oracle.jbo.domain.BaseLobDomain
lob, mClient, mData, mDataModified, mIndexString, mNeedsServerSync, mOwner, relIdx, xAct
 
Constructor Summary
BlobDomain()
          Constructor for this object.
BlobDomain(java.sql.Blob blob)
          Constructor for this object.
BlobDomain(BLOB blob)
          Deprecated. use BlobDomain(Blob) instead.
BlobDomain(java.sql.Blob blob, byte[] blobData)
          Creates an instance of this class with data as described in blobData and using the transaction context from blob to use the blob-locator in the database.
BlobDomain(BLOB blob, byte[] blobData)
          Deprecated. use BlobDomain(Blob, byte[]) instead.
BlobDomain(BlobDomain nblob, byte[] blobData)
          Creates an instance of this class with data as described in blobData and using the transaction context from blob to use the blob-locator in the database.
BlobDomain(byte[] data)
          Constructor for this class.
BlobDomain(ResponseValues respVals)
           
 
Method Summary
 void closeCharacterOutputStream()
          Closes and cleansup internal reference to writer.
static java.sql.Blob createEmptyBLOB(java.lang.Object context)
          Creates an empty Blob object.
 boolean equals(java.lang.Object obj)
          Tests for equality between this and obj.
 java.io.OutputStream getBinaryOutputStream()
           
 java.io.InputStream getBinaryStream()
           
 int getBufferSize()
           
 byte[] getBytes(long offset, int length)
           
 int getBytes(long pos, int length, byte[] buf)
           
 java.io.Writer getCharacterOutputStream()
          Returns a writer to be used to write chars into this CLOB.
protected  java.io.InputStream getInternalDataStream()
           
protected  java.io.InputStream getInternalDataStream(long pos, long length)
           
protected  java.io.OutputStream getInternalOutputStream(long pos)
           
protected  java.io.InputStream getInternalStream()
           
protected  java.io.InputStream getInternalStream(long pos, long length)
           
 long getLength()
           
 Node getXMLContentNode(Document xmlDoc)
          Creates the XML node in the given XML document for this domain's data.
static XMLDomainFactory getXMLDomainFactory(java.lang.Class attrClass)
          Internal: Applications should not use this method.
protected  java.lang.String getXMLElementTag()
          Returns this class name as an XML-element tag for this Struct domain object.
 void prepareForDML(java.lang.Object context)
          Internal: Applications should not use this method.
 java.lang.String printXMLDefinition(java.util.Hashtable allDefs, java.io.PrintWriter pw, boolean bContainees)
          Prints the DTD information for this domain in the given print writer.
protected  byte[] readBytesFromLob(long offset, int length)
           
protected  void syncLob(java.lang.Object otherLob)
           
 void useBLOB(java.sql.Blob nBlob)
          Obselete
protected  void writeBytesToLob()
           
 
Methods inherited from class oracle.jbo.domain.BaseLobDomain
closeCharacterStream, closeInputStream, closeOutputStream, getCharacterStream, getData, getInputStream, getInputStream, getInvokeDomainMethod, getOutputStream, getOutputStream, getOwner, getOwnerAttributeIndex, getOwnerRow, getRemoteBufferSize, getRemoteIdString, getRemoteLength, getSize, getStorageByteArray, isCacheDataModified, loadFromDatabase, marshal, resetCachedData, saveToDatabase, saveToDatabase, setBytes, setBytes, setContext, syncClientLob, syncServerLob, toByteArray, toDatum, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.jbo.domain.LobStreamInterface
closeCharacterStream, closeInputStream, closeOutputStream, getCharacterStream, getInputStream, getOutputStream
 
Methods inherited from interface oracle.jbo.domain.LobInterface
getOwner, getOwnerAttributeIndex, getRemoteIdString, getSize, syncClientLob, syncServerLob
 
Methods inherited from interface oracle.jbo.domain.BlobDomainInterface
loadFromDatabase, saveToDatabase, saveToDatabase
 
Methods inherited from interface oracle.jbo.domain.DomainInterface
getData, setContext
 

Constructor Detail

BlobDomain

public BlobDomain()
Constructor for this object.


BlobDomain

public BlobDomain(java.sql.Blob blob)
Constructor for this object. This is for use by JDBC. This constructor uses the transaction context from blob to use the blob-locator in the database.

Parameters:
blob - the BLOB from which to construct the BlobDomain.

BlobDomain

public BlobDomain(BLOB blob)
Deprecated. use BlobDomain(Blob) instead.


BlobDomain

public BlobDomain(byte[] data)
Constructor for this class. Creates an instance of this class with data as described in blobData.

Parameters:
data - data for the BLOB.

BlobDomain

public BlobDomain(java.sql.Blob blob,
                  byte[] blobData)
Creates an instance of this class with data as described in blobData and using the transaction context from blob to use the blob-locator in the database.

Parameters:
blob - transaction context for the BLOB locator, as a BLOB object.
blobData - data for the BLOB.

BlobDomain

public BlobDomain(BLOB blob,
                  byte[] blobData)
Deprecated. use BlobDomain(Blob, byte[]) instead.


BlobDomain

public BlobDomain(BlobDomain nblob,
                  byte[] blobData)
Creates an instance of this class with data as described in blobData and using the transaction context from blob to use the blob-locator in the database.

This constructor should be used by applications using the framework to create BlobDomain objects.

Parameters:
nblob - transaction context for the BLOB locator as a BlobDomain object.
blobData - data for the BLOB.

BlobDomain

public BlobDomain(ResponseValues respVals)
Method Detail

useBLOB

public void useBLOB(java.sql.Blob nBlob)
Obselete


prepareForDML

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

Specified by:
prepareForDML in interface BlobDomainInterface
Specified by:
prepareForDML in class BaseLobDomain
Parameters:
context - an internal framework context.

equals

public boolean equals(java.lang.Object obj)
Tests for equality between this and 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 comparisons.

Overrides:
equals in class BaseLobDomain
Parameters:
obj - the data item to compare against.

getXMLElementTag

protected java.lang.String getXMLElementTag()
Returns this class name as an XML-element tag for this Struct domain object. Override this method to return a custom XML-element tag for this domain.


getXMLContentNode

public Node getXMLContentNode(Document xmlDoc)
Creates the XML node in the given XML document for this domain's data.

Specified by:
getXMLContentNode in interface XMLDomainInterface
Parameters:
xmlDoc - name of the XML document.

printXMLDefinition

public java.lang.String printXMLDefinition(java.util.Hashtable allDefs,
                                           java.io.PrintWriter pw,
                                           boolean bContainees)
Prints the DTD information for this domain in the given print writer. Returns the DTD string to be added to this domain's container entity/domain.

Specified by:
printXMLDefinition in interface XMLDomainInterface
Parameters:
allDefs - name of hashtable containing key-value pairs of XML tags and their values.
pw - printwriter on which the information should be printed.
bContainees - whether this domain container has containees.

getXMLDomainFactory

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


createEmptyBLOB

public static java.sql.Blob createEmptyBLOB(java.lang.Object context)
Creates an empty Blob object.

Parameters:
context - an internal framework context.

getBinaryOutputStream

public java.io.OutputStream getBinaryOutputStream()
                                           throws java.sql.SQLException
Throws:
java.sql.SQLException

getBinaryStream

public java.io.InputStream getBinaryStream()

getBytes

public byte[] getBytes(long offset,
                       int length)

readBytesFromLob

protected byte[] readBytesFromLob(long offset,
                                  int length)
Specified by:
readBytesFromLob in class BaseLobDomain

writeBytesToLob

protected void writeBytesToLob()
Specified by:
writeBytesToLob in class BaseLobDomain

getInternalOutputStream

protected java.io.OutputStream getInternalOutputStream(long pos)
Specified by:
getInternalOutputStream in class BaseLobDomain

getInternalStream

protected java.io.InputStream getInternalStream()
Specified by:
getInternalStream in class BaseLobDomain

getInternalStream

protected java.io.InputStream getInternalStream(long pos,
                                                long length)
Specified by:
getInternalStream in class BaseLobDomain

getInternalDataStream

protected java.io.InputStream getInternalDataStream()
Specified by:
getInternalDataStream in class BaseLobDomain

getInternalDataStream

protected java.io.InputStream getInternalDataStream(long pos,
                                                    long length)
Specified by:
getInternalDataStream in class BaseLobDomain

syncLob

protected void syncLob(java.lang.Object otherLob)
Specified by:
syncLob in class BaseLobDomain

getLength

public long getLength()
Specified by:
getLength in class BaseLobDomain

getBufferSize

public int getBufferSize()

getBytes

public int getBytes(long pos,
                    int length,
                    byte[] buf)

getCharacterOutputStream

public java.io.Writer getCharacterOutputStream()
Description copied from interface: LobStreamInterface
Returns a writer to be used to write chars into this CLOB. This stream works in both 2/3 tiers. In 2-tier, this writer could be the same as the writer returned by the internal jdbc object. In 3-tier, this stream is a remote writer that streams data from the middle-tier LOB.

Specified by:
getCharacterOutputStream in interface LobStreamInterface

closeCharacterOutputStream

public void closeCharacterOutputStream()
Description copied from interface: LobStreamInterface
Closes and cleansup internal reference to writer.

Specified by:
closeCharacterOutputStream in interface LobStreamInterface

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.4.0)

E10653-05

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