Business Components

oracle.jbo.domain
Class Struct

java.lang.Object
  |
  +--oracle.jbo.domain.Struct
All Implemented Interfaces:
AttributeList, BlobDomainInterface, CustomDatum, DomainInterface, DomainOwnerInterface, LobInterface, MarshalledDomain, MutableDomainInterface, oracle.jdbc.internal.ObjectData, java.io.Serializable, XMLDomainInterface

public abstract synchronized class Struct
extends java.lang.Object
implements LobInterface, DomainOwnerInterface, XMLDomainInterface, AttributeList, CustomDatum, java.io.Serializable, MarshalledDomain

See Also:
Serialized Form

Field Summary
protected  XMLDomainFactory[] mAttrXmlFac
           
protected  java.lang.Object mConnection
           
protected  com.sun.java.util.collections.HashMap mContext
           
protected  java.lang.Object mData
           
protected  int mOwnerAttrIndex
           
protected  Transaction mTxn
           
protected  XMLDomainFactory mXmlFac
           
 
Constructor Summary
protected Struct()
           
protected Struct(Datum)
           
 
Method Summary
 int[] buildAttrSQLTypes()
           
 void domainToBeModified(DomainInterface)
          Notification method that this domain calls whenever any of its attribute values are about to be modified.
 boolean equals(java.lang.Object)
           
static void fillObjectAttributeDefs(AttributeList, StructureDef, java.lang.String[], AttributeDef[])
           
abstract  CustomDatumFactory[] getAttrCustomDatumFactories()
           
 java.lang.Object getAttribute(int)
          Selects the attribute at the given index.
 java.lang.Object getAttribute(java.lang.String)
          Selects the attribute with the given name.
 int getAttributeCount()
          Counts the number of attributes.
 int getAttributeIndexOf(java.lang.String)
          Find the index of the named attribute.
 java.lang.String[] getAttributeNames()
           
 java.lang.Object[] getAttributeValues()
           
abstract  int[] getAttrSQLTypes()
           
protected  java.lang.String getAttrXMLElementTag(AttributeDef)
           
abstract  java.lang.String getColumnType()
           
 java.lang.Object getData()
          Internal: Applications should not use this method.
 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()
           
static java.lang.Object getStructAttribute(AttributeList, StructureDef, java.lang.String)
           
abstract  StructureDef getStructureDef()
           
 Node getXMLContentNode(Document)
          Creates the XML node in the given XML document for this domain's data.
static XMLDomainFactory getXMLDomainFactory(java.lang.Class)
           
protected  java.lang.String getXMLElementTag()
           
 int hashCode()
           
protected  void initAttrXMLDomainFactories(AttributeDef[])
           
protected abstract  void initStructureDef()
           
protected  boolean isAttrXMLCData(AttributeDef)
           
 void loadFromDatabase(Transaction)
           
 ResponseValues marshal()
           
 void prepareForDML(java.lang.Object)
          Internal: Applications should not use this method.
 java.lang.String printXMLDefinition(java.util.Hashtable, java.io.PrintWriter, boolean)
          Prints the DTD info for this domain in the given print writer.
protected  void readAttrsFromXML(Element)
           
 void saveToDatabase(Transaction)
           
 void saveToDatabase(Transaction, java.lang.Object)
          Internal: Applications should not use this method.
 void setAttribute(int, java.lang.Object)
          Sets the value of an attribute.
 void setAttribute(java.lang.String, java.lang.Object)
          Set the value for the named attribute.
 void setAttributeNoCheck(int, java.lang.Object)
           
 void setContext(DomainOwnerInterface, Transaction, java.lang.Object)
          Internal: Applications should not use this method.
static void setStructAttribute(AttributeList, StructureDef, java.lang.String, java.lang.Object)
           
 void syncClientLob(LobInterface)
          Synchronize client-side data from the given lob
 void syncServerLob(LobInterface)
          Synchronize the streams from an older version of this object so that this version works with the opened streams (if any).
 Datum toDatum(OracleConnection)
           
 Datum toDatum(OracleConnection)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mData

protected java.lang.Object mData

mConnection

protected java.lang.Object mConnection

mTxn

protected Transaction mTxn

mContext

protected com.sun.java.util.collections.HashMap mContext

mOwnerAttrIndex

protected int mOwnerAttrIndex

mXmlFac

protected XMLDomainFactory mXmlFac

mAttrXmlFac

protected XMLDomainFactory[] mAttrXmlFac
Constructor Detail

Struct

protected Struct()
          throws java.sql.SQLException

Struct

protected Struct(Datum)
          throws java.sql.SQLException
Method Detail

getColumnType

public abstract java.lang.String getColumnType()

getStructureDef

public abstract StructureDef getStructureDef()

getAttrSQLTypes

public abstract int[] getAttrSQLTypes()

getAttrCustomDatumFactories

public abstract CustomDatumFactory[] getAttrCustomDatumFactories()

initStructureDef

protected abstract void initStructureDef()

getData

public java.lang.Object getData()
Description copied from interface: DomainInterface
Internal: Applications should not use this method.

Returns the value in the format that is acceptable to the database.

For domain classes based on oracle.sql.* classes, this method returns a Datum object. For domains based on java.lang types such as String, the value-holder object that is passed to JDBC is returned.

Specified by:
getData in interface DomainInterface
Following copied from interface: oracle.jbo.domain.DomainInterface
Returns:
a formatted value object.

domainToBeModified

public void domainToBeModified(DomainInterface)
Description copied from interface: DomainOwnerInterface
Notification method that this domain calls whenever any of its attribute values are about to be modified. This Domain should always notify its owner.
Specified by:
domainToBeModified in interface DomainOwnerInterface
Following copied from interface: oracle.jbo.domain.DomainOwnerInterface
Parameters:
d - the domain being modified.

setContext

public void setContext(DomainOwnerInterface,
                       Transaction,
                       java.lang.Object)
Description copied from interface: DomainInterface
Internal: Applications should not use this method.
Specified by:
setContext in interface DomainInterface

equals

public boolean equals(java.lang.Object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

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

toDatum

public Datum toDatum(OracleConnection)
              throws java.sql.SQLException
Specified by:
toDatum in interface CustomDatum

toDatum

public Datum toDatum(OracleConnection)
              throws java.sql.SQLException

getAttribute

public java.lang.Object getAttribute(int)
Description copied from interface: AttributeList
Selects the attribute at the given index.
Specified by:
getAttribute in interface AttributeList
Following copied from interface: oracle.jbo.AttributeList
Parameters:
index - an integer in the range 0 to getAttributeCount() - 1.
Returns:
the attribute associated with index.

getAttribute

public java.lang.Object getAttribute(java.lang.String)
Description copied from interface: AttributeList
Selects the attribute with the given name.
Specified by:
getAttribute in interface AttributeList
Following copied from interface: oracle.jbo.AttributeList
Parameters:
name - an attribute name.
Returns:
the attribute associated with name.
Throws:
JboException, - a runtime exception, if name is unknown.

setAttribute

public void setAttribute(int,
                         java.lang.Object)
Description copied from interface: AttributeList
Sets the value of an attribute.
Specified by:
setAttribute in interface AttributeList
Following copied from interface: oracle.jbo.AttributeList
Parameters:
index - the attribute's index.
value - the value to be assigned to the attribute.

getRemoteIdString

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

setAttributeNoCheck

public void setAttributeNoCheck(int,
                                java.lang.Object)

setAttribute

public void setAttribute(java.lang.String,
                         java.lang.Object)
Description copied from interface: AttributeList
Set the value for the named attribute.
Specified by:
setAttribute in interface AttributeList
Following copied from interface: oracle.jbo.AttributeList
Parameters:
name - the attribute's name.
value - the value to be assigned to the attribute.
Throws:
JboException, - a runtime exception, i if name is unknown.

getAttributeCount

public int getAttributeCount()
Description copied from interface: AttributeList
Counts the number of attributes.
Specified by:
getAttributeCount in interface AttributeList
Following copied from interface: oracle.jbo.AttributeList
Returns:
the number of attributes.

getAttributeIndexOf

public int getAttributeIndexOf(java.lang.String)
Description copied from interface: AttributeList
Find the index of the named attribute.
Specified by:
getAttributeIndexOf in interface AttributeList
Following copied from interface: oracle.jbo.AttributeList
Parameters:
name - the attribute's name.
Returns:
an integer in the range 0 to getAttributeCount() - 1.
Throws:
JboException, - a runtime exception, if name is unknown.

buildAttrSQLTypes

public int[] buildAttrSQLTypes()

marshal

public ResponseValues marshal()
Specified by:
marshal in interface MarshalledDomain

getXMLElementTag

protected java.lang.String getXMLElementTag()

getAttrXMLElementTag

protected java.lang.String getAttrXMLElementTag(AttributeDef)

isAttrXMLCData

protected boolean isAttrXMLCData(AttributeDef)

getXMLContentNode

public Node getXMLContentNode(Document)
Description copied from interface: XMLDomainInterface
Creates the XML node in the given XML document for this domain's data.

Specified by:
getXMLContentNode in interface XMLDomainInterface
Following copied from interface: oracle.jbo.domain.XMLDomainInterface
Parameters:
xmlDoc - name of the XML document in which the node should be created.

readAttrsFromXML

protected void readAttrsFromXML(Element)

printXMLDefinition

public java.lang.String printXMLDefinition(java.util.Hashtable,
                                           java.io.PrintWriter,
                                           boolean)
Description copied from interface: XMLDomainInterface
Prints the DTD info for this domain in the given print writer. Returns the DTD string to be added to this domain's container entity/domain.

The allDefs hashtable contains predefined XML definitions and is passed by whatever calls this method.

Specified by:
printXMLDefinition in interface XMLDomainInterface
Following copied from interface: oracle.jbo.domain.XMLDomainInterface
Parameters:
allDefs - a hashtable of predefined XML definitions passed from whatever calls this method.
pw - print writer into which the defnition is being printed.
bContainees - if true, prints definitions of contained objects.

getXMLDomainFactory

public static XMLDomainFactory getXMLDomainFactory(java.lang.Class)

initAttrXMLDomainFactories

protected void initAttrXMLDomainFactories(AttributeDef[])

loadFromDatabase

public void loadFromDatabase(Transaction)
                      throws java.lang.Exception
Specified by:
loadFromDatabase in interface BlobDomainInterface
Following copied from interface: oracle.jbo.domain.BlobDomainInterface
Parameters:
transaction - the DBTransactionImpl of the current Application Module.

saveToDatabase

public void saveToDatabase(Transaction)
                    throws java.lang.Exception
Specified by:
saveToDatabase in interface BlobDomainInterface
Following copied from interface: oracle.jbo.domain.BlobDomainInterface
Parameters:
transaction - the DBTransactionImpl instance of the current Application Module.

saveToDatabase

public void saveToDatabase(Transaction,
                           java.lang.Object)
                    throws java.lang.Exception
Description copied from interface: BlobDomainInterface
Internal: Applications should not use this method.

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

Specified by:
saveToDatabase in interface BlobDomainInterface

prepareForDML

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

syncClientLob

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

syncServerLob

public void syncServerLob(LobInterface)
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

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

getOwnerAttributeIndex

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

getOwnerRow

protected DomainOwnerInterface getOwnerRow()

getSize

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

setStructAttribute

public static void setStructAttribute(AttributeList,
                                      StructureDef,
                                      java.lang.String,
                                      java.lang.Object)

getStructAttribute

public static java.lang.Object getStructAttribute(AttributeList,
                                                  StructureDef,
                                                  java.lang.String)

fillObjectAttributeDefs

public static void fillObjectAttributeDefs(AttributeList,
                                           StructureDef,
                                           java.lang.String[],
                                           AttributeDef[])

getAttributeNames

public java.lang.String[] getAttributeNames()
Specified by:
getAttributeNames in interface AttributeList

getAttributeValues

public java.lang.Object[] getAttributeValues()
Specified by:
getAttributeValues in interface AttributeList

Business Components