com.ca.jcs.assoc
Class Association

java.lang.Object
  extended by com.ca.jcs.assoc.Association

public class Association
extends Object

Represents associative relationships between objects, using one of two flavours:

For associations configured via metadata refer to constants MetadatUtil.MD_ASSOC_* such as MetaDataDefs.MD_ASSOC_REF_OBJECT_CLASS.


Constructor Summary
Association(MetaObjectClassMapping definingObjectClass, String attribute, String refObjectClassName, String assocReverseAttr)
          Create record of multi-valued direct (objectclass-to-objectclass) association.
Association(MetaObjectClassMapping definingObjectClass, String attribute, String refObjectClassName, String assocReverseAttr, boolean multivalued, boolean virtual, boolean expensive)
          Create record of direct (objectclass-to-objectclass) association.
Association(MetaObjectClassMapping definingObjectClass, String attribute, String refObjectClassName, String assocTable, String assocTableObjColumn, String assocTableRefColumn, String assocReverseAttr, boolean multivalued, boolean virtual, boolean expensive)
          Create record of indirect (via external table) association.
 
Method Summary
 boolean equals(Object obj)
           
static String getAmbiguousMappedToValue(String ambiguousMappedToValue)
          While truly ambiguous associations are not supported, allow unambiguous associations that use ambiguous mappings className:attributeName
static String[] getAmbiguousMappedToValue(String[] ambiguousMappedToValue)
          Return pure attribute Ids for any ambiguously mapped to attributes in className:attributeName format.
 String getAttribute()
           
 String getCompoundLinkAttrId()
          If this assoc has type COMPOUND_PARENT then returns the attribute id on the compound class linking it to the parent whether mapped via 'same' or directly.
 String getCompoundParentAttrId()
          If this assoc has type COMPOUND_PARENT, then returns the attribute in the referenced parent class which contains the compound values, null otherwise.
 MetaObjectClassMapping getDefiningObjectClass()
          Useful when association is stored on "toAssoc" list for a referencing objectClass.
 String getIndirectTable()
           
 String getObjColumn()
           
 String getObjKeyAttr()
           
 String getObjKeyAttrId()
          Return name of connector-speak attribute used as this object's key (either naming attribute or objKeyAttr).
 DataModelProperty getProperty()
           
 String getRefColumn()
           
 String getRefKeyAttr()
           
 String getRefKeyAttrId()
          Return name of attribute used as this object's key (either naming attribute or objKeyAttr).
 MetaObjectClassMapping getRefObjectClass()
           
 String getRefObjectClassName()
           
 String getReverseAttribute()
           
 DataModelProperty getReverseProperty()
           
 MetaDataDefs.AssocType getType()
           
 int hashCode()
           
 boolean isAssocDirectAttributeOpProcessorAssoc()
          Determines associations deemed as suitable for handling in a reverse associative attribute processor (for direct associations where one end defines the association and the reverse end is computed by the processor).
static boolean isAssocExpression(DataModelProperty defProp)
           
 boolean isAssocKey()
           
static boolean isAssocKey(DataModelProperty defProp)
           
 boolean isAssocKeyAttr(String attrId)
          Deprecated.  
 boolean isAssocKeyAttrId(String connAttrId, boolean objKey, boolean refKey)
           
static boolean isAssocTemplate(DataModelProperty defProp)
           
 boolean isExpensive()
           
 boolean isFromAssociation(ObjectClassMapping classMap)
           
 boolean isIndirect()
           
 boolean isMultiValued()
           
 boolean isNormalType()
           
 boolean isToAssociation(ObjectClassMapping classMap)
           
 boolean isVirtual()
           
 void setObjKeyAttr(String objKeyAttr)
           
 void setRefKeyAttr(String refKeyAttr)
           
 void setRefObjectClass(MetaObjectClassMapping refObjectClass)
           
 void setType(MetaDataDefs.AssocType type)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Association

public Association(MetaObjectClassMapping definingObjectClass,
                   String attribute,
                   String refObjectClassName,
                   String assocTable,
                   String assocTableObjColumn,
                   String assocTableRefColumn,
                   String assocReverseAttr,
                   boolean multivalued,
                   boolean virtual,
                   boolean expensive)
Create record of indirect (via external table) association.


Association

public Association(MetaObjectClassMapping definingObjectClass,
                   String attribute,
                   String refObjectClassName,
                   String assocReverseAttr,
                   boolean multivalued,
                   boolean virtual,
                   boolean expensive)
Create record of direct (objectclass-to-objectclass) association.


Association

public Association(MetaObjectClassMapping definingObjectClass,
                   String attribute,
                   String refObjectClassName,
                   String assocReverseAttr)
Create record of multi-valued direct (objectclass-to-objectclass) association.

Method Detail

getAmbiguousMappedToValue

public static String getAmbiguousMappedToValue(String ambiguousMappedToValue)
While truly ambiguous associations are not supported, allow unambiguous associations that use ambiguous mappings className:attributeName

Parameters:
ambiguousMappedToValue -
Returns:
attributeName stripping ambiguous class prefix

getAmbiguousMappedToValue

public static String[] getAmbiguousMappedToValue(String[] ambiguousMappedToValue)
Return pure attribute Ids for any ambiguously mapped to attributes in className:attributeName format.

Parameters:
ambiguousMappedToValue -
Returns:

isIndirect

public boolean isIndirect()

getAttribute

public String getAttribute()

getRefObjectClassName

public String getRefObjectClassName()

getReverseAttribute

public String getReverseAttribute()

getIndirectTable

public String getIndirectTable()

getObjColumn

public String getObjColumn()

getRefColumn

public String getRefColumn()

getObjKeyAttr

public String getObjKeyAttr()

isNormalType

public boolean isNormalType()

getType

public MetaDataDefs.AssocType getType()

setType

public void setType(MetaDataDefs.AssocType type)

setObjKeyAttr

public void setObjKeyAttr(String objKeyAttr)

getRefKeyAttr

public String getRefKeyAttr()

setRefKeyAttr

public void setRefKeyAttr(String refKeyAttr)

isMultiValued

public boolean isMultiValued()

getObjKeyAttrId

public String getObjKeyAttrId()
Return name of connector-speak attribute used as this object's key (either naming attribute or objKeyAttr).


getRefKeyAttrId

public String getRefKeyAttrId()
Return name of attribute used as this object's key (either naming attribute or objKeyAttr).


isVirtual

public boolean isVirtual()

isExpensive

public boolean isExpensive()

isFromAssociation

public boolean isFromAssociation(ObjectClassMapping classMap)

isToAssociation

public boolean isToAssociation(ObjectClassMapping classMap)

getDefiningObjectClass

public MetaObjectClassMapping getDefiningObjectClass()
Useful when association is stored on "toAssoc" list for a referencing objectClass.


getRefObjectClass

public MetaObjectClassMapping getRefObjectClass()

setRefObjectClass

public void setRefObjectClass(MetaObjectClassMapping refObjectClass)

toString

public String toString()
Overrides:
toString in class Object

isAssocKeyAttrId

public boolean isAssocKeyAttrId(String connAttrId,
                                boolean objKey,
                                boolean refKey)

isAssocKeyAttr

@Deprecated
public boolean isAssocKeyAttr(String attrId)
Deprecated. 

Test whether an an attribute corresponds to the key attribute in association

Parameters:
attrId -

isAssocKey

public boolean isAssocKey()

isAssocKey

public static boolean isAssocKey(DataModelProperty defProp)

isAssocTemplate

public static boolean isAssocTemplate(DataModelProperty defProp)

isAssocExpression

public static boolean isAssocExpression(DataModelProperty defProp)

getCompoundParentAttrId

public String getCompoundParentAttrId()
If this assoc has type COMPOUND_PARENT, then returns the attribute in the referenced parent class which contains the compound values, null otherwise.


getCompoundLinkAttrId

public String getCompoundLinkAttrId()
If this assoc has type COMPOUND_PARENT then returns the attribute id on the compound class linking it to the parent whether mapped via 'same' or directly.


isAssocDirectAttributeOpProcessorAssoc

public boolean isAssocDirectAttributeOpProcessorAssoc()
Determines associations deemed as suitable for handling in a reverse associative attribute processor (for direct associations where one end defines the association and the reverse end is computed by the processor). DefaultAssocDirectAttributeOpProcessor


equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getProperty

public DataModelProperty getProperty()

getReverseProperty

public DataModelProperty getReverseProperty()


Created 2011-07-14 13:27 EST