Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.0.0)

E10653-01

oracle.jbo.server
Class EntityAssociation

java.lang.Object
  extended by oracle.jbo.common.NamedObjectImpl
      extended by oracle.jbo.mom.DefinitionObject
          extended by oracle.jbo.mom.PersistableDefObject
              extended by oracle.jbo.server.AssociationDefBase
                  extended by oracle.jbo.server.EntityAssociation
All Implemented Interfaces:
ResourceBundleOwner, DefPersistable, PersistentDefinition, Association, VariableManagerOwner, VariableManagerOwnerBase

public class EntityAssociation
extends AssociationDefBase

Describes the relationship between two Entity Objects. An association selects attributes from source and destination Entity Objects. Typically, these attributes represent key fields in a database table, but an association can be defined using any Entity Object attributes. Although an association identifies a source and destination end, the association can be navigated in either direction. Associations have package scope.

The EntityAssociation class determines the content of the AssociationDefImpl attributes on the Entity definitions. The AssociationDefImpl attributes are the attributes at the source Entity and the destination Entity. There are two AssociationDefImpls for each EntityAssociation. For example, in the case of an association between Dept and Emp, Dept will have one AssociationDefImpl attribute for Emp; Emp will have one AssociationDefImpl attribute for Dept. The EntityAssociation links the two AssociationDefImpls.

An instance of the EntityAssociation class maps to the XML file for the association. At runtime, when the XML for the EntityAssociation is read, the framework creates the two AssociationDefImpls and determines whether they are source or destination attributes.

Since:
JDevloper 3.0

Field Summary
protected  AttributeDefImpl[] mBindVars
          The list of AttributeDefImpls as bind variables on one end.
protected  java.lang.Class mComponentClass
           
protected  AttributeDefImpl[] mOtherBindVars
          The list of bind variable AttributeDefImpls on one end.
 
Fields inherited from class oracle.jbo.mom.DefinitionObject
DEF_MDS_CLIENT_KEY, DEF_SCOPE_PERS, DEF_SCOPE_SESSION, DEF_SCOPE_SHARED, mBaseDefObject, mExtendedDefObjects, mObjectResolved, PERSDEF_MDS_CLIENT_KEY
 
Fields inherited from class oracle.jbo.common.NamedObjectImpl
mFullName, mObjName, mParent, mProperties, RES_ID_SUFFIX
 
Fields inherited from interface oracle.jbo.mom.xml.DefPersistable
XML_STATEMENT
 
Constructor Summary
EntityAssociation()
          Constructs an entity association.
EntityAssociation(int defScope, java.lang.String name)
           
EntityAssociation(java.lang.String name)
           
 
Method Summary
 void deregisterSessionObject()
           
 VariableValueManager ensureVariableManager()
          Returns this object's Variable Value Manager.
static EntityAssociation findDefObject(java.lang.String assocName)
           
static EntityAssociation findDefObjectNoSub(java.lang.String assocName)
           
static EntityAssociation findEntityAssociation(java.lang.String entityAssocName)
          Finds the named entity association from the statically maintained list of metaobjects.
protected  void finishedLoading()
           
 AssociationDefImpl getAccessorByEndName(java.lang.String endName)
          Deprecated. Deprecated since 5.0. Instead, use AssociationDefBase.findEndAccessorByName().
static java.lang.String[] getAllDefNames()
           
 java.util.HashMap getAllProperties(java.util.HashMap map, LocaleContext locale)
           
 AssociationEnd getAssociationEnd(java.lang.String endName)
          Deprecated. Deprecated since 5.0. Instead, use AssociationDefBase.findEndByName().
 DefinitionObject getBaseDefObject()
           
 AttributeDefImpl[] getBindVariables()
          Returns the bind variables for one end of the association.
 java.lang.Class getComponentClass()
          Returns the class name of this Entity association's reference.
 int getDefTypeId()
           
 java.lang.String getDefXMLElementTag()
           
 java.lang.String getDefXMLNameSpace()
           
 EntityDefImpl getEntityDef()
          Deprecated. Deprecated since 5.0. Instead, use AssociationDefBase.getSourceOwner() and down cast it to EntityDefImpl.
 java.lang.Class getMessageBundleClass()
          Internal: Applications should not use this method.
protected  ResourceBundleDef getMsgBundleDef(DefElement xmlElement)
          getMsgBundleDef gets the ResourceBundleDef given the DefElement
 AttributeDefImpl[] getOtherBindVariables()
          Returns the bind variables for the other end of the association.
 EntityDefImpl getOtherEntityDef()
          Deprecated. Deprecated since 5.0. Instead, use AssociationDefBase.getDestinationOwner() and down cast it to EntityDefImpl.
 PackageDefImpl getPackageDef()
           
 java.lang.String getPackageName()
           
 PersDefBase getPersDef()
           
 ResourceBundleDef getResourceBundleDef()
          getResourceBundleDef gets the mResourceBundleDef value
 java.lang.String getResourcePrefix()
           
 VariableValueManager getVariableManager()
          Returns this object's current Variable Value Manager.
protected  VariableValueManager[] getVarMgrParents()
           
 boolean hasVariables()
          Returns a flag indicating whether this object has Variables or not.
 void link(AssociationDefImpl srcAccr, AssociationDefImpl dstAccr)
          Establishes a link between two Entity Objects.
protected  void loadProperties(DefElement xmlElement)
           
protected  void loadResourceBundle(DefElement xmlElement)
          loadResourceBundle sets the ResourceBundleDef on EntityDefImpl given the DefElement
protected  void loadVariables(DefElement xmlElement)
           
 void loadXMLContents(DefElement xmlElement, java.lang.String fullName)
           
 void registerDefObject()
          Registers this def object with MetaObjectManager.
 void registerSessionDefObject()
           
protected  java.lang.Object resolvePropertyRaw(java.lang.String property, LocaleContext locale)
           
protected  void resolveReferences()
           
 void setAssociationReverseClause(java.lang.String reverseAssocClause)
           
 void setBaseDefObject(DefinitionObject baseDefObject)
           
 void setBaseDefObject(DefinitionObject baseDefObject, boolean addToBaseDef)
           
 void setBindVariables(AttributeDefImpl[] vars)
          Sets the bind variables for one end of the association.
protected  void setDefForComponent(ComponentObjectImpl comp)
          Set the Component def for Association
 void setMessageBundleClass(java.lang.Class collClass)
          Internal: Applications should not use this method.
 void setName(java.lang.String name)
          Name this object.
protected  void setObjectResolved(boolean objResolved)
           
 void setOtherBindVariables(AttributeDefImpl[] vars)
          Sets the bind variables for the other end of the association.
protected  void setParent(NamedObjectImpl parent)
          Sets this object's parent.
 void setResourceBundleDef(ResourceBundleDef resourceBundleDef)
          setResourceBundleDef sets the mResourceBundleDef value
protected  void unsetDefForComponent(ComponentObjectImpl comp)
          Unset the Component def for Association
 
Methods inherited from class oracle.jbo.server.AssociationDefBase
findEndAccessorByName, findEndByName, getAccessors, getAssociationClause, getAttributeDefImpls, getAttributeDefImplsByEndName, getDefs, getDestinationEnd, getDestinationOwner, getOtherAttributeDefImpls, getReverseAssociationClause, getSourceEnd, getSourceOwner, resolveDefObject, setAssociationClause, setReverseAssociationClause, writeChildren, writeContents
 
Methods inherited from class oracle.jbo.mom.PersistableDefObject
close, createFromXML, getBaseDir, getBasePackage, getDefManager, getDefWriter, getFileName, getFullDirName, getFullFileName, getSubstitutedNames, getXMLElementTag, guaranteePath, isDirty, isEditable, isNew, objectRemoved, registerClass, remove, removeAndDelete, saveXMLContents, setDefaultBaseDir, setDirty, setEditable, setNew, verifyVersion, writeObject, writeVersion, writeXMLContents
 
Methods inherited from class oracle.jbo.mom.DefinitionObject
addExtendedDefObject, addPropertySetName, getContainerDef, getContainerName, getDefScope, getExtendedDefObjects, getMdsKey, getMdsReference, getPropertySetName, getPropertySetNames, hasExtendedDefObjects, isBaseDefFor, isDynamicDefinitionObject, isObjectResolved, loadCustomProperties, loadPropertiesInMap, loadPropertySetNames, loadSchemaProperties, removeExtendedDefObject, setDefScope, setMdsKey, setMdsReference, setPropertySetName
 
Methods inherited from class oracle.jbo.common.NamedObjectImpl
getFullName, getName, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getPropertyMap, getResourcesFromBundle, refreshProperty, removeProperty, removeProperty, requiresNamePrefixedResId, setFullName, setPropertiesMap, setPropertiesMap2, setProperty, setProperty, setPropertyMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jbo.server.Association
getFullName, getName
 
Methods inherited from interface oracle.jbo.VariableManagerOwner
getName
 
Methods inherited from interface oracle.jbo.mom.xml.DefPersistable
getFullName
 

Field Detail

mBindVars

protected AttributeDefImpl[] mBindVars
The list of AttributeDefImpls as bind variables on one end. This field is unused. Will be removed eventually.


mOtherBindVars

protected AttributeDefImpl[] mOtherBindVars
The list of bind variable AttributeDefImpls on one end. This field is unused. Will be removed eventually.


mComponentClass

protected java.lang.Class mComponentClass
Constructor Detail

EntityAssociation

public EntityAssociation()
Constructs an entity association.


EntityAssociation

public EntityAssociation(int defScope,
                         java.lang.String name)

EntityAssociation

public EntityAssociation(java.lang.String name)
Method Detail

getAllDefNames

public static java.lang.String[] getAllDefNames()

findDefObjectNoSub

public static EntityAssociation findDefObjectNoSub(java.lang.String assocName)

findDefObject

public static EntityAssociation findDefObject(java.lang.String assocName)

findEntityAssociation

public static EntityAssociation findEntityAssociation(java.lang.String entityAssocName)
Finds the named entity association from the statically maintained list of metaobjects.

Parameters:
entityAssocName - the fully qualified name of the entity association.
Returns:
an entity association.

getComponentClass

public java.lang.Class getComponentClass()
Returns the class name of this Entity association's reference.

Returns:
an EntityAssociationReference class name.

link

public void link(AssociationDefImpl srcAccr,
                 AssociationDefImpl dstAccr)
Establishes a link between two Entity Objects.

Parameters:
srcAccr - the source Entity Object's association accessor.
dstAccr - the destination Entity Object's association accessor.

setBindVariables

public void setBindVariables(AttributeDefImpl[] vars)
Sets the bind variables for one end of the association.

Parameters:
vars - an array of bind variables.
See Also:
setOtherBindVariables(oracle.jbo.server.AttributeDefImpl[])

getBindVariables

public AttributeDefImpl[] getBindVariables()
Returns the bind variables for one end of the association.

Returns:
an array of bind variables.
See Also:
getOtherBindVariables()

setOtherBindVariables

public void setOtherBindVariables(AttributeDefImpl[] vars)
Sets the bind variables for the other end of the association.

Parameters:
vars - an array of bind variables.
See Also:
setBindVariables(oracle.jbo.server.AttributeDefImpl[])

getOtherBindVariables

public AttributeDefImpl[] getOtherBindVariables()
Returns the bind variables for the other end of the association.

Returns:
an array of bind variables.
See Also:
getBindVariables()

setAssociationReverseClause

public void setAssociationReverseClause(java.lang.String reverseAssocClause)

loadXMLContents

public void loadXMLContents(DefElement xmlElement,
                            java.lang.String fullName)
Overrides:
loadXMLContents in class PersistableDefObject

getDefXMLElementTag

public java.lang.String getDefXMLElementTag()
Specified by:
getDefXMLElementTag in interface PersistentDefinition
Overrides:
getDefXMLElementTag in class PersistableDefObject

setObjectResolved

protected void setObjectResolved(boolean objResolved)
Overrides:
setObjectResolved in class DefinitionObject

resolveReferences

protected void resolveReferences()
Specified by:
resolveReferences in class AssociationDefBase

getDefTypeId

public int getDefTypeId()

setDefForComponent

protected void setDefForComponent(ComponentObjectImpl comp)
Set the Component def for Association


unsetDefForComponent

protected void unsetDefForComponent(ComponentObjectImpl comp)
Unset the Component def for Association


getEntityDef

public EntityDefImpl getEntityDef()
Deprecated. Deprecated since 5.0. Instead, use AssociationDefBase.getSourceOwner() and down cast it to EntityDefImpl.

Gets the entity definition of the source end of the association.

Returns:
the source entity definition.

getOtherEntityDef

public EntityDefImpl getOtherEntityDef()
Deprecated. Deprecated since 5.0. Instead, use AssociationDefBase.getDestinationOwner() and down cast it to EntityDefImpl.

Gets the entity definition of the destination end of the association.

Returns:
the destination entity definition.

getAccessorByEndName

public AssociationDefImpl getAccessorByEndName(java.lang.String endName)
Deprecated. Deprecated since 5.0. Instead, use AssociationDefBase.findEndAccessorByName().

Finds the association accessor given the association end name.

Parameters:
endName - the name of one of the association end.
Returns:
the association accessor definition .

getAssociationEnd

public AssociationEnd getAssociationEnd(java.lang.String endName)
Deprecated. Deprecated since 5.0. Instead, use AssociationDefBase.findEndByName().

Finds the association end given the name.

Parameters:
endName - the name of one of the association end.
Returns:
the association end.

getPackageDef

public PackageDefImpl getPackageDef()

getPackageName

public java.lang.String getPackageName()

getPersDef

public PersDefBase getPersDef()

setMessageBundleClass

public void setMessageBundleClass(java.lang.Class collClass)
Internal: Applications should not use this method.

Sets the implementation class for this Object's Message Bundle class.

Parameters:
collClass - the message bundle implementation class.

getMessageBundleClass

public java.lang.Class getMessageBundleClass()
Internal: Applications should not use this method.

Returns the class of the reference object.

Specified by:
getMessageBundleClass in interface VariableManagerOwnerBase
Returns:
the class of the reference object.

registerDefObject

public void registerDefObject()
Registers this def object with MetaObjectManager. This method should be called for a def object which is created programmatically. When a def object is loaded from an XML file, it is registered directly by the MetaObjectManager, i.e., this method is not invoked.

This method should be called after the def object is all set up and after resolveDefObject() is called.

Overrides:
registerDefObject in class PersistableDefObject

registerSessionDefObject

public void registerSessionDefObject()
Overrides:
registerSessionDefObject in class PersistableDefObject

deregisterSessionObject

public void deregisterSessionObject()
Overrides:
deregisterSessionObject in class PersistableDefObject

getResourceBundleDef

public ResourceBundleDef getResourceBundleDef()
getResourceBundleDef gets the mResourceBundleDef value

Specified by:
getResourceBundleDef in interface ResourceBundleOwner
Specified by:
getResourceBundleDef in interface VariableManagerOwnerBase

getResourcePrefix

public java.lang.String getResourcePrefix()
Specified by:
getResourcePrefix in interface ResourceBundleOwner

setResourceBundleDef

public void setResourceBundleDef(ResourceBundleDef resourceBundleDef)
setResourceBundleDef sets the mResourceBundleDef value

Parameters:
resourceBundleDef - ResourceBundleDef

loadResourceBundle

protected void loadResourceBundle(DefElement xmlElement)
loadResourceBundle sets the ResourceBundleDef on EntityDefImpl given the DefElement

Parameters:
xmlElement - DefElement

getMsgBundleDef

protected ResourceBundleDef getMsgBundleDef(DefElement xmlElement)
getMsgBundleDef gets the ResourceBundleDef given the DefElement

Parameters:
xmlElement - DefElement

setName

public void setName(java.lang.String name)
Name this object.

Overrides:
setName in class DefinitionObject
Parameters:
name - the name to be given to this object.
For internal use only. Application developers should not use this

getBaseDefObject

public DefinitionObject getBaseDefObject()
Overrides:
getBaseDefObject in class DefinitionObject

setBaseDefObject

public void setBaseDefObject(DefinitionObject baseDefObject)
Overrides:
setBaseDefObject in class DefinitionObject

setBaseDefObject

public void setBaseDefObject(DefinitionObject baseDefObject,
                             boolean addToBaseDef)
Overrides:
setBaseDefObject in class DefinitionObject

finishedLoading

protected void finishedLoading()
Overrides:
finishedLoading in class DefinitionObject

setParent

protected void setParent(NamedObjectImpl parent)
Sets this object's parent.

Overrides:
setParent in class DefinitionObject
Parameters:
parent - the named object that is to be the parent of this object.

loadProperties

protected void loadProperties(DefElement xmlElement)
Overrides:
loadProperties in class DefinitionObject
Parameters:
xmlElement - The XML element to load from.

loadVariables

protected void loadVariables(DefElement xmlElement)

getVariableManager

public VariableValueManager getVariableManager()
Description copied from interface: VariableManagerOwnerBase
Returns this object's current Variable Value Manager. It will return null if Variable Value Manager has been initialized.

When a framework object is first created, its Variable Value Manager may be null. This method does not initialize (create) the Variable Value Manager.

VariableManagerOwnerBase.ensureVariableManager() in contrast, ensures that the Variable Value Manager is initialized (created).

Specified by:
getVariableManager in interface VariableManagerOwnerBase
Returns:
this object's current Variable Value Manager. May return null if one was not yet initialized.

getVarMgrParents

protected VariableValueManager[] getVarMgrParents()

hasVariables

public boolean hasVariables()
Description copied from interface: VariableManagerOwnerBase
Returns a flag indicating whether this object has Variables or not.

Specified by:
hasVariables in interface VariableManagerOwnerBase
Returns:
the flag indicating whether this object has Variables.

ensureVariableManager

public VariableValueManager ensureVariableManager()
Description copied from interface: VariableManagerOwnerBase
Returns this object's Variable Value Manager. If this object current has no Variable Value Manager, it will initialize (create) one.

Specified by:
ensureVariableManager in interface VariableManagerOwnerBase
Returns:
this object's Variable Value Manager. Will create a Variable Value Manager if this object had no Variable Value Manager.

getDefXMLNameSpace

public java.lang.String getDefXMLNameSpace()
Specified by:
getDefXMLNameSpace in interface PersistentDefinition
Overrides:
getDefXMLNameSpace in class PersistableDefObject

resolvePropertyRaw

protected java.lang.Object resolvePropertyRaw(java.lang.String property,
                                              LocaleContext locale)
Overrides:
resolvePropertyRaw in class NamedObjectImpl

getAllProperties

public java.util.HashMap getAllProperties(java.util.HashMap map,
                                          LocaleContext locale)
Overrides:
getAllProperties in class NamedObjectImpl

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.0.0)

E10653-01

Copyright © 1997, 2008, Oracle. All rights reserved.