Skip navigation links

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

E10653-03


oracle.jbo.domain
Class BFileDomain

java.lang.Object
  extended by oracle.jbo.domain.BFileDomain

All Implemented Interfaces:
java.io.Serializable, BlobDomainInterface, DomainInterface, LobInterface, LobStreamInterface, MutableDomainInterface

public class BFileDomain
extends java.lang.Object
implements LobStreamInterface, java.io.Serializable

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

Since:
JDeveloper 3.0
See Also:
Serialized Form

Constructor Summary
BFileDomain()
          Constructor for this class.
BFileDomain(BFILE bFile)
          Constructor for this class, given a BFILE object.
BFileDomain(BFILE bFile, byte[] bFileData)
          Deprecated. since 9.0.4 BFile domains cannot be updated.
BFileDomain(BFileDomain bFile, byte[] bFileData)
          Deprecated. since 9.0.4 BFile domains cannot be updated.

 

Method Summary
 void closeCharacterOutputStream()
          Closes and cleansup internal reference to writer.
 void closeCharacterStream()
          Closes the character-reader object.
 void closeFile()
           
 void closeInputStream()
          Closes the InputStream object.
 void closeOutputStream()
          Closes the OutputStream object.
 boolean equals(java.lang.Object obj)
          Converts all the data into a String and compares the two strings.
 java.io.Writer getCharacterOutputStream()
          Returns a writer to be used to write chars into this CLOB.
 java.io.Reader getCharacterStream()
          Returns a stream to be used to read bytes from this LOB.
 java.lang.Object getData()
          Internal: Applications should not use this method.
 java.io.InputStream getInputStream()
          Returns a stream to be used to read bytes from this LOB.
static java.lang.reflect.Method getInvokeDomainMethod()
           
 java.io.OutputStream getOutputStream()
          Returns a stream to be used to write bytes into this LOB.
 DomainOwnerInterface getOwner()
          Returns the reference to owner of this domain (could be the row that this domain instance belongs to.)
 int getOwnerAttributeIndex()
           
protected  DomainOwnerInterface getOwnerRow()
           
 java.lang.String getRemoteIdString()
           
 long getSize()
           
 void loadFromDatabase(Transaction xAct)
          Internal: Applications should not use this method.
 void openFile()
           
 void prepareForDML(java.lang.Object context)
          Internal: Applications should not use this method.
 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[] bFileData)
          Deprecated. since 9.0.4 BFile domains cannot be updated.
 void setContext(DomainOwnerInterface owner, Transaction trans, java.lang.Object ctx)
          Internal: Applications should not use this method.
 void shareBFILE(BFileDomain newBFile)
          Internal: Applications should not use this method.
 void syncClientLob(LobInterface oldObject)
          Synchronize client-side data from the given lob
 void syncServerLob(LobInterface oldObj)
          Synchronize the streams from an older version of this object so that this version works with the opened streams (if any).
 byte[] toByteArray()
          Returns the contents of this BFILE as a byte array.
 java.lang.String toString()
          For testing purposes only: returns the contents fo the BFILE as a string.
 void useBFILE(BFILE newBlob)
          Internal: Applications should not use this method.

 

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

 

Constructor Detail

BFileDomain

public BFileDomain()
Constructor for this class.

BFileDomain

public BFileDomain(BFILE bFile)
Constructor for this class, given a BFILE object. This is for use by JDBC.
Parameters:
bFile - name of a BFILE object.

BFileDomain

public BFileDomain(BFILE bFile,
                   byte[] bFileData)
Deprecated. since 9.0.4 BFile domains cannot be updated.
Internal: Applications should not use this constructor.

Creates an instance of this class with data as described in bFileData and using the transaction context from bFile to use the file-locator in the database.

Parameters:
bFile - the name of the BFILE.
bFileData - the data for the BFILE.

BFileDomain

public BFileDomain(BFileDomain bFile,
                   byte[] bFileData)
Deprecated. since 9.0.4 BFile domains cannot be updated.
Internal: Applications should not use this constructor. Creates an instance of this class with data as described in bFileData and using the transaction context from bFile to use the file-locator in the database.

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

Parameters:
bFile - the name of the BFILE.
bFileData - the data forthe BFILE.

Method Detail

shareBFILE

public void shareBFILE(BFileDomain newBFile)
Internal: Applications should not use this method.

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

Parameters:
newBFile - name of the BFILE with which this BFILE will share its transaction and file locator information.

useBFILE

public void useBFILE(BFILE newBlob)
Internal: Applications should not use this method.

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

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

setBytes

public void setBytes(byte[] bFileData)
              throws DomainValidationException
Deprecated. since 9.0.4 BFile domains cannot be updated.
Internal: Applications should not use this method. Sets the file data for this object.
Parameters:
bFileData - the data used to fill the BFILE.
Throws:
DomainValidationException - if domain creation fails.

loadFromDatabase

public void loadFromDatabase(Transaction xAct)
                      throws java.lang.Exception
Internal: Applications should not use this method.

Uses the given transaction context to load data from the database.

Specified by:
loadFromDatabase in interface BlobDomainInterface
Parameters:
xAct - the name of the transaction to use.
Throws:
java.lang.Exception

setContext

public void setContext(DomainOwnerInterface owner,
                       Transaction trans,
                       java.lang.Object ctx)
Internal: Applications should not use this method.

Sets the transaction context for this BFILE.

Specified by:
setContext in interface DomainInterface

getData

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

Returns a BFILE that contains data for this object.

Specified by:
getData in interface DomainInterface
Returns:
a BFILE as a java.lang.Object.

saveToDatabase

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

NOT IMPLEMENTED FOR 3.0 Uses the given transaction context to store data back into the database using the BFILE locator which should be set before this method is invoked.

Specified by:
saveToDatabase in interface BlobDomainInterface
Parameters:
xAct - the name of the transaction.
Throws:
java.lang.Exception

saveToDatabase

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

NOT IMPLEMENTED FOR 3.0 Uses the given transaction context to store data back into the database using the BFILE locator which should be set before this method is invoked.

Specified by:
saveToDatabase in interface BlobDomainInterface
Throws:
java.sql.SQLException

prepareForDML

public void prepareForDML(java.lang.Object context)
Internal: Applications should not use this method.
Specified by:
prepareForDML in interface BlobDomainInterface

toString

public java.lang.String toString()
For testing purposes only: returns the contents fo the BFILE as a string.
Overrides:
toString in class java.lang.Object
Returns:
the contents of the BFILE as a string.

toByteArray

public byte[] toByteArray()
Returns the contents of this BFILE as a byte array.
Returns:
the contents of the BFILE as a byte array.

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 java.lang.Object
Parameters:
obj - the object to compare to this BfileDomain.

getOutputStream

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

Note that calling this multiple times returns the same OutputStream object. (It does not create a new OutputStream object each time it is called.) If you want to get a new OutputStream, call closeOutputStream then call getOutputStream.

Specified by:
getOutputStream in interface LobStreamInterface

closeOutputStream

public void closeOutputStream()
Description copied from interface: LobStreamInterface
Closes the OutputStream object. The OutputStream field is reset so that if getOutputStream() is called again, a new OutputStream is opened.
Specified by:
closeOutputStream in interface LobStreamInterface

getInputStream

public java.io.InputStream getInputStream()
Description copied from interface: LobStreamInterface
Returns a stream to be used to read bytes from this LOB. This stream works in both 2/3 tiers. In 2-tier, this stream could be the same as the stream returned by the internal jdbc object. In 3-tier, this stream is a remote OutputStream that streams data from the middle-tier LOB.

Note that calling this multiple times returns the same InputStream object. (It does not create a new InputStream object each time it is called.) If you want to get a new InputStream, call closeInputStream then call getInputStream.

Specified by:
getInputStream in interface LobStreamInterface

getCharacterStream

public java.io.Reader getCharacterStream()
Description copied from interface: LobStreamInterface
Returns a stream to be used to read bytes from this LOB. This stream works in both 2/3 tiers. In 2-tier, this stream could be the same as the stream returned by the internal jdbc object. In 3-tier, this stream is a remote OutputStream that streams data from the middle-tier LOB.

Note that calling this multiple times returns the same Reader object. (It does not create a new Reader object each time it is called.) If you want to get a new Reader, call closeInputStream then call getInputStream.

Specified by:
getCharacterStream in interface LobStreamInterface

getOwnerRow

protected DomainOwnerInterface getOwnerRow()

getRemoteIdString

public java.lang.String getRemoteIdString()
Specified by:
getRemoteIdString in interface LobInterface

syncServerLob

public void syncServerLob(LobInterface oldObj)
Description copied from interface: LobInterface
Synchronize the streams from an older version of this object so that this version works with the opened streams (if any).
Specified by:
syncServerLob in interface LobInterface

syncClientLob

public void syncClientLob(LobInterface oldObject)
Description copied from interface: LobInterface
Synchronize client-side data from the given lob
Specified by:
syncClientLob in interface LobInterface

getOwner

public DomainOwnerInterface getOwner()
Description copied from interface: LobInterface
Returns the reference to owner of this domain (could be the row that this domain instance belongs to.)
Specified by:
getOwner in interface LobInterface

getSize

public long getSize()
Specified by:
getSize in interface LobInterface

getOwnerAttributeIndex

public int getOwnerAttributeIndex()
Specified by:
getOwnerAttributeIndex in interface LobInterface

openFile

public void openFile()

closeFile

public void closeFile()

getInvokeDomainMethod

public static java.lang.reflect.Method getInvokeDomainMethod()

closeInputStream

public void closeInputStream()
Description copied from interface: LobStreamInterface
Closes the InputStream object. The InputStream field is reset so that if getInputStream() is called again, a new InputStream is opened.
Specified by:
closeInputStream in interface LobStreamInterface

closeCharacterStream

public void closeCharacterStream()
Description copied from interface: LobStreamInterface
Closes the character-reader object. The character-reader field is reset so that if getCharacterStream() is called again, a new character-reader is opened.
Specified by:
closeCharacterStream in interface LobStreamInterface

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

Skip navigation links

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

E10653-03


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