|
Oracle Application Development Framework Business Components Domains Java API Reference 10.1.3.1.0 B28971-01 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.jbo.domain.Struct
This class provides a lightweight wrapper for oracle.sql.STRUCT, the Java representation of the Struct database type. This wrapper allows an instance of the oracle.sql.STRUCT to be used as a domain object.
The oracle.jbo.domain.StructDomain class is the Java representation of the underlying database type that you must use if you want to exploit the domain feature of Business Components for Java.
Field Summary | |
protected oracle.jbo.domain.XMLDomainFactory[] |
mAttrXmlFac Factories for each of the attibutes if they have one. |
protected java.lang.Object |
mConnection Internal: Applications should not use this field. |
protected com.sun.java.util.collections.HashMap |
mContext Internal: Applications should not use this field. |
protected java.lang.Object |
mData Internal: Applications should not use this field. |
protected int |
mOwnerAttrIndex Index of the attribute in the domain owner's container. |
protected oracle.jbo.Transaction |
mTxn Internal: Applications should not use this field. |
protected oracle.jbo.domain.XMLDomainFactory |
mXmlFac The factory object that creates an instance of this STRUCT given an XML element. |
Constructor Summary | |
protected |
Struct() Constructs an instance of this class. |
protected |
Struct(oracle.sql.Datum d) Internal: Applications should not use this constructor. |
Method Summary | |
int[] |
buildAttrSQLTypes() Returns an array of the SQL datatypes of the attributes in this StructDomain object. |
void |
domainToBeModified(oracle.jbo.domain.DomainInterface d) Notification method that this domain calls whenever any of its attribute values are about to be modified. |
boolean |
equals(java.lang.Object obj) Tests this for equality with another object. |
static void |
fillObjectAttributeDefs(oracle.jbo.AttributeList al, oracle.jbo.StructureDef def, java.lang.String[] attrNames, oracle.jbo.AttributeDef[] ads) |
abstract oracle.sql.CustomDatumFactory[] |
getAttrCustomDatumFactories() Returns factories that oracle.sql requires to create the attributes of this structure. |
java.lang.Object |
getAttribute(int index) Returns the attribute from this StructDomain object, given its index. |
java.lang.Object |
getAttribute(java.lang.String name) Returns the attribute from this StructDomain object, given its name. |
int |
getAttributeCount() Returns the number of attributes in this StructDomain object. |
int |
getAttributeIndexOf(java.lang.String name) Returns the index of a named attribute in this StructDomain object. |
java.lang.String[] |
getAttributeNames() |
java.lang.Object[] |
getAttributeValues() |
abstract int[] |
getAttrSQLTypes() Returns the SQL types for the attributes of the structure. |
protected java.lang.String |
getAttrXMLElementTag(oracle.jbo.AttributeDef ad) Returns the class name of this domain, appended with the name of the attribute as xml-element tag for this domain-attribute. |
abstract java.lang.String |
getColumnType() Returns the column type of the database column that corresponds to this STRUCT. |
java.lang.Object |
getData() Internal: Applications should not use this method. |
oracle.jbo.domain.DomainOwnerInterface |
getOwner() |
int |
getOwnerAttributeIndex() |
protected oracle.jbo.domain.DomainOwnerInterface |
getOwnerRow() |
java.lang.String |
getRemoteIdString() |
long |
getSize() |
static java.lang.Object |
getStructAttribute(oracle.jbo.AttributeList inAttrList, oracle.jbo.StructureDef inStructDef, java.lang.String fullAttrName) |
abstract oracle.jbo.StructureDef |
getStructureDef() Returns the structure definition, that describes the details of the attributes, of this domain. |
org.w3c.dom.Node |
getXMLContentNode(org.w3c.dom.Document xmlDoc) Creates the xml node in the given xml document for this domain's data. |
static oracle.jbo.domain.XMLDomainFactory |
getXMLDomainFactory(java.lang.Class attrClass) Internal: Applications should not use this method. |
protected java.lang.String |
getXMLElementTag() Returns this class name as xml-element tag for this Struct domain object. |
int |
hashCode() Computes a hash code for this StructDomain object. |
protected void |
initAttrXMLDomainFactories(oracle.jbo.AttributeDef[] attrs) Internal: Applications should not use this method. |
protected abstract void |
initStructureDef() Initializes the structure definition of this object and its attribute definitions. |
protected boolean |
isAttrXMLCData(oracle.jbo.AttributeDef ad) Returns false always. |
void |
loadFromDatabase(oracle.jbo.Transaction transaction) Internal: Applications should not use this method. |
oracle.svcmsg.ResponseValues |
marshal() |
void |
prepareForDML(java.lang.Object context) |
java.lang.String |
printXMLDefinition(java.util.Hashtable allDefs, java.io.PrintWriter pw, boolean bContainees) Prints the DTD info for this domain in the given print writer. |
protected void |
readAttrsFromXML(org.w3c.dom.Element rowElt) Reads all the attribute values from the xml-element and sets them into this row. |
static oracle.jbo.StructureDef |
resolveAndGetStructureDef(java.lang.Class objectDomainClz) |
void |
saveToDatabase(oracle.jbo.Transaction transaction) Internal: Applications should not use this method. |
void |
saveToDatabase(oracle.jbo.Transaction transaction, java.lang.Object postedSQLObject) Internal: Applications should not use this method. |
void |
setAttribute(int index, java.lang.Object value) Sets the value of an attribute in this StructDomain, at the given index position. |
void |
setAttribute(java.lang.String name, java.lang.Object value) Sets the value of an attribute in this StructDomain object, given the attributes's name. |
void |
setAttributeNoCheck(int index, java.lang.Object value) Sets the value of an attribute in this StructDomain object, at the given index position. |
void |
setContext(oracle.jbo.domain.DomainOwnerInterface owner, oracle.jbo.Transaction trans, java.lang.Object ctx) Internal: Applications should not use this method. |
static void |
setStructAttribute(oracle.jbo.AttributeList inAttrList, oracle.jbo.StructureDef inStructDef, java.lang.String fullAttrName, java.lang.Object value) |
void |
syncClientLob(oracle.jbo.domain.LobInterface old) |
void |
syncServerLob(oracle.jbo.domain.LobInterface old) |
oracle.sql.Datum |
toDatum(oracle.jdbc.driver.OracleConnection conn) Internal: Applications should not use this method. |
oracle.sql.Datum |
toDatum(oracle.jdbc.OracleConnection conn) Internal: Applications should not use this method. |
java.lang.String |
toString() Internal: Applications should not use this method. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.Object mData
protected java.lang.Object mConnection
protected oracle.jbo.Transaction mTxn
protected com.sun.java.util.collections.HashMap mContext
protected int mOwnerAttrIndex
protected oracle.jbo.domain.XMLDomainFactory mXmlFac
protected oracle.jbo.domain.XMLDomainFactory[] mAttrXmlFac
Constructor Detail |
protected Struct() throws java.sql.SQLException
protected Struct(oracle.sql.Datum d) throws java.sql.SQLException
d
- a datum object.java.lang.SQLException
java.sql.SQLException
Method Detail |
public abstract java.lang.String getColumnType()
public abstract oracle.jbo.StructureDef getStructureDef()
public abstract int[] getAttrSQLTypes()
public abstract oracle.sql.CustomDatumFactory[] getAttrCustomDatumFactories()
protected abstract void initStructureDef()
public static oracle.jbo.StructureDef resolveAndGetStructureDef(java.lang.Class objectDomainClz)
public java.lang.Object getData()
Converts this
to a Struct JDBC object.
getData
in interface oracle.jbo.domain.DomainInterface
this
, or null
, if the conversion fails.public void domainToBeModified(oracle.jbo.domain.DomainInterface d)
domainToBeModified
in interface oracle.jbo.domain.DomainOwnerInterface
d
- the domain being modified.public void setContext(oracle.jbo.domain.DomainOwnerInterface owner, oracle.jbo.Transaction trans, java.lang.Object ctx)
setContext
in interface oracle.jbo.domain.DomainInterface
public boolean equals(java.lang.Object obj)
this
for equality with another object.
The argument is converted to a STRUCT
object, if necessary.
obj
- an arbitrary Object
.true
if conversion was successful and the converted argument is identical to this
.public int hashCode()
this
StructDomain object.this
StructDomain object.public java.lang.String toString()
For testing purposes only. Converts this
Struct object to a text representation.
public oracle.sql.Datum toDatum(oracle.jdbc.driver.OracleConnection conn) throws java.sql.SQLException
Converts this Struct
Domain object back into an SQL STRUCT
object.
toDatum
in interface oracle.sql.CustomDatum
conn
- OracleConnection
Not used.Datum
containing STRUCT
object.java.sql.SQLException
- Never.public oracle.sql.Datum toDatum(oracle.jdbc.OracleConnection conn) throws java.sql.SQLException
Converts this Struct
Domain object back into an SQL STRUCT
object.
conn
- OracleConnection
Not used.Datum
containing STRUCT
object.java.sql.SQLException
- Never.public java.lang.Object getAttribute(int index)
getAttribute
in interface oracle.jbo.AttributeList
index
- index for the attribute in the StructDomain object.public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface oracle.jbo.AttributeList
name
- name for the attribute in the StructDomain object.public void setAttribute(int index, java.lang.Object value)
setAttribute
in interface oracle.jbo.AttributeList
index
- index for the attribute in the StructDomain object.value
- value for the attribute.public java.lang.String getRemoteIdString()
getRemoteIdString
in interface oracle.jbo.domain.LobInterface
public void setAttributeNoCheck(int index, java.lang.Object value)
index
- index for the attribute in the StructDomain object.value
- value for the attribute.public void setAttribute(java.lang.String name, java.lang.Object value)
setAttribute
in interface oracle.jbo.AttributeList
name
- name of the attribute in the StructDomain object.value
- value for the attribute.public int getAttributeCount()
getAttributeCount
in interface oracle.jbo.AttributeList
public int getAttributeIndexOf(java.lang.String name)
getAttributeIndexOf
in interface oracle.jbo.AttributeList
name
- name of an attribute in this StructDomain object.public int[] buildAttrSQLTypes()
public oracle.svcmsg.ResponseValues marshal()
marshal
in interface oracle.jbo.domain.MarshalledDomain
protected java.lang.String getXMLElementTag()
protected java.lang.String getAttrXMLElementTag(oracle.jbo.AttributeDef ad)
ad
- the name of an AttributeDef.protected boolean isAttrXMLCData(oracle.jbo.AttributeDef ad)
ad
- name of an AttributeDef.public org.w3c.dom.Node getXMLContentNode(org.w3c.dom.Document xmlDoc)
getXMLContentNode
in interface oracle.jbo.domain.XMLDomainInterface
xmlDoc
- name of the XML document in which the node should be created.protected void readAttrsFromXML(org.w3c.dom.Element rowElt)
public java.lang.String printXMLDefinition(java.util.Hashtable allDefs, java.io.PrintWriter pw, boolean bContainees)
The allDefs hashtable contains predefined XML definitions and is passed by whatever calls this method.
printXMLDefinition
in interface oracle.jbo.domain.XMLDomainInterface
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.public static oracle.jbo.domain.XMLDomainFactory getXMLDomainFactory(java.lang.Class attrClass)
protected void initAttrXMLDomainFactories(oracle.jbo.AttributeDef[] attrs)
public void loadFromDatabase(oracle.jbo.Transaction transaction) throws java.lang.Exception
Loads the actual data of the LOB-type database attribute into memory.
The transaction argument is needed to perform an additional query into the database to extract the data.
This method does not need to be invoked for a new attribute.
loadFromDatabase
in interface oracle.jbo.domain.BlobDomainInterface
transaction
- the oracle.jbo.server.DBTransactionImpl
of the current Application Module.java.lang.Exception
public void saveToDatabase(oracle.jbo.Transaction transaction) throws java.lang.Exception
Saves data in memory to a database LOB-type attribute.
The transaction argument is is needed to perform an additional query into the database to write the data.
This method does not need to be invoked if this attribute's data has not changed.
saveToDatabase
in interface oracle.jbo.domain.BlobDomainInterface
transaction
- the oracle.jbo.server.DBTransactionImpl
instance of the current Application Module.java.lang.Exception
public void saveToDatabase(oracle.jbo.Transaction transaction, java.lang.Object postedSQLObject) throws java.lang.Exception
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.
saveToDatabase
in interface oracle.jbo.domain.BlobDomainInterface
java.lang.Exception
public void prepareForDML(java.lang.Object context)
prepareForDML
in interface oracle.jbo.domain.BlobDomainInterface
public void syncClientLob(oracle.jbo.domain.LobInterface old)
syncClientLob
in interface oracle.jbo.domain.LobInterface
public void syncServerLob(oracle.jbo.domain.LobInterface old)
syncServerLob
in interface oracle.jbo.domain.LobInterface
public oracle.jbo.domain.DomainOwnerInterface getOwner()
getOwner
in interface oracle.jbo.domain.LobInterface
public int getOwnerAttributeIndex()
getOwnerAttributeIndex
in interface oracle.jbo.domain.LobInterface
protected oracle.jbo.domain.DomainOwnerInterface getOwnerRow()
public long getSize()
getSize
in interface oracle.jbo.domain.LobInterface
public static void setStructAttribute(oracle.jbo.AttributeList inAttrList, oracle.jbo.StructureDef inStructDef, java.lang.String fullAttrName, java.lang.Object value)
public static java.lang.Object getStructAttribute(oracle.jbo.AttributeList inAttrList, oracle.jbo.StructureDef inStructDef, java.lang.String fullAttrName)
public static void fillObjectAttributeDefs(oracle.jbo.AttributeList al, oracle.jbo.StructureDef def, java.lang.String[] attrNames, oracle.jbo.AttributeDef[] ads)
public java.lang.String[] getAttributeNames()
getAttributeNames
in interface oracle.jbo.AttributeList
public java.lang.Object[] getAttributeValues()
getAttributeValues
in interface oracle.jbo.AttributeList
|
Oracle Application Development Framework Business Components Domains Java API Reference 10.1.3.1.0 B28971-01 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |