org.kuali.rice.krad.datadictionary
Class RelationshipDefinition

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.DictionaryBeanBase
      extended by org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase
          extended by org.kuali.rice.krad.datadictionary.RelationshipDefinition
All Implemented Interfaces:
Serializable, DataDictionaryDefinition, DictionaryBean, org.springframework.beans.factory.InitializingBean

public class RelationshipDefinition
extends DataDictionaryDefinitionBase

A single Relationship definition in the DataDictionary, which contains information concerning which primitive attributes of this class can be used to retrieve an instance of some related Object instance The relationship element defines how primitive attributes of this class can be used to retrieve an instance of some related Object instance DD: See RelationshipDefinition.java. JSTL: relationship is a Map which is accessed using a key which is the objectAttributeName of a relationship. The map contains a single entry with a key of "primitiveAttributes" and value which is an attributesMap ExportMap. The attributesMap ExportMap contains the following keys: 0 (for first primitiveAttribute) 1 (for second primitiveAttribute) etc. The corresponding value for each entry is an primitiveAttribute ExportMap which contains the following keys: "sourceName" "targetName"

See Also:
Serialized Form

Field Summary
protected  String objectAttributeName
           
protected  List<PrimitiveAttributeDefinition> primitiveAttributes
           
protected  Class<?> sourceClass
           
protected  List<SupportAttributeDefinition> supportAttributes
           
protected  Class<?> targetClass
          For 1:1 relationships, this class represents the type of the reference class.
 
Fields inherited from class org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase
id
 
Constructor Summary
RelationshipDefinition()
           
 
Method Summary
 void completeValidation(Class rootBusinessObjectClass, Class otherBusinessObjectClass)
          Directly validate simple fields, call completeValidation on Definition fields.
 void completeValidation(Class rootBusinessObjectClass, Class otherBusinessObjectClass, ValidationTrace tracer)
          Directly validate simple fields
 SupportAttributeDefinition getIdentifier()
           
 String getObjectAttributeName()
           
 List<PrimitiveAttributeDefinition> getPrimitiveAttributes()
           
 Class<?> getSourceClass()
           
 List<SupportAttributeDefinition> getSupportAttributes()
           
 Class<?> getTargetClass()
          Returns the targetClass
 boolean hasIdentifier()
           
 void setObjectAttributeName(String objectAttributeName)
          Name of the business object property on the containing business object that is linked by the contained PrimitiveAttributeDefinition objects.
 void setPrimitiveAttributes(List<PrimitiveAttributeDefinition> primitiveAttributes)
          The primitiveAttribute element identifies one pair of corresponding fields in the primary business object and the related business object.
 void setSourceClass(Class<?> sourceClass)
           
 void setSupportAttributes(List<SupportAttributeDefinition> supportAttributes)
          Support attributes define additional attributes that can be used to generate lookup field conversions and lookup parameters.
 void setTargetClass(Class<?> targetClass)
          Sets the targetClass
 String toString()
           
 
Methods inherited from class org.kuali.rice.krad.datadictionary.DataDictionaryDefinitionBase
afterPropertiesSet, getId, setId
 
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
getComponentCode, getNamespaceCode
 

Field Detail

objectAttributeName

protected String objectAttributeName

sourceClass

protected Class<?> sourceClass

targetClass

protected Class<?> targetClass
For 1:1 relationships, this class represents the type of the reference class. For 1:n references, this class represents the type of the element of the collection


primitiveAttributes

protected List<PrimitiveAttributeDefinition> primitiveAttributes

supportAttributes

protected List<SupportAttributeDefinition> supportAttributes
Constructor Detail

RelationshipDefinition

public RelationshipDefinition()
Method Detail

getObjectAttributeName

public String getObjectAttributeName()

getSourceClass

public Class<?> getSourceClass()

getTargetClass

public Class<?> getTargetClass()
Returns the targetClass


setTargetClass

public void setTargetClass(Class<?> targetClass)
Sets the targetClass

Parameters:
targetClass -

setObjectAttributeName

public void setObjectAttributeName(String objectAttributeName)
Name of the business object property on the containing business object that is linked by the contained PrimitiveAttributeDefinition objects.


getPrimitiveAttributes

public List<PrimitiveAttributeDefinition> getPrimitiveAttributes()

getSupportAttributes

public List<SupportAttributeDefinition> getSupportAttributes()

hasIdentifier

public boolean hasIdentifier()

getIdentifier

public SupportAttributeDefinition getIdentifier()

completeValidation

public void completeValidation(Class rootBusinessObjectClass,
                               Class otherBusinessObjectClass)
Directly validate simple fields, call completeValidation on Definition fields.

Parameters:
rootBusinessObjectClass - Class of the BusinessObjectEntry which ultimately contains this definition
otherBusinessObjectClass - other stuff required to complete validation
See Also:
DataDictionaryEntry.completeValidation()

completeValidation

public void completeValidation(Class rootBusinessObjectClass,
                               Class otherBusinessObjectClass,
                               ValidationTrace tracer)
Directly validate simple fields

See Also:
DataDictionaryEntry.completeValidation(org.kuali.rice.krad.datadictionary.validator.ValidationTrace)

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

setPrimitiveAttributes

public void setPrimitiveAttributes(List<PrimitiveAttributeDefinition> primitiveAttributes)
The primitiveAttribute element identifies one pair of corresponding fields in the primary business object and the related business object. JSTL: primitiveAttribute is a Map which is accessed by the sequential key of "0", "1", etc. Each entry contains the following keys: sourceName (String) targetName (String) The value corresponding to the sourceName key is the attribute name defined for the primary business object. The value corresponding to the targetName key is the attribute name for the object being referenced by objectAttributeName.


setSupportAttributes

public void setSupportAttributes(List<SupportAttributeDefinition> supportAttributes)
Support attributes define additional attributes that can be used to generate lookup field conversions and lookup parameters. Field conversions and lookup parameters are normally generated using foreign key relationships defined within OJB and the DD. Because Person objects are linked in a special way (i.e. they may come from an external data source and not from the DB, such as LDAP), it is often necessary to define extra fields that are related to each other, sort of like a supplemental foreign key. sourceName is the name of the POJO property of the business object targetName is the name of attribute that corresponds to the sourceName in the looked up BO identifier when true, only the field marked as an identifier will be passed in as a lookup parameter at most one supportAttribute for each relationship should be defined as identifier="true"


setSourceClass

public void setSourceClass(Class<?> sourceClass)
Parameters:
sourceClass - the sourceClass to set


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.