Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.sdo
Class SDOProperty

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

All Implemented Interfaces:
java.io.Serializable

public class SDOProperty
extends java.lang.Object
implements java.io.Serializable

Purpose:A representation of a Property in the type of a data object.

Responsibilities:

See Also:
Serialized Form

Field Summary
private  HelperContext aHelperContext
           
private  java.util.List aliasNames
           
private  java.util.List appInfoElements
           
private  java.util.Map appInfoMap
           
private  SDOType containingType
           
private  java.lang.Object defaultValue
           
private  boolean finalized
           
private  boolean global
           
private  boolean hasMany
           
private  int indexInDeclaredProperties
           
private  int indexInType
           
private static boolean isActivationAvailable
           
private  boolean isContainment
           
private  boolean isDefaultSet
           
private  java.lang.Boolean isElement
           
private  boolean isSubstitutable
           
private  boolean nameCollision
           
private  boolean namespaceQualified
           
private  boolean nullable
           
private  SDOProperty opposite
           
private  java.lang.String propertyName
           
private  java.util.Map<Property,java.lang.Object> propertyValues
           
private  boolean readOnly
           
private  java.util.Collection<SDOProperty> substitutableElements
           
private  SDOType type
           
private  java.lang.String uri
           
private  boolean valueProperty
           
private  DatabaseMapping xmlMapping
           
private  boolean xsd
           
private  java.lang.String xsdLocalName
           
private  javax.xml.namespace.QName xsdType
           

 

Constructor Summary
SDOProperty(HelperContext aContext)
           
SDOProperty(HelperContext aContext, java.lang.String aName)
           
SDOProperty(HelperContext aContext, java.lang.String aName, SDOType aType)
           
SDOProperty(HelperContext aContext, java.lang.String aName, SDOType aType, boolean hasMany)
           
SDOProperty(HelperContext aContext, java.lang.String aUri, java.lang.String aName, SDOType aType)
           

 

Method Summary
 void addMappingToOwner(boolean sdoMethodAttributeAccessor, int indexToAdd)
          INTERNAL:
 void buildChangeSummaryMapping()
          INTERNAL:
 void buildMapping(java.lang.String mappingUri)
          INTERNAL:
 void buildMapping(java.lang.String mappingUri, int indexToAdd)
          INTERNAL:
private  DatabaseMapping buildXMLBinaryDataCollectionMapping(java.lang.String mappingUri, MimeTypePolicy mimeTypePolicy)
           
private  DatabaseMapping buildXMLBinaryDataMapping(java.lang.String mappingUri, MimeTypePolicy mimeTypePolicy)
           
private  DatabaseMapping buildXMLChoiceCollectionMapping(java.lang.String mappingUri)
           
private  DatabaseMapping buildXMLChoiceObjectMapping(java.lang.String mappingUri)
           
private  DatabaseMapping buildXMLCollectionReferenceMapping(java.lang.String mappingUri)
           
private  DatabaseMapping buildXMLCompositeCollectionMapping(java.lang.String mappingUri)
           
private  DatabaseMapping buildXMLCompositeDirectCollectionMapping(java.lang.String mappingUri)
           
private  DatabaseMapping buildXMLCompositeObjectMapping(java.lang.String mappingUri)
           
private  DatabaseMapping buildXMLDirectMapping(java.lang.String mappingUri)
           
 XMLFragmentCollectionMapping buildXMLFragmentCollectionMapping(java.lang.String mappingUri)
           
 XMLFragmentMapping buildXMLFragmentMapping(java.lang.String uri)
           
private  DatabaseMapping buildXMLObjectReferenceMapping(java.lang.String mappingUri)
           
private  DatabaseMapping buildXMLTransformationMapping(java.lang.String mappingUri)
           
 boolean equals(java.lang.Object obj)
          Indicate if a given SDOProperty instance is equal to this instance.
 java.lang.Object get(Property property)
           
 java.util.List getAliasNames()
          Return a list of alias names for this Property.
 java.util.List getAppInfoElements()
          INTERNAL:
 java.util.Map getAppInfoMap()
          INTERNAL:
 SDOType getContainingType()
          Returns the containing type of this Property.
 java.lang.Object getDefault()
          Returns the default value this Property will have in a data object where the Property hasn't been set.
private  SDOProperty getIDProp(Type aType)
          INTERNAL: Get the reference ID open content Property if it exists for this Type.
 int getIndexInDeclaredProperties()
          INTERNAL:
 int getIndexInType()
          INTERNAL:
 java.util.List getInstanceProperties()
           
 MimeTypePolicy getMimeTypePolicy()
          INTERNAL:
 java.lang.String getName()
          Returns the name of the Property.
 SDOProperty getOpposite()
          Returns the opposite Property if the Property is bi-directional or null otherwise.
 java.util.Map getPropertyValues()
          INTERNAL:
 java.lang.String getQualifiedXPath(java.lang.String uri, boolean simple)
          INTERNAL:
private  java.lang.String getQualifiedXPath(java.lang.String uri, boolean simple, SDOType containingType)
           
 java.util.Collection<SDOProperty> getSubstitutableElements()
           
 SDOType getType()
          Returns the type of the Property.
 java.lang.String getUri()
           
 DatabaseMapping getXmlMapping()
          INTERNAL:
 java.lang.String getXPath()
          INTERNAL:
 java.lang.String getXsdLocalName()
          INTERNAL: Returns the local name of the Property.
 javax.xml.namespace.QName getXsdType()
          INTERNAL:
 boolean hasAliasNames()
           
 int hashCode()
          Return a unique hashCode (as an int) for this instance.
 boolean isContainment()
          Returns whether the Property is containment, i.e., whether it represents by-value composition.
 boolean isDefaultSet()
          INTERNAL: Return whether the default value has been set by the schema either via a define by an XSD or a DataObject.
protected  java.lang.Boolean isElement()
          INTERNAL: Return true if the property is an element, false if the property is an attribute, and null if it has not been specified.
 boolean isFinalized()
           
 boolean isGlobal()
          INTERNAL:
 boolean isMany()
          Returns whether the Property is many-valued.
 boolean isNameCollision()
           
 boolean isNamespaceQualified()
          INTERNAL: Returns if the element or attribute corresponding to this Property should be namespace qualified in the XSD.
 boolean isNullable()
           
 boolean isOpenContent()
          Return whether or not this is an open content property.
 boolean isReadOnly()
          Returns true if values for this Property cannot be modified using the SDO APIs.
 boolean isSubstitutable()
           
 boolean isValueProperty()
          INTERNAL:
 boolean isXsd()
          INTERNAL: Returns if this property was declared in an XML schema.
 void setAliasNames(java.util.List names)
          INTERNAL: Set this Property's alias name list which are unique within the Type.
 void setAppInfoElements(java.util.List appInfoElements)
          INTERNAL:
 void setContainingType(Type type)
          INTERNAL: Set the containing type of this Property.
 void setContainment(boolean containment)
          INTERNAL: Set this Property's Containment which shows parent-child relationship in a tree of DataObjects.
 void setDefault(java.lang.Object aDefaultValue)
          INTERNAL: Set the default value of this Property.
 void setFinalized(boolean isFinalized)
           
 void setGlobal(boolean global)
          INTERNAL:
 void setIndexInDeclaredProperties(int indexInDeclaredProperties)
          INTERNAL:
 void setIndexInType(int indexInType)
          INTERNAL:
 void setInstanceProperty(Property property, java.lang.Object value)
           
private  void setIsSetNillablePolicyOnMapping(XMLNillableMapping aMapping, java.lang.Object propertyName)
          INTERNAL: Alter the default state of the policy to act as a nillable null policy
private  void setIsSetOptionalPolicyOnMapping(XMLNillableMapping aMapping, java.lang.Object propertyName)
          INTERNAL Alter the default state of the policy to act as an optional non-nillable null policy
private  AbstractNullPolicy setIsSetPolicyOnMapping(XMLNillableMapping aMapping, java.lang.Object propertyName)
          INTERNAL: Create and set an IsSetNodePolicy on the mapping - leaving the policy in default state
 void setMany(boolean many)
          INTERNAL: Set this property as single-valued(false) or many-valued(true).
 void setName(java.lang.String name)
          INTERNAL: Assign a string as a unique name of this Property among Properties that belongs to a DataObject.
 void setNameCollision(boolean nameCollision)
           
 void setNamespaceQualified(boolean namespaceQualified)
          INTERNAL: Set if the element or attribute corresponding to this Property is namespace qualified in the XSD.
 void setNullable(boolean nullable)
          INTERNAL:
 void setOpposite(Property property)
          INTERNAL: Set the opposite Property.
 void setPropertyValues(java.util.Map properties)
          INTERNAL:
 void setReadOnly(boolean readOnly)
          INTERNAL: Set this Property as read-only Property.
 void setSubstitutable(boolean substitutable)
           
 void setSubstitutableElements(java.util.Collection<SDOProperty> elements)
           
 void setType(Type type)
          INTERNAL: Assign a Type to this Property.
 void setUri(java.lang.String uri)
           
 void setValueProperty(boolean valueProperty)
          INTERNAL:
 void setXmlMapping(DatabaseMapping xmlMapping)
          INTERNAL:
 void setXsd(boolean xsd)
          INTERNAL: Set if this property was declared in an XML schema.
 void setXsdLocalName(java.lang.String xsdLocalName)
          INTERNAL: Set the local name of this property.
 void setXsdType(javax.xml.namespace.QName xsdType)
          INTERNAL:
private  boolean shouldAddInstanceClassConverter()
           
private  void updateType()
           

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

propertyName

private java.lang.String propertyName

type

private SDOType type

containingType

private SDOType containingType

isContainment

private boolean isContainment

hasMany

private boolean hasMany

readOnly

private boolean readOnly

aliasNames

private java.util.List aliasNames

defaultValue

private java.lang.Object defaultValue

isDefaultSet

private boolean isDefaultSet

indexInType

private int indexInType

indexInDeclaredProperties

private int indexInDeclaredProperties

opposite

private SDOProperty opposite

xsd

private boolean xsd

xsdLocalName

private java.lang.String xsdLocalName

isElement

private java.lang.Boolean isElement

global

private boolean global

namespaceQualified

private boolean namespaceQualified

xmlMapping

private transient DatabaseMapping xmlMapping

propertyValues

private java.util.Map<Property,java.lang.Object> propertyValues

nullable

private boolean nullable

xsdType

private javax.xml.namespace.QName xsdType

valueProperty

private boolean valueProperty

appInfoElements

private java.util.List appInfoElements

appInfoMap

private java.util.Map appInfoMap

nameCollision

private boolean nameCollision

uri

private java.lang.String uri

isSubstitutable

private boolean isSubstitutable

substitutableElements

private java.util.Collection<SDOProperty> substitutableElements

finalized

private boolean finalized

isActivationAvailable

private static boolean isActivationAvailable

aHelperContext

private HelperContext aHelperContext

Constructor Detail

SDOProperty

public SDOProperty(HelperContext aContext)

SDOProperty

public SDOProperty(HelperContext aContext,
                   java.lang.String aName)

SDOProperty

public SDOProperty(HelperContext aContext,
                   java.lang.String aName,
                   SDOType aType)

SDOProperty

public SDOProperty(HelperContext aContext,
                   java.lang.String aName,
                   SDOType aType,
                   boolean hasMany)

SDOProperty

public SDOProperty(HelperContext aContext,
                   java.lang.String aUri,
                   java.lang.String aName,
                   SDOType aType)

Method Detail

getName

public java.lang.String getName()
Returns the name of the Property.
Returns:
the Property name.

getType

public SDOType getType()
Returns the type of the Property.
Returns:
the Property type.

isMany

public boolean isMany()
Returns whether the Property is many-valued.
Returns:
true if the Property is many-valued.

isOpenContent

public boolean isOpenContent()
Return whether or not this is an open content property.
Returns:
true if this property is an open content property.

isContainment

public boolean isContainment()
Returns whether the Property is containment, i.e., whether it represents by-value composition.
Returns:
true if the Property is containment.

getContainingType

public SDOType getContainingType()
Returns the containing type of this Property.
Returns:
the Property's containing type.
See Also:
Type#getProperties()

getDefault

public java.lang.Object getDefault()
Returns the default value this Property will have in a data object where the Property hasn't been set.
Returns:
the default value.

isReadOnly

public boolean isReadOnly()
Returns true if values for this Property cannot be modified using the SDO APIs. When true, DataObject.set(Property property, Object value) throws an exception. Values may change due to other factors, such as services operating on DataObjects.
Returns:
true if values for this Property cannot be modified.

getOpposite

public SDOProperty getOpposite()
Returns the opposite Property if the Property is bi-directional or null otherwise.
Returns:
the opposite Property if the Property is bi-directional or null

hasAliasNames

public boolean hasAliasNames()

getAliasNames

public java.util.List getAliasNames()
Return a list of alias names for this Property.
Returns:
a list of alias names for this Property.

setName

public void setName(java.lang.String name)
INTERNAL: Assign a string as a unique name of this Property among Properties that belongs to a DataObject.
Parameters:
name - a string representing unique name of a property of a DataObject.

setType

public void setType(Type type)
INTERNAL: Assign a Type to this Property.
Parameters:
type - the type of this property.

setContainment

public void setContainment(boolean containment)
INTERNAL: Set this Property's Containment which shows parent-child relationship in a tree of DataObjects.
Parameters:
containment - a boolean value showing if this Property is containment.

setMany

public void setMany(boolean many)
INTERNAL: Set this property as single-valued(false) or many-valued(true). Default is false.
Parameters:
many - a boolean value if this property is many-valued or not.

setReadOnly

public void setReadOnly(boolean readOnly)
INTERNAL: Set this Property as read-only Property.
Parameters:
readOnly - boolean value implying this Property is readonly.

setAliasNames

public void setAliasNames(java.util.List names)
INTERNAL: Set this Property's alias name list which are unique within the Type.
Parameters:
names - a list of alias name of this Property.

setContainingType

public void setContainingType(Type type)
INTERNAL: Set the containing type of this Property.
Parameters:
type - a Type which is the containing type of this Property

setDefault

public void setDefault(java.lang.Object aDefaultValue)
INTERNAL: Set the default value of this Property.
Parameters:
aDefaultValue - an Object to be the default value of this type.

setOpposite

public void setOpposite(Property property)
INTERNAL: Set the opposite Property. If not null then this Property is a of a bi-directional Property.
Parameters:
the - opposite Property if the Property is bi-directional, otherwise null

setXsd

public void setXsd(boolean xsd)
INTERNAL: Set if this property was declared in an XML schema.
Parameters:
xsd - a boolean representing if this property was declared in an XML schema

isXsd

public boolean isXsd()
INTERNAL: Returns if this property was declared in an XML schema. Defaults to false.
Returns:
if this property was declared in an XML schema

setXsdLocalName

public void setXsdLocalName(java.lang.String xsdLocalName)
INTERNAL: Set the local name of this property.
Parameters:
xsdLocalName - a String representing the local name of this property if it was declared in an XML schema

getXsdLocalName

public java.lang.String getXsdLocalName()
INTERNAL: Returns the local name of the Property.
Returns:
the local name of the property.

setNamespaceQualified

public void setNamespaceQualified(boolean namespaceQualified)
INTERNAL: Set if the element or attribute corresponding to this Property is namespace qualified in the XSD.
Parameters:
namespaceQualified - a boolean representing if the element or attribute corresponding to this Property is namespace qualified in the XSD.

isNamespaceQualified

public boolean isNamespaceQualified()
INTERNAL: Returns if the element or attribute corresponding to this Property should be namespace qualified in the XSD.
Returns:
if the element or attribute corresponding to this Property should be namespace qualified in the XSD.

setXmlMapping

public void setXmlMapping(DatabaseMapping xmlMapping)
INTERNAL:

getXmlMapping

public DatabaseMapping getXmlMapping()
INTERNAL:

setGlobal

public void setGlobal(boolean global)
INTERNAL:

isGlobal

public boolean isGlobal()
INTERNAL:

isElement

protected java.lang.Boolean isElement()
INTERNAL: Return true if the property is an element, false if the property is an attribute, and null if it has not been specified. This property has been added as a performance optimization to reduce the number of Maps created for the propertyValues property.

setIsSetNillablePolicyOnMapping

private void setIsSetNillablePolicyOnMapping(XMLNillableMapping aMapping,
                                             java.lang.Object propertyName)
INTERNAL: Alter the default state of the policy to act as a nillable null policy
Parameters:
aMapping -
propertyName -

setIsSetOptionalPolicyOnMapping

private void setIsSetOptionalPolicyOnMapping(XMLNillableMapping aMapping,
                                             java.lang.Object propertyName)
INTERNAL Alter the default state of the policy to act as an optional non-nillable null policy
Parameters:
aMapping -
propertyName -

setIsSetPolicyOnMapping

private AbstractNullPolicy setIsSetPolicyOnMapping(XMLNillableMapping aMapping,
                                                   java.lang.Object propertyName)
INTERNAL: Create and set an IsSetNodePolicy on the mapping - leaving the policy in default state
Parameters:
aMapping -
propertyName -
Returns:

buildMapping

public void buildMapping(java.lang.String mappingUri)
INTERNAL:

buildMapping

public void buildMapping(java.lang.String mappingUri,
                         int indexToAdd)
INTERNAL:

buildChangeSummaryMapping

public void buildChangeSummaryMapping()
INTERNAL:

addMappingToOwner

public void addMappingToOwner(boolean sdoMethodAttributeAccessor,
                              int indexToAdd)
INTERNAL:

buildXMLBinaryDataMapping

private DatabaseMapping buildXMLBinaryDataMapping(java.lang.String mappingUri,
                                                  MimeTypePolicy mimeTypePolicy)

buildXMLBinaryDataCollectionMapping

private DatabaseMapping buildXMLBinaryDataCollectionMapping(java.lang.String mappingUri,
                                                            MimeTypePolicy mimeTypePolicy)

buildXMLTransformationMapping

private DatabaseMapping buildXMLTransformationMapping(java.lang.String mappingUri)

buildXMLDirectMapping

private DatabaseMapping buildXMLDirectMapping(java.lang.String mappingUri)

buildXMLCompositeDirectCollectionMapping

private DatabaseMapping buildXMLCompositeDirectCollectionMapping(java.lang.String mappingUri)

buildXMLCompositeCollectionMapping

private DatabaseMapping buildXMLCompositeCollectionMapping(java.lang.String mappingUri)

buildXMLCompositeObjectMapping

private DatabaseMapping buildXMLCompositeObjectMapping(java.lang.String mappingUri)

buildXMLObjectReferenceMapping

private DatabaseMapping buildXMLObjectReferenceMapping(java.lang.String mappingUri)

buildXMLChoiceObjectMapping

private DatabaseMapping buildXMLChoiceObjectMapping(java.lang.String mappingUri)

buildXMLChoiceCollectionMapping

private DatabaseMapping buildXMLChoiceCollectionMapping(java.lang.String mappingUri)

getIDProp

private SDOProperty getIDProp(Type aType)
INTERNAL: Get the reference ID open content Property if it exists for this Type.
Returns:
id Property or null

buildXMLCollectionReferenceMapping

private DatabaseMapping buildXMLCollectionReferenceMapping(java.lang.String mappingUri)

shouldAddInstanceClassConverter

private boolean shouldAddInstanceClassConverter()

getXPath

public java.lang.String getXPath()
INTERNAL:

getQualifiedXPath

public java.lang.String getQualifiedXPath(java.lang.String uri,
                                          boolean simple)
INTERNAL:

getQualifiedXPath

private java.lang.String getQualifiedXPath(java.lang.String uri,
                                           boolean simple,
                                           SDOType containingType)

get

public java.lang.Object get(Property property)

getInstanceProperties

public java.util.List getInstanceProperties()

setPropertyValues

public void setPropertyValues(java.util.Map properties)
INTERNAL:

getPropertyValues

public java.util.Map getPropertyValues()
INTERNAL:

setInstanceProperty

public void setInstanceProperty(Property property,
                                java.lang.Object value)

setIndexInType

public void setIndexInType(int indexInType)
INTERNAL:

getIndexInType

public int getIndexInType()
INTERNAL:

setNullable

public void setNullable(boolean nullable)
INTERNAL:

isNullable

public boolean isNullable()

setXsdType

public void setXsdType(javax.xml.namespace.QName xsdType)
INTERNAL:

getXsdType

public javax.xml.namespace.QName getXsdType()
INTERNAL:

getMimeTypePolicy

public MimeTypePolicy getMimeTypePolicy()
INTERNAL:

setIndexInDeclaredProperties

public void setIndexInDeclaredProperties(int indexInDeclaredProperties)
INTERNAL:

getIndexInDeclaredProperties

public int getIndexInDeclaredProperties()
INTERNAL:

setValueProperty

public void setValueProperty(boolean valueProperty)
INTERNAL:

isValueProperty

public boolean isValueProperty()
INTERNAL:

setAppInfoElements

public void setAppInfoElements(java.util.List appInfoElements)
INTERNAL:

getAppInfoElements

public java.util.List getAppInfoElements()
INTERNAL:

getAppInfoMap

public java.util.Map getAppInfoMap()
INTERNAL:

setNameCollision

public void setNameCollision(boolean nameCollision)

isNameCollision

public boolean isNameCollision()

isDefaultSet

public boolean isDefaultSet()
INTERNAL: Return whether the default value has been set by the schema either via a define by an XSD or a DataObject.
Returns:
isDefaultSet

setUri

public void setUri(java.lang.String uri)

getUri

public java.lang.String getUri()

buildXMLFragmentMapping

public XMLFragmentMapping buildXMLFragmentMapping(java.lang.String uri)

buildXMLFragmentCollectionMapping

public XMLFragmentCollectionMapping buildXMLFragmentCollectionMapping(java.lang.String mappingUri)

isSubstitutable

public boolean isSubstitutable()

setSubstitutable

public void setSubstitutable(boolean substitutable)

getSubstitutableElements

public java.util.Collection<SDOProperty> getSubstitutableElements()

setSubstitutableElements

public void setSubstitutableElements(java.util.Collection<SDOProperty> elements)

setFinalized

public void setFinalized(boolean isFinalized)

isFinalized

public boolean isFinalized()

hashCode

public int hashCode()
Return a unique hashCode (as an int) for this instance.
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Indicate if a given SDOProperty instance is equal to this instance. Equality is determined based on name, uri, and type. In addition, checking will be done to ensure that both properties are to be serialized in the same manner, ie. both to XML element or both to XML attribute.
Overrides:
equals in class java.lang.Object
Parameters:
obj - Object to compare to this SDOProperty instance
Returns:
true if obj is equal to this SDOProperty instance, false if not

updateType

private void updateType()

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.