EclipseLink 1.0_1.0M2 API Reference - Incubation

org.eclipse.persistence.sdo
Class SDODataObject

java.lang.Object
  extended by org.eclipse.persistence.sdo.SDODataObject

public class SDODataObject
extends java.lang.Object

Purpose: A data object is a representation of some structured data. It is the fundamental component in the SDO (Service Data Objects) package. Data objects support reflection, path-based access, convenience creation and deletion methods, and the ability to be part of a data graph.

Each data object holds its data as a series of Properties. Properties can be accessed by name, property index, or using the property meta object itself. A data object can also contain references to other data objects, through reference-type Properties.

A data object has a series of convenience accessors for its Properties. These methods either use a path (String), a property index, or the property's meta object itself, to identify the property. Some examples of the path-based accessors are as follows:

 DataObject company = ...;
 company.get("name");                   is the same as company.get(company.getType().getProperty("name"))
 company.set("name", "acme");
 company.get("department.0/name")       is the same as ((DataObject)((List)company.get("department")).get(0)).get("name")
                                        .n  indexes from 0 ... implies the name property of the first department
 company.get("department[1]/name")      [] indexes from 1 ... implies the name property of the first department
 company.get("department[number=123]")  returns the first department where number=123
 company.get("..")                      returns the containing data object
 company.get("/")                       returns the root containing data object

There are general accessors for Properties, i.e., get and set, as well as specific accessors for the primitive types and commonly used data types like String, Date, List, BigInteger, and BigDecimal.


Constructor Summary
SDODataObject()
          INTERNAL: Private constructor.
 
Method Summary
 java.lang.String _getContainmentPropertyName()
          INTERNAL: Return the name of the Property of the DataObject containing this data object or null if there is no container.
 ValueStore _getCurrentValueStore()
          INTERNAL: Map interface into the currentValueStore of this DataObject.
 HelperContext _getHelperContext()
          INTERNAL: Return the HelperContext associated with this DataObject.
 java.util.List _getOpenContentProperties()
          INTERNAL: Returns a list of the Properties currently used in this DataObject which are not included in getType().getProperties
 java.util.List _getOpenContentPropertiesAttributes()
           
 java.util.Map _getOpenContentPropertiesAttributesMap()
           
 java.util.List _getOpenContentPropertiesWithXMLRoots()
          INTERNAL: This function is implemented by SDOType.setOpen() in a mapping setGet/SetMethodName call
 java.lang.String _getPath()
          INTERNAL: Return an SDO Path string from root of the caller to itself
 java.lang.String _getSdoRef()
          INTERNAL: Return the sdoref attribute value during unmarshaling
 void _setChangeSummary(ChangeSummary aChangeSummary)
          INTERNAL: Recursively Set this DataObject's ChangeSummary as passed in value.
 void _setContainer(DataObject aContainer)
          INTERNAL: Sets the DataObject which contains this DataObject.
 void _setContainmentPropertyName(java.lang.String aContainmentPropertyName)
          INTERNAL: Sets the name of the property on the containing DataObject which contains this DataObject as a value.
 void _setCreated(boolean created)
          INTERNAL: Set flag created value.
 void _setCurrentValueStore(ValueStore aValueStore)
          INTERNAL: Pluggable Interface for substituting the default Map with a custom Map Class
 void _setHelperContext(HelperContext aContext)
          INTERNAL: Set the HelperContext that will be associated with this DataObject.
 void _setModified(boolean modified)
          INTERNAL: Set flag modified value.
 void _setOpenContentPropertiesAttributes(java.util.List openContentPropertiesAttributes)
           
 void _setOpenContentPropertiesAttributesMap(java.util.Map openAttributeProperties)
           
 void _setOpenContentPropertiesWithXMLRoots(java.util.List openContentPropertiesWithXMLRoots)
          INTERNAL: This function is implemented by SDOType.setOpen() in a mapping setGet/SetMethodName call
 void _setType(Type aType)
          INTERNAL:
 void addOpenContentProperty(Property property)
          INTERNAL: Add the open content property into all 3 data structures.
 java.lang.Object convertObjectToValue(Property property, java.lang.Class cls)
          INTERNAL:
 java.lang.Object convertObjectToValue(Property property, int position, java.lang.Class cls)
          INTERNAL:
 DataObject createDataObject(int propertyIndex)
          Returns a new data object contained by this object using the specified property, which must be a containment property.
 DataObject createDataObject(int propertyIndex, java.lang.String namespaceURI, java.lang.String typeName)
          Returns a new data object contained by this object using the specified property, which must be a containment property.
 DataObject createDataObject(Property property, Type aType)
          Returns a new data object contained by this object using the specified property, which must be of containment type.
 DataObject createDataObject(java.lang.String propertyName)
          Returns a new data object contained by this object using the specified property, which must be a containment property.
 DataObject createDataObject(java.lang.String propertyName, java.lang.String namespaceURI, java.lang.String typeName)
          Returns a new data object contained by this object using the specified property, which must be a containment property.
 Property defineOpenContentProperty(java.lang.String name, java.lang.Object value)
          INTERNAL: Create a dynamic open content property if no property exists for (name).
 void delete()
          Remove this object from its container and then unset all its non-readOnly Properties.
 void detach()
          Removes this DataObject from its container, if any.
 void detachOrDelete(boolean fromDelete)
          INTERNAL: Recursively walk the tree and set oldSettings for a detached/deleted object.
 java.lang.Object get(int propertyIndex)
          Returns the value of the property at the specified index in property list of this object's type.
 java.lang.Object get(java.lang.String path)
          Returns the value of a property of either this object or an object reachable from it, as identified by the specified path.
 java.math.BigDecimal getBigDecimal(int propertyIndex)
          Returns the value of a BigDecimal property identified by the specified property index.
 java.math.BigDecimal getBigDecimal(java.lang.String path)
          Returns the value of a BigDecimal property identified by the specified path.
 java.math.BigInteger getBigInteger(int propertyIndex)
          Returns the value of a BigInteger property identified by the specified property index.
 java.math.BigInteger getBigInteger(java.lang.String path)
          Returns the value of a BigInteger property identified by the specified path.
 boolean getBoolean(int propertyIndex)
          Returns the value of a boolean property identified by the specified property index.
 boolean getBoolean(java.lang.String path)
          Returns the value of a boolean property identified by the specified path.
 byte getByte(int propertyIndex)
          Returns the value of a byte property identified by the specified property index.
 byte getByte(java.lang.String path)
          Returns the value of a byte property identified by the specified path.
 byte[] getBytes(int propertyIndex)
          Returns the value of a byte[] property identified by the specified property index.
 byte[] getBytes(java.lang.String path)
          Returns the value of a byte[] property identified by the specified path.
 ChangeSummary getChangeSummary()
          Returns the ChangeSummary with scope covering this dataObject, or null if there is no ChangeSummary.
 char getChar(int propertyIndex)
          Returns the value of a char property identified by the specified property index.
 char getChar(java.lang.String path)
          Returns the value of a char property identified by the specified path.
 DataObject getContainer()
          Returns the containing data object or null if there is no container.
 Property getContainmentProperty()
          Return the Property of the data object containing this data object or null if there is no container.
 DataGraph getDataGraph()
          Returns the data graph for this object or null if there isn't one.
 DataObject getDataObject(int propertyIndex)
          Returns the value of a DataObject property identified by the specified property index.
 DataObject getDataObject(java.lang.String path)
          Returns the value of a DataObject property identified by the specified path.
 java.util.Date getDate(int propertyIndex)
          Returns the value of a Date property identified by the specified property index.
 java.util.Date getDate(java.lang.String path)
          Returns the value of a Date property identified by the specified path.
 double getDouble(int propertyIndex)
          Returns the value of a double property identified by the specified property index.
 double getDouble(java.lang.String path)
          Returns the value of a double property identified by the specified path.
 float getFloat(int propertyIndex)
          Returns the value of a float property identified by the specified property index.
 float getFloat(java.lang.String path)
          Returns the value of a float property identified by the specified path.
 java.util.List getInstanceProperties()
          Returns a read-only List of the Properties currently used in this DataObject.
 Property getInstanceProperty(int propertyIndex)
          INTERNAL:
 Property getInstanceProperty(java.lang.String propertyName)
          Returns the named Property from the current instance currentValueStore, or null if not found.
 int getInt(int propertyIndex)
          Returns the value of a int property identified by the specified property index.
 int getInt(java.lang.String path)
          Returns the value of a int property identified by the specified path.
 java.util.List getList(int propertyIndex)
          Returns the value of a List property identified by the specified property index.
 java.util.List getList(java.lang.String path)
          Returns the value of a List property identified by the specified path.
 long getLong(int propertyIndex)
          Returns the value of a long property identified by the specified property index.
 long getLong(java.lang.String path)
          Returns the value of a long property identified by the specified path.
 Property getProperty(java.lang.String propertyName)
          Deprecated. replaced by #getInstanceProperty() in 2.1.0
 java.lang.Object getPropertyInternal(Property property)
          INTERNAL: Get the value of the property (open-content or declared)..
 DataObject getRootObject()
          Returns the root data object.
 Sequence getSequence()
          Returns the Sequence for this DataObject.
 Sequence getSequence(int propertyIndex)
          Deprecated. in 2.1.0.
 Sequence getSequence(java.lang.String path)
          Deprecated. in 2.1.0.
 short getShort(int propertyIndex)
          Returns the value of a short property identified by the specified property index.
 short getShort(java.lang.String path)
          Returns the value of a short property identified by the specified path.
 java.lang.String getString(int propertyIndex)
          Returns the value of a String property identified by the specified property index.
 java.lang.String getString(java.lang.String path)
          Returns the value of a String property identified by the specified path.
 Type getType()
          Returns the data object's type.
 boolean isSet(int propertyIndex)
          Returns whether the the property at the specified index in property list of this object's type, is considered to be set.
 boolean isSet(java.lang.String path)
          Returns whether a property of either this object or an object reachable from it, as identified by the specified path, is considered to be set.
 boolean isSetInternal(Property property)
          INTERNAL: Return whether the property (open-content or declared) is set?
 boolean parentContains(java.lang.Object value)
          INTERNAL:
 void removeOpenContentProperty(Property property)
          INTERNAL: Remove the open content property (property) from all 3 data structures.
 void resetChanges()
          INTERNAL: Initialize all old settings related to ChangeSummary and recursively go down the tree to initialize all DataObjects rooted at this DataObject.
 void set(int propertyIndex, java.lang.Object value)
          Sets the property at the specified index in property list of this object's type, to the specified value.
 void set(Property property, java.lang.Object value, boolean updateSequence)
          INTERNAL: Sets the value of the given property of the object to the new value.
 void set(java.lang.String path, java.lang.Object value)
          Sets a property of either this object or an object reachable from it, as identified by the specified path, to the specified value.
 void setBigDecimal(int propertyIndex, java.math.BigDecimal value)
          Sets the value of a BigDecimal property identified by the specified property index, to the specified value.
 void setBigDecimal(java.lang.String path, java.math.BigDecimal value)
          Sets the value of a BigDecimal property identified by the specified path, to the specified value.
 void setBigInteger(int propertyIndex, java.math.BigInteger value)
          Sets the value of a BigInteger property identified by the specified property index, to the specified value.
 void setBigInteger(java.lang.String path, java.math.BigInteger value)
          Sets the value of a BigInteger property identified by the specified path, to the specified value.
 void setBoolean(int propertyIndex, boolean value)
          Sets the value of a boolean property identified by the specified property index, to the specified value.
 void setBoolean(java.lang.String path, boolean value)
          Sets the value of a boolean property identified by the specified path, to the specified value.
 void setByte(int propertyIndex, byte value)
          Sets the value of a byte property identified by the specified property index, to the specified value.
 void setByte(java.lang.String path, byte value)
          Sets the value of a byte property identified by the specified path, to the specified value.
 void setBytes(int propertyIndex, byte[] value)
          Sets the value of a byte[] property identified by the specified property index, to the specified value.
 void setBytes(java.lang.String path, byte[] value)
          Sets the value of a byte[] property identified by the specified path, to the specified value.
 void setChar(int propertyIndex, char value)
          Sets the value of a char property identified by the specified property index, to the specified value.
 void setChar(java.lang.String path, char value)
          Sets the value of a char property identified by the specified path, to the specified value.
 void setDataGraph(DataGraph dataGraph)
           
 void setDataObject(int propertyIndex, DataObject value)
          Sets the value of a DataObject property identified by the specified property index, to the specified value.
 void setDataObject(java.lang.String path, DataObject value)
          Sets the value of a DataObject property identified by the specified path, to the specified value.
 void setDate(int propertyIndex, java.util.Date value)
          Sets the value of a Date property identified by the specified property index, to the specified value.
 void setDate(java.lang.String path, java.util.Date value)
          Sets the value of a Date property identified by the specified path, to the specified value.
 void setDouble(int propertyIndex, double value)
          Sets the value of a double property identified by the specified property index, to the specified value.
 void setDouble(java.lang.String path, double value)
          Sets the value of a double property identified by the specified path, to the specified value.
 void setFloat(int propertyIndex, float value)
          Sets the value of a float property identified by the specified property index, to the specified value.
 void setFloat(java.lang.String path, float value)
          Sets the value of a float property identified by the specified path, to the specified value.
 void setInt(int propertyIndex, int value)
          Sets the value of a int property identified by the specified property index, to the specified value.
 void setInt(java.lang.String path, int value)
          Sets the value of a int property identified by the specified path, to the specified value.
 void setList(int propertyIndex, java.util.List value)
          Sets the value of a List property identified by the specified property index, to the specified value.
 void setList(java.lang.String path, java.util.List value)
          Sets the value of a List property identified by the specified path, to the specified value.
 void setLong(int propertyIndex, long value)
          Sets the value of a long property identified by the specified property index, to the specified value.
 void setLong(java.lang.String path, long value)
          Sets the value of a long property identified by the specified path, to the specified value.
 void setPropertyInternal(Property property, java.lang.Object value, boolean updateSequence)
          INTERNAL: Update the ValueStore with the new property value and update any sequence if it exists.
 void setShort(int propertyIndex, short value)
          Sets the value of a short property identified by the specified property index, to the specified value.
 void setShort(java.lang.String path, short value)
          Sets the value of a short property identified by the specified path, to the specified value.
 void setString(int propertyIndex, java.lang.String value)
          Sets the value of a String property identified by the specified property index, to the specified value.
 void setString(java.lang.String path, java.lang.String value)
          Sets the value of a String property identified by the specified path, to the specified value.
 void undoChanges(boolean isCSRoot, ChangeSummary cs, SDODataObject origContainer, java.lang.String origContainmentPropName)
          INTERNAL: This function reverses any operations that were performed on this object since change tracking was turned on.
 void unset(int propertyIndex)
          Unsets the property at the specified index in property list of this object's type.
 void unset(Property property, boolean fromDelete, boolean updateSequence)
          INTERNAL: Unset the specified property on this DataObject.
 void unset(java.lang.String path)
          Unsets a property of either this object or an object reachable from it, as identified by the specified path.
 void updateContainment(Property property, java.util.Collection values)
          INTERNAL: Update containment on the specified collection of values and default to true = update the sequence
 void updateContainment(Property property, java.util.Collection values, boolean updateSequence)
          INTERNAL: Update containment with flagged update sequence state
 java.lang.Object writeReplace()
          INTERNAL: Defined in SDO 2.01 spec on page 65 Externalizable function is called by ObjectStream.writeObject() A replacement object for serialization can be called here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SDODataObject

public SDODataObject()
INTERNAL: Private constructor. Use #SDODataObject(HelperContext) instead

Method Detail

_setHelperContext

public void _setHelperContext(HelperContext aContext)
INTERNAL: Set the HelperContext that will be associated with this DataObject.

Parameters:
aContext -

_getHelperContext

public HelperContext _getHelperContext()
INTERNAL: Return the HelperContext associated with this DataObject.

Returns:

get

public java.lang.Object get(java.lang.String path)
Returns the value of a property of either this object or an object reachable from it, as identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the value of the specified property.
See Also:
#get(Property)

set

public void set(java.lang.String path,
                java.lang.Object value)
         throws java.lang.ClassCastException,
                java.lang.UnsupportedOperationException,
                java.lang.IllegalArgumentException
Sets a property of either this object or an object reachable from it, as identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
Throws:
java.lang.ClassCastException
java.lang.UnsupportedOperationException
java.lang.IllegalArgumentException
See Also:
#set(Property, Object)

isSet

public boolean isSet(java.lang.String path)
Returns whether a property of either this object or an object reachable from it, as identified by the specified path, is considered to be set.

Parameters:
path - the path to a valid object and property.
See Also:
#isSet(Property)

unset

public void unset(java.lang.String path)
Unsets a property of either this object or an object reachable from it, as identified by the specified path.

Parameters:
path - the path to a valid object and property.
See Also:
#unset(Property)

getBoolean

public boolean getBoolean(java.lang.String path)
                   throws java.lang.ClassCastException
Returns the value of a boolean property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the boolean value of the specified property.
Throws:
java.lang.ClassCastException
See Also:
get(String)

getByte

public byte getByte(java.lang.String path)
Returns the value of a byte property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the byte value of the specified property.
See Also:
get(String)

getChar

public char getChar(java.lang.String path)
Returns the value of a char property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the char value of the specified property.
See Also:
get(String)

getDouble

public double getDouble(java.lang.String path)
Returns the value of a double property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the double value of the specified property.
See Also:
get(String)

getFloat

public float getFloat(java.lang.String path)
Returns the value of a float property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the float value of the specified property.
See Also:
get(String)

getInt

public int getInt(java.lang.String path)
Returns the value of a int property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the int value of the specified property.
See Also:
get(String)

getLong

public long getLong(java.lang.String path)
Returns the value of a long property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the long value of the specified property.
See Also:
get(String)

getShort

public short getShort(java.lang.String path)
Returns the value of a short property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the short value of the specified property.
See Also:
get(String)

getBytes

public byte[] getBytes(java.lang.String path)
Returns the value of a byte[] property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the byte[] value of the specified property.
See Also:
get(String)

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.lang.String path)
Returns the value of a BigDecimal property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the BigDecimal value of the specified property.
See Also:
get(String)

getBigInteger

public java.math.BigInteger getBigInteger(java.lang.String path)
Returns the value of a BigInteger property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the BigInteger value of the specified property.
See Also:
get(String)

getDataObject

public DataObject getDataObject(java.lang.String path)
                         throws java.lang.ClassCastException
Returns the value of a DataObject property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the DataObject value of the specified property.
Throws:
java.lang.ClassCastException
See Also:
get(String)

getDate

public java.util.Date getDate(java.lang.String path)
Returns the value of a Date property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the Date value of the specified property.
See Also:
get(String)

getString

public java.lang.String getString(java.lang.String path)
Returns the value of a String property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the String value of the specified property.
See Also:
get(String)

getList

public java.util.List getList(java.lang.String path)
Returns the value of a List property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the List value of the specified property.
See Also:
get(String)

setBoolean

public void setBoolean(java.lang.String path,
                       boolean value)
Sets the value of a boolean property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object)

setByte

public void setByte(java.lang.String path,
                    byte value)
Sets the value of a byte property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object)

setChar

public void setChar(java.lang.String path,
                    char value)
Sets the value of a char property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object)

setDouble

public void setDouble(java.lang.String path,
                      double value)
Sets the value of a double property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object)

setFloat

public void setFloat(java.lang.String path,
                     float value)
Sets the value of a float property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object)

setInt

public void setInt(java.lang.String path,
                   int value)
Sets the value of a int property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object)

setLong

public void setLong(java.lang.String path,
                    long value)
Sets the value of a long property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object)

setShort

public void setShort(java.lang.String path,
                     short value)
Sets the value of a short property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object)

setBytes

public void setBytes(java.lang.String path,
                     byte[] value)
Sets the value of a byte[] property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object)

setBigDecimal

public void setBigDecimal(java.lang.String path,
                          java.math.BigDecimal value)
Sets the value of a BigDecimal property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object)

setBigInteger

public void setBigInteger(java.lang.String path,
                          java.math.BigInteger value)
Sets the value of a BigInteger property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object)

setDataObject

public void setDataObject(java.lang.String path,
                          DataObject value)
Sets the value of a DataObject property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object)

setDate

public void setDate(java.lang.String path,
                    java.util.Date value)
Sets the value of a Date property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object)

setString

public void setString(java.lang.String path,
                      java.lang.String value)
Sets the value of a String property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object)

setList

public void setList(java.lang.String path,
                    java.util.List value)
Sets the value of a List property identified by the specified path, to the specified value.

Parameters:
path - the path to a valid object and property.
value - the new value for the property.
See Also:
set(String, Object), #setList(Property, List)

get

public java.lang.Object get(int propertyIndex)
                     throws java.lang.IllegalArgumentException
Returns the value of the property at the specified index in property list of this object's type.

Parameters:
propertyIndex - the index of the property.
Returns:
the value of the specified property.
Throws:
java.lang.IllegalArgumentException
See Also:
#get(Property)

set

public void set(int propertyIndex,
                java.lang.Object value)
Sets the property at the specified index in property list of this object's type, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
#set(Property, Object)

isSet

public boolean isSet(int propertyIndex)
Returns whether the the property at the specified index in property list of this object's type, is considered to be set.

Parameters:
propertyIndex - the index of the property.
Returns:
whether the specified property is set.
See Also:
#isSet(Property)

unset

public void unset(int propertyIndex)
Unsets the property at the specified index in property list of this object's type.

Parameters:
propertyIndex - the index of the property.
See Also:
#unset(Property)

getBoolean

public boolean getBoolean(int propertyIndex)
                   throws java.lang.IllegalArgumentException,
                          java.lang.ClassCastException
Returns the value of a boolean property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the boolean value of the specified property.
Throws:
java.lang.IllegalArgumentException
java.lang.ClassCastException
See Also:
get(int)

getByte

public byte getByte(int propertyIndex)
             throws java.lang.IllegalArgumentException,
                    java.lang.ClassCastException
Returns the value of a byte property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the byte value of the specified property.
Throws:
java.lang.IllegalArgumentException
java.lang.ClassCastException
See Also:
get(int)

getChar

public char getChar(int propertyIndex)
             throws java.lang.IllegalArgumentException,
                    java.lang.ClassCastException
Returns the value of a char property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the char value of the specified property.
Throws:
java.lang.IllegalArgumentException
java.lang.ClassCastException
See Also:
get(int)

getDouble

public double getDouble(int propertyIndex)
                 throws java.lang.IllegalArgumentException,
                        java.lang.ClassCastException
Returns the value of a double property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the double value of the specified property.
Throws:
java.lang.IllegalArgumentException
java.lang.ClassCastException
See Also:
get(int)

getFloat

public float getFloat(int propertyIndex)
               throws java.lang.IllegalArgumentException,
                      java.lang.ClassCastException
Returns the value of a float property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the float value of the specified property.
Throws:
java.lang.IllegalArgumentException
java.lang.ClassCastException
See Also:
get(int)

getInt

public int getInt(int propertyIndex)
           throws java.lang.IllegalArgumentException,
                  java.lang.ClassCastException
Returns the value of a int property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the int value of the specified property.
Throws:
java.lang.IllegalArgumentException
java.lang.ClassCastException
See Also:
get(int)

getLong

public long getLong(int propertyIndex)
             throws java.lang.IllegalArgumentException,
                    java.lang.ClassCastException
Returns the value of a long property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the long value of the specified property.
Throws:
java.lang.IllegalArgumentException
java.lang.ClassCastException
See Also:
get(int)

getShort

public short getShort(int propertyIndex)
               throws java.lang.IllegalArgumentException,
                      java.lang.ClassCastException
Returns the value of a short property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the short value of the specified property.
Throws:
java.lang.IllegalArgumentException
java.lang.ClassCastException
See Also:
get(int)

getBytes

public byte[] getBytes(int propertyIndex)
                throws java.lang.IllegalArgumentException,
                       java.lang.ClassCastException
Returns the value of a byte[] property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the byte[] value of the specified property.
Throws:
java.lang.IllegalArgumentException
java.lang.ClassCastException
See Also:
get(int)

getBigDecimal

public java.math.BigDecimal getBigDecimal(int propertyIndex)
                                   throws java.lang.IllegalArgumentException,
                                          java.lang.ClassCastException
Returns the value of a BigDecimal property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the BigDecimal value of the specified property.
Throws:
java.lang.IllegalArgumentException
java.lang.ClassCastException
See Also:
get(int)

getBigInteger

public java.math.BigInteger getBigInteger(int propertyIndex)
                                   throws java.lang.IllegalArgumentException,
                                          java.lang.ClassCastException
Returns the value of a BigInteger property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the BigInteger value of the specified property.
Throws:
java.lang.IllegalArgumentException
java.lang.ClassCastException
See Also:
get(int)

getDataObject

public DataObject getDataObject(int propertyIndex)
Returns the value of a DataObject property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the DataObject value of the specified property.
See Also:
get(int)

getDate

public java.util.Date getDate(int propertyIndex)
                       throws java.lang.IllegalArgumentException,
                              java.lang.ClassCastException
Returns the value of a Date property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the Date value of the specified property.
Throws:
java.lang.IllegalArgumentException
java.lang.ClassCastException
See Also:
get(int)

getString

public java.lang.String getString(int propertyIndex)
                           throws java.lang.IllegalArgumentException,
                                  java.lang.ClassCastException
Returns the value of a String property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the String value of the specified property.
Throws:
java.lang.IllegalArgumentException
java.lang.ClassCastException
See Also:
get(int)

getList

public java.util.List getList(int propertyIndex)
Returns the value of a List property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the List value of the specified property.
See Also:
get(int)

getSequence

public Sequence getSequence(java.lang.String path)
Deprecated. in 2.1.0.

Returns the value of a Sequence property identified by the specified path.

Parameters:
path - the path to a valid object and property.
Returns:
the Sequence value of the specified property.
See Also:
get(String)

getSequence

public Sequence getSequence(int propertyIndex)
Deprecated. in 2.1.0.

Returns the value of a Sequence property identified by the specified property index.

Parameters:
propertyIndex - the index of the property.
Returns:
the Sequence value of the specified property.
See Also:
get(int)

getSequence

public Sequence getSequence()
Returns the Sequence for this DataObject. When getType().isSequencedType() == true, the Sequence of a DataObject corresponds to the XML elements representing the values of its Properties. Updates through DataObject and the Lists or Sequences returned from DataObject operate on the same data. When getType().isSequencedType() == false, null is returned.

Returns:
the Sequence or null.

setBoolean

public void setBoolean(int propertyIndex,
                       boolean value)
Sets the value of a boolean property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object)

setByte

public void setByte(int propertyIndex,
                    byte value)
Sets the value of a byte property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object)

setChar

public void setChar(int propertyIndex,
                    char value)
Sets the value of a char property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object)

setDouble

public void setDouble(int propertyIndex,
                      double value)
Sets the value of a double property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object)

setFloat

public void setFloat(int propertyIndex,
                     float value)
Sets the value of a float property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object)

setInt

public void setInt(int propertyIndex,
                   int value)
Sets the value of a int property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object)

setLong

public void setLong(int propertyIndex,
                    long value)
Sets the value of a long property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object)

setShort

public void setShort(int propertyIndex,
                     short value)
Sets the value of a short property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object)

setBytes

public void setBytes(int propertyIndex,
                     byte[] value)
Sets the value of a byte[] property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object)

setBigDecimal

public void setBigDecimal(int propertyIndex,
                          java.math.BigDecimal value)
Sets the value of a BigDecimal property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object)

setBigInteger

public void setBigInteger(int propertyIndex,
                          java.math.BigInteger value)
Sets the value of a BigInteger property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object)

setDataObject

public void setDataObject(int propertyIndex,
                          DataObject value)
Sets the value of a DataObject property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object)

setDate

public void setDate(int propertyIndex,
                    java.util.Date value)
Sets the value of a Date property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object)

setString

public void setString(int propertyIndex,
                      java.lang.String value)
Sets the value of a String property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object)

setList

public void setList(int propertyIndex,
                    java.util.List value)
Sets the value of a List property identified by the specified property index, to the specified value.

Parameters:
propertyIndex - the index of the property.
value - the new value for the property.
See Also:
set(int, Object), #setList(Property, List)

defineOpenContentProperty

public Property defineOpenContentProperty(java.lang.String name,
                                          java.lang.Object value)
                                   throws java.lang.UnsupportedOperationException,
                                          java.lang.IllegalArgumentException
INTERNAL: Create a dynamic open content property if no property exists for (name).

Parameters:
name -
value -
Returns:
Property
Throws:
java.lang.UnsupportedOperationException
java.lang.IllegalArgumentException

set

public void set(Property property,
                java.lang.Object value,
                boolean updateSequence)
         throws java.lang.UnsupportedOperationException,
                java.lang.IllegalArgumentException
INTERNAL: Sets the value of the given property of the object to the new value.

The use of a false updateSequence flag is internally implemented during an SDOSequence.add() call. Refactor: we need to abstract this function using a type of Command pattern to handle the sequence context.

Parameters:
property -
value -
updateSequence -
Throws:
java.lang.UnsupportedOperationException
java.lang.IllegalArgumentException

unset

public void unset(Property property,
                  boolean fromDelete,
                  boolean updateSequence)
INTERNAL: Unset the specified property on this DataObject. The fromDelete parameter specifies whether we are from a delete or unset/detach operation. The updateSequence parameter is used internally to stop a bidirectional update in the SDOSequence when originally called from this Sequence.

Parameters:
property -
fromDelete -
updateSequence -

createDataObject

public DataObject createDataObject(java.lang.String propertyName)
Returns a new data object contained by this object using the specified property, which must be a containment property. The type of the created object is the declared type of the specified property.

Parameters:
propertyName - the name of the specified containment property.
Returns:
the created data object.
See Also:
createDataObject(String, String, String)

createDataObject

public DataObject createDataObject(int propertyIndex)
Returns a new data object contained by this object using the specified property, which must be a containment property. The type of the created object is the declared type of the specified property.

Parameters:
propertyIndex - the index of the specified containment property.
Returns:
the created data object.
See Also:
createDataObject(int, String, String)

createDataObject

public DataObject createDataObject(java.lang.String propertyName,
                                   java.lang.String namespaceURI,
                                   java.lang.String typeName)
Returns a new data object contained by this object using the specified property, which must be a containment property. The type of the created object is specified by the packageURI and typeName arguments. The specified type must be a compatible target for the property identified by propertyName.

Parameters:
propertyName - the name of the specified containment property.
namespaceURI - the namespace URI of the package containing the type of object to be created.
typeName - the name of a type in the specified package.
Returns:
the created data object.
See Also:
createDataObject(String), DataGraph#getType

createDataObject

public DataObject createDataObject(int propertyIndex,
                                   java.lang.String namespaceURI,
                                   java.lang.String typeName)
Returns a new data object contained by this object using the specified property, which must be a containment property. The type of the created object is specified by the packageURI and typeName arguments. The specified type must be a compatible target for the property identified by propertyIndex.

Parameters:
propertyIndex - the index of the specified containment property.
namespaceURI - the namespace URI of the package containing the type of object to be created.
typeName - the name of a type in the specified package.
Returns:
the created data object.
See Also:
createDataObject(int), DataGraph#getType

createDataObject

public DataObject createDataObject(Property property,
                                   Type aType)
Returns a new data object contained by this object using the specified property, which must be of containment type. The type of the created object is specified by the type argument, which must be a compatible target for the specifed property.

Parameters:
property - a containment property of this object.
type - the type of object to be created.
Returns:
the created data object.
See Also:
createDataObject(int)

detachOrDelete

public void detachOrDelete(boolean fromDelete)
INTERNAL: Recursively walk the tree and set oldSettings for a detached/deleted object. This function performs a single preOrder traversal of the tree. An unset is done for each property if the action = delete Implementors: detach() and delete() via detach

Parameters:
fromDelete - (flag the action true = delete, false = detach)

detach

public void detach()
Removes this DataObject from its container, if any. Same as getContainer().getList(getContainmentProperty()).remove(this) or getContainer().unset(getContainmentProperty()) depending on getContainmentProperty().isMany() respectively.


delete

public void delete()
Remove this object from its container and then unset all its non-readOnly Properties. If this object is contained by a readOnly containment property, its non-readOnly Properties will be unset but the object will not be removed from its container. All DataObjects recursively contained by containment Properties will also be deleted.


getContainer

public DataObject getContainer()
Returns the containing data object or null if there is no container.

Returns:
the containing data object or null.

getContainmentProperty

public Property getContainmentProperty()
Return the Property of the data object containing this data object or null if there is no container.

Returns:
the property containing this data object.

getDataGraph

public DataGraph getDataGraph()
Returns the data graph for this object or null if there isn't one.

Returns:
the containing data graph or null.

setDataGraph

public void setDataGraph(DataGraph dataGraph)

getType

public Type getType()
Returns the data object's type.

The type defines the Properties available for reflective access.

Returns:
the type.

getInstanceProperties

public java.util.List getInstanceProperties()
Returns a read-only List of the Properties currently used in this DataObject. This list will contain all of the Properties in getType().getProperties() and any Properties where isSet(property) is true. For example, Properties resulting from the use of open or mixed XML content are present if allowed by the Type. the List does not contain duplicates. The order of the Properties in the List begins with getType().getProperties() and the order of the remaining Properties is determined by the implementation. The same list will be returned unless the DataObject is updated so that the contents of the List change.

Returns:
the List of Properties currently used in this DataObject.

getProperty

public Property getProperty(java.lang.String propertyName)
Deprecated. replaced by #getInstanceProperty() in 2.1.0


getInstanceProperty

public Property getInstanceProperty(java.lang.String propertyName)
Returns the named Property from the current instance currentValueStore, or null if not found. The instance currentValueStore are getInstanceProperties().

Parameters:
propertyName - the name of the Property
Returns:
the named Property from the DataObject's current instance currentValueStore, or null.

getInstanceProperty

public Property getInstanceProperty(int propertyIndex)
                             throws java.lang.IllegalArgumentException
INTERNAL:

Parameters:
propertyIndex -
Returns:
Throws:
SDOException
java.lang.IllegalArgumentException

getRootObject

public DataObject getRootObject()
Returns the root data object.

Returns:
the root data object.

getChangeSummary

public ChangeSummary getChangeSummary()
Returns the ChangeSummary with scope covering this dataObject, or null if there is no ChangeSummary.

Returns:
the ChangeSummary with scope covering this dataObject, or null.

_setCreated

public void _setCreated(boolean created)
INTERNAL: Set flag created value.

Parameters:
created - flag created's new value.

_setModified

public void _setModified(boolean modified)
INTERNAL: Set flag modified value.

Parameters:
modified - flag modified's new value.

_setChangeSummary

public void _setChangeSummary(ChangeSummary aChangeSummary)
INTERNAL: Recursively Set this DataObject's ChangeSummary as passed in value.

Parameters:
aChangeSummary - the ChangeSummary taking this DataObject as root.

undoChanges

public void undoChanges(boolean isCSRoot,
                        ChangeSummary cs,
                        SDODataObject origContainer,
                        java.lang.String origContainmentPropName)
INTERNAL: This function reverses any operations that were performed on this object since change tracking was turned on. The object is returned to the state when logging was first started.

Parameters:
isCSRoot -
cs -
origContainer -
origContainmentPropName -

resetChanges

public void resetChanges()
INTERNAL: Initialize all old settings related to ChangeSummary and recursively go down the tree to initialize all DataObjects rooted at this DataObject. TODO: FIX


_setType

public void _setType(Type aType)
INTERNAL:

Parameters:
aType -

_setCurrentValueStore

public void _setCurrentValueStore(ValueStore aValueStore)
INTERNAL: Pluggable Interface for substituting the default Map with a custom Map Class

Parameters:
currentValueStore - void

_getCurrentValueStore

public ValueStore _getCurrentValueStore()
INTERNAL: Map interface into the currentValueStore of this DataObject.
Note: Implementers of the ValueStore interface require this accessor.

Returns:

_setContainer

public void _setContainer(DataObject aContainer)
INTERNAL: Sets the DataObject which contains this DataObject.

Parameters:
aContainer - the DataObject which is the container of this DataObject.

_getOpenContentPropertiesAttributesMap

public java.util.Map _getOpenContentPropertiesAttributesMap()

_setOpenContentPropertiesAttributesMap

public void _setOpenContentPropertiesAttributesMap(java.util.Map openAttributeProperties)

_setOpenContentPropertiesWithXMLRoots

public void _setOpenContentPropertiesWithXMLRoots(java.util.List openContentPropertiesWithXMLRoots)
INTERNAL: This function is implemented by SDOType.setOpen() in a mapping setGet/SetMethodName call

Parameters:
openContentPropertiesWithXMLRoots -

_getOpenContentPropertiesWithXMLRoots

public java.util.List _getOpenContentPropertiesWithXMLRoots()
INTERNAL: This function is implemented by SDOType.setOpen() in a mapping setGet/SetMethodName call

Returns:

_getOpenContentProperties

public java.util.List _getOpenContentProperties()
INTERNAL: Returns a list of the Properties currently used in this DataObject which are not included in getType().getProperties

Returns:
the List of open content Properties currently used in this DataObject.

convertObjectToValue

public java.lang.Object convertObjectToValue(Property property,
                                             java.lang.Class cls)
                                      throws java.lang.ClassCastException,
                                             java.lang.IllegalArgumentException
INTERNAL:

Parameters:
property -
cls -
Returns:
Throws:
java.lang.ClassCastException
java.lang.IllegalArgumentException

convertObjectToValue

public java.lang.Object convertObjectToValue(Property property,
                                             int position,
                                             java.lang.Class cls)
                                      throws java.lang.ClassCastException,
                                             java.lang.IllegalArgumentException
INTERNAL:

Parameters:
property -
position -
cls -
Returns:
Throws:
java.lang.ClassCastException
java.lang.IllegalArgumentException

_setContainmentPropertyName

public void _setContainmentPropertyName(java.lang.String aContainmentPropertyName)
INTERNAL: Sets the name of the property on the containing DataObject which contains this DataObject as a value.

Parameters:
aContainmentPropertyName - the name of the property on the containing DataObject which has this DataObject as a value.

_getContainmentPropertyName

public java.lang.String _getContainmentPropertyName()
INTERNAL: Return the name of the Property of the DataObject containing this data object or null if there is no container.

Returns:
the property containing this data object.

parentContains

public boolean parentContains(java.lang.Object value)
INTERNAL:

Parameters:
value -
Returns:

updateContainment

public void updateContainment(Property property,
                              java.util.Collection values,
                              boolean updateSequence)
INTERNAL: Update containment with flagged update sequence state

Parameters:
property -
values -
updateSequence -

updateContainment

public void updateContainment(Property property,
                              java.util.Collection values)
INTERNAL: Update containment on the specified collection of values and default to true = update the sequence

Parameters:
property -
values -

writeReplace

public java.lang.Object writeReplace()
INTERNAL: Defined in SDO 2.01 spec on page 65 Externalizable function is called by ObjectStream.writeObject() A replacement object for serialization can be called here.

Security Note: This public function exposes a data replacement vulnerability where an outside client can gain access and modify their non-final constants. We may need to wrap the GZIP streams in some sort of encryption when we are not using HTTPS or SSL/TLS on the wire.

See Also:
SDOResolvable

_getPath

public java.lang.String _getPath()
INTERNAL: Return an SDO Path string from root of the caller to itself

Returns:
String

getPropertyInternal

public java.lang.Object getPropertyInternal(Property property)
INTERNAL: Get the value of the property (open-content or declared)..

Parameters:
property -
Returns:

setPropertyInternal

public void setPropertyInternal(Property property,
                                java.lang.Object value,
                                boolean updateSequence)
INTERNAL: Update the ValueStore with the new property value and update any sequence if it exists.

Parameters:
property -
value -
updateSequence - (truncate call back from sequence when this function was called from sequence)

addOpenContentProperty

public void addOpenContentProperty(Property property)
INTERNAL: Add the open content property into all 3 data structures. Remove the property from the unset map.

Parameters:
property -

removeOpenContentProperty

public void removeOpenContentProperty(Property property)
INTERNAL: Remove the open content property (property) from all 3 data structures. Add the property to the unset map. We restore this OC property in undoChanges

Parameters:
property -

isSetInternal

public boolean isSetInternal(Property property)
INTERNAL: Return whether the property (open-content or declared) is set?

Parameters:
property -
Returns:
true if set, false otherwise

_getSdoRef

public java.lang.String _getSdoRef()
INTERNAL: Return the sdoref attribute value during unmarshaling

Returns:

_setOpenContentPropertiesAttributes

public void _setOpenContentPropertiesAttributes(java.util.List openContentPropertiesAttributes)

_getOpenContentPropertiesAttributes

public java.util.List _getOpenContentPropertiesAttributes()

EclipseLink 1.0_1.0M2 API Reference - Incubation