Business Components

oracle.jbo.server
Class RowImpl

java.lang.Object
  |
  +--oracle.jbo.common.BaseObject
        |
        +--oracle.jbo.server.RowImpl
Direct Known Subclasses:
EntityImpl, ViewRowImpl

public abstract class RowImpl
extends BaseObject
implements Row

Provides the internal access mechanism for ViewRow and Entity row objects.

Since:
JDeveloper 3.0
See Also:
ViewRowImpl, Entity

Field Summary
 java.lang.String XML_POSTSTATE_REMOVE
           
 java.lang.String XML_POSTSTATE_TAG
           
 
Fields inherited from class oracle.jbo.common.BaseObject
TRACE_EVERY_ALLOC, TRACE_NONE, TRACE_OCCASIONAL, TRACE_UNINITIALIZED
 
Fields inherited from interface oracle.jbo.XMLInterface
XML_OPT_CHANGES_ONLY, XML_OPT_LIMIT_RANGE
 
Constructor Summary
RowImpl()
           
 
Method Summary
protected abstract  void create(AttributeList nameValuePair)
          This method is called to let subclasses of RowImpl to set programmatic default values for attributes.
 java.lang.String createXMLDefinition(int depthCount)
           
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 the attribute value by index.
protected  java.lang.Object getAttributeInternal(java.lang.String name)
          Gets the attribute value by name.
abstract  Key getKey()
          Gets the identifier object for this row.
abstract  boolean isAttributeUpdateable(int index)
          Tests if an attribute is updateable.
abstract  void lock()
          Locks the row object and the corresponding row in the database.
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)
           
abstract  void readXML(org.w3c.dom.Element elem, int depthCount)
           
 void readXML(org.w3c.dom.Element elem, int depthCount, oracle.xml.parser.v2.XSLStylesheet xslt)
           
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.
 org.w3c.dom.Node writeXML(int depthCount, long options)
          Renders data in a canonical XML-format.
 org.w3c.dom.Node writeXML(int depthCount, long options, oracle.xml.parser.v2.XSLStylesheet xslt)
           
 
Methods inherited from class oracle.jbo.common.BaseObject
dumpState, setTraceLevel, setTraceWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_POSTSTATE_TAG

public final java.lang.String XML_POSTSTATE_TAG

XML_POSTSTATE_REMOVE

public final java.lang.String XML_POSTSTATE_REMOVE
Constructor Detail

RowImpl

public RowImpl()
Method Detail

create

protected abstract void create(AttributeList nameValuePair)
This method is called to let subclasses of RowImpl to set programmatic default values for attributes. If sub-classed, super.create should be called to let the framework setup initial states on the row.


getAttributeInternal

protected abstract java.lang.Object getAttributeInternal(int index)
Gets the the attribute value by index.
Parameters:
index - attribute index
Returns:
attribute value

getAttributeInternal

protected final java.lang.Object getAttributeInternal(java.lang.String name)
Gets the attribute value by name. For example,

  Date startDate;
  startDate = (Date)getAttributeInternal(HIREDATE);
 

This method throws a JboException if an attribute of the given name is not found.

Parameters:
name - attribute name
Returns:
attribute value
Throws:
JboException - if the attribute is not found.

setAttributeInternal

protected abstract void setAttributeInternal(int index,
                                             java.lang.Object value)
Sets the attribute value by index after performing declarative attribute-level validations.

This method is used by code-gen facility in accessors for entity attributes.

Parameters:
index - attribute index
value - attribute value

setAttributeInternal

protected final void setAttributeInternal(java.lang.String name,
                                          java.lang.Object value)
Sets the attribute value by name. This method invokes getAttributeIndexOf as:

 setAttributeInternal(getAttributeIndexOf(name), value);
  

to get the name corresponding to the index, then set the value.

This method is used by code generation facility in accessors for ViewRow attributes.

Parameters:
name - column name.
value - column data.
See Also:
getAttributeIndexOf(java.lang.String)

lock

public abstract void lock()
Locks the row object and the corresponding row in the database.
Specified by:
lock in interface Row
Tags copied from interface: Row
Throws:
JboException, - a runtime exception, if an exception occurs during access.

getAttributeCount

public abstract int getAttributeCount()
Counts the attributes in this row.
Returns:
the number of attributes.

getAttributeIndexOf

public abstract int getAttributeIndexOf(java.lang.String name)
Finds the index of a named attribute.
Parameters:
an - attribute name.
Returns:
the index of name, or -1 if not found.

populateAttribute

protected abstract void populateAttribute(int index,
                                          java.lang.Object value)

isAttributeUpdateable

public abstract boolean isAttributeUpdateable(int index)
Tests if an attribute is updateable.
Specified by:
isAttributeUpdateable in interface Row
Parameters:
index - the index of the attribute.
Returns:
true if the row is marked UPDATEABLE, or if the row is marked UPDATEABLE_WHILE_NEW and the current row is new.

getKey

public abstract Key getKey()
Gets the identifier object for this row.
Specified by:
getKey in interface Row
Returns:
the row's key.

validate

public abstract void validate()
Invokes the validate method for the validators attached to this business object.
Specified by:
validate in interface Row
Tags copied from interface: Row
Throws:
JboException, - a runtime exception, if the recipient wishes the property change to be rolled back.

remove

public abstract void remove()
Marks the row as removed and removes it from row iterators.
Specified by:
remove in interface Row
Tags copied from interface: Row
Throws:
JboException, - a runtime exception, if an exception occurs during access.

createXMLDefinition

public final java.lang.String createXMLDefinition(int depthCount)

writeXML

public org.w3c.dom.Node writeXML(int depthCount,
                                 long options,
                                 oracle.xml.parser.v2.XSLStylesheet xslt)

writeXML

public final org.w3c.dom.Node writeXML(int depthCount,
                                       long options)
Description copied from interface: XMLInterface
Renders data in a canonical XML-format. The classes 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 depthcount parameter represents to what level the rendering should recurse. A depthcount of zero (0) means do not traverse any View Links while rendering. One (1) means traverse the View Links on this object but no View Links thereafter, and so on.

The options parameter represents a set of bit flags that will control the writeXML behavior. The following bit flags have been defined:

Tags copied from interface: XMLInterface
Parameters:
depthCount - represents to what level the rendering should recurse.
options - a set of bit flags that will control the writeXML behavior.

readXML

public void readXML(org.w3c.dom.Element elem,
                    int depthCount,
                    oracle.xml.parser.v2.XSLStylesheet xslt)

readXML

public abstract void readXML(org.w3c.dom.Element elem,
                             int depthCount)

printXMLDefinition

protected java.lang.String printXMLDefinition(java.util.Hashtable allDefs,
                                              java.io.PrintWriter pw,
                                              int depthCount)

Business Components