|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.jbo.server.RowImpl
Base class for Entity Rows and View Object Rows. This class defines common methods for Entity Row and View Object Row access. Customer application logic can use this class to access database table rows independently of the implementation of the underlying row. For example, assume that a customer application is written to perform batch style inserts into a database table. This application may reference the RowImpl class for row access instead of accessing instances of ViewRowImpl or EntityImpl directly. This design would allow changes in a row's implementation (Entity Row or View Object Row) without necessitating changes in the application logic.
Unlike the Row
interface which provides tier-independent access to database
table rows, this class can only be referenced by logic that executes on an
application's middle tier.
Customers should not develop implementations of this abstract class.
Instead, customers who need to extend/override Row behavior should extend one
of the concrete Row classes: EntityImpl
and ViewRowImpl
.
ViewRowImpl
,
EntityImpl
,
Row
Fields inherited from interface oracle.jbo.XMLInterface |
XML_IGNORE_DEPTH_COUNT, XML_OPT_ALL_ROWS, XML_OPT_ASSOC_CONSISTENT,
XML_OPT_CHANGES_ONLY, XML_OPT_LIMIT_RANGE |
Constructor Summary |
RowImpl()
|
Method Summary |
Type | Method |
---|---|
protected void |
clearAllExceptions()
|
protected void |
clearAttributeException(int index)
Cleans any exception of an attribute of the given name was set earlier and threw an exception which was cached as the transaction is in deferred mode. |
protected void |
clearAttributeException(java.lang.String name)
Cleans any exception of an attribute of the given name was set earlier and threw an exception which was cached as the transaction is in deferred mode. |
protected void |
clearRowExceptions()
|
protected abstract void |
create(AttributeList nameValuePair)
This method is called to let subclasses of RowImpl set programmatic default values for attributes. |
java.lang.String |
createXMLDefinition(int depthCount)
Creates a StringWriter and calls printXMLDefinition
to generate
proper DTD for this row and all containees (if depthCount > 0) |
protected com.sun.java.util.collections.ArrayList |
getAllExceptions()
|
abstract int |
getAttributeCount()
Counts the attributes in this row. |
abstract int |
getAttributeIndexOf(java.lang.String name)
Finds the index of a named attribute. |
protected abstract java.lang.Object |
getAttributeInternal(int index)
Gets the attribute value by index. |
protected java.lang.Object |
getAttributeInternal(java.lang.String name)
Gets the attribute value by name. |
abstract Key |
getKey()
Returns the row's key. |
protected com.sun.java.util.collections.ArrayList |
getRowExceptions()
|
protected boolean |
hasAttributeException(int index)
Returns true if an attribute at the given index was set earlier and threw an exception which was cached as the transaction is in deferred mode. |
protected boolean |
hasAttributeException(java.lang.String name)
Returns true if an attribute of the given name was set earlier and threw an exception which was cached as the transaction is in deferred mode. |
protected boolean |
hasDeferredExceptions()
|
abstract boolean |
isAttributeUpdateable(int index)
Tests if an attribute is updateable. |
abstract void |
lock()
Locks the row(s) in the source database table. |
protected abstract void |
populateAttribute(int index,
java.lang.Object value)
|
protected java.lang.String |
printXMLDefinition(java.util.Hashtable allDefs,
java.io.PrintWriter pw,
int depthCount)
Prints DTD for this row and all its contents (including contained RowSets if depthCount is non-zero). |
abstract void |
readXML(Element elem,
int depthCount)
Reads the content of the row and updates the attributes, from given XML document. |
void |
readXML(Element elem,
int depthCount,
XSLStylesheet xslt)
Given the document interface, finds the rowset Element and invokes JboXMLUtil.processAndReadXML(XMLInterface, org.w3c.dom.Element, int, oracle.xml.parser.v2.XSLStylesheet)
to read in the data from the XML. |
protected abstract void |
registerAttributeException(AttributeDef attrDef,
java.lang.Object val,
JboException ex)
|
protected void |
registerRowException(JboException e)
|
abstract void |
remove()
Marks the row as removed and removes it from row iterators. |
protected abstract void |
setAttributeInternal(int index,
java.lang.Object value)
Sets the attribute value by index after performing declarative attribute-level validations. |
protected void |
setAttributeInternal(java.lang.String name,
java.lang.Object value)
Sets the attribute value by name. |
abstract void |
validate()
Invokes the validate method for the validators
attached to this business object. |
Node |
writeXML(int depthCount,
long options)
Writes this row as XML in the given XML document. |
Node |
writeXML(int depthCount,
long options,
XSLStylesheet xslt)
Writes this row as XML in the given XML document, according to the specified XSLT stylesheet. |
Node |
writeXML(long options,
com.sun.java.util.collections.HashMap voAttrMap)
Renders data in a canonical XML-format. |
Node |
writeXML(long options,
com.sun.java.util.collections.HashMap voAttrMap,
XSLStylesheet xslt)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.jbo.AttributeList |
getAttribute, getAttribute, setAttribute, setAttribute |
Constructor Detail |
public RowImpl()
Method Detail |
protected abstract void create(AttributeList nameValuePair)
If sub-classed, super.create
should be called
to let the framework setup initial states on the row.
nameValuePair
- a name providing access to an attribute list.protected abstract java.lang.Object getAttributeInternal(int index)
index
- attribute indexprotected final java.lang.Object getAttributeInternal(java.lang.String name)
Date startDate; startDate = (Date)getAttributeInternal(HIREDATE);
This method throws
a JboException
if an attribute of the given name is not found.
name
- attribute nameJboException
- if the attribute is not found.protected abstract void setAttributeInternal(int index, java.lang.Object value)
This method is used by code-gen facility in accessors for entity attributes.
index
- attribute indexvalue
- attribute valueprotected final void setAttributeInternal(java.lang.String name, java.lang.Object value)
getAttributeIndexOf
as:
setAttributeInternal(getAttributeIndexOf(name), value);
to get the name corresponding to the index, then set the value.
This method is used by the code generation facility in accessors for ViewRow attributes.
name
- column name.value
- column data.getAttributeIndexOf(java.lang.String)
public abstract void lock()
Row
lock
in interface Row
oracle.jbo.Row
JboException
- a runtime exception,
if an exception occurs during access.public abstract int getAttributeCount()
getAttributeCount
in interface AttributeList
public abstract int getAttributeIndexOf(java.lang.String name)
getAttributeIndexOf
in interface AttributeList
an
- attribute name.protected abstract void populateAttribute(int index, java.lang.Object value)
public abstract boolean isAttributeUpdateable(int index)
isAttributeUpdateable
in interface Row
index
- the index of the attribute.public abstract Key getKey()
Row
getKey
in interface Row
oracle.jbo.Row
public abstract void validate()
validate
method for the validators
attached to this business object.validate
in interface Row
oracle.jbo.Row
JboException
- a runtime exception,
if the recipient wishes the property change to be rolled back.public abstract void remove()
remove
in interface Row
oracle.jbo.Row
JboException
- a runtime exception,
if an exception occurs during access.public final java.lang.String createXMLDefinition(int depthCount)
printXMLDefinition
to generate
proper DTD for this row and all containees (if depthCount > 0)depthCount
- the number of child levels deep to include in the definitions.public Node writeXML(long options, com.sun.java.util.collections.HashMap voAttrMap)
XMLInterface
ViewObjectImpl
and
ViewRowImpl
implement this method to render
data in XML.
Use this method whenever data is required in XML format, either to present a UI (after converting XML data into some HTTP format using a stylesheet) or to pass the data as payload for messages via JMS.
The options parameter represents a set of bit flags that will control the writeXML behavior. The following bit flags have been defined:
EntityImpl
. The voAttrMap parameter represents in a hashmap, the mapping between a given ViewObject's definition type and the corresponding Attributes/accessors to render. A null entry in the hashmap means, render all attributes and accessors of that viewobject type.
writeXML
in interface XMLInterface
oracle.jbo.XMLInterface
options
- a set of bit flags that will control the writeXMLvoAttrMap
- HashMap containing Definition names of ViewObjects and an
array of AttributeDef to render for a ViewObject of that definition type.public Node writeXML(long options, com.sun.java.util.collections.HashMap voAttrMap, XSLStylesheet xslt)
writeXML
in interface XMLInterface
public Node writeXML(int depthCount, long options, XSLStylesheet xslt)
writeXML
in interface XMLInterface
depthCount
- the number of child levels deep to append the row nodes.options
- a set of bit flags that will control the writeXML behavior.xslt
- name of the XSLT stylesheet.public final Node writeXML(int depthCount, long options)
writeXML
in interface XMLInterface
depthCount
- the number of child levels deep to append the row nodes.options
- a set of bit flags that will control the writeXML behavior.public void readXML(Element elem, int depthCount, XSLStylesheet xslt)
JboXMLUtil.processAndReadXML(XMLInterface, org.w3c.dom.Element, int, oracle.xml.parser.v2.XSLStylesheet)
to read in the data from the XML.
Note that if the XML contains modifications to row-keys, other
RowSets for this object may not pick those changes up unless the rows
are posted to the database. Call Transaction.postChanges()
to sync
up all RowSets.
readXML
in interface XMLInterface
elem
- name of the XML element.depthCount
- the number of child levels deep to which data should be read.xslt
- name of the XSLT stylesheet.public abstract void readXML(Element elem, int depthCount)
remove()
on this row.readXML
in interface XMLInterface
elem
- name of the XML element.depthCount
- the number of child levels deep to which data should be read.protected java.lang.String printXMLDefinition(java.util.Hashtable allDefs, java.io.PrintWriter pw, int depthCount)
allDefs
- a hashtable of predefined XML definitions passed from whatever calls this method.pw
- print writer into which the defnition is being printed.depthCount
- the number of child
levels for which the DTD definition should be generated.protected void clearAttributeException(java.lang.String name)
protected void clearAttributeException(int index)
protected boolean hasAttributeException(java.lang.String name)
protected boolean hasAttributeException(int index)
protected boolean hasDeferredExceptions()
protected com.sun.java.util.collections.ArrayList getAllExceptions()
protected void clearAllExceptions()
protected abstract void registerAttributeException(AttributeDef attrDef, java.lang.Object val, JboException ex)
protected void registerRowException(JboException e)
protected void clearRowExceptions()
protected com.sun.java.util.collections.ArrayList getRowExceptions()
|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |