Class RelationshipDefinition

All Implemented Interfaces:
Serializable, Cloneable, Copyable, DataDictionaryDefinition, DictionaryBean

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:
  • Field Details

    • 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 Details

    • RelationshipDefinition

      public RelationshipDefinition()
  • Method Details

    • 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()
    • dataDictionaryPostProcessing

      public void dataDictionaryPostProcessing()
      Description copied from interface: DictionaryBean
      Perform any needed post-processing of the bean properties. This will be called starting at the parent data object entry or document entry class and recursed down though all other DictionaryBean objects contained within.
      Specified by:
      dataDictionaryPostProcessing in interface DictionaryBean
      Overrides:
      dataDictionaryPostProcessing in class DictionaryBeanBase
    • completeValidation

      @Deprecated public void completeValidation(Class rootBusinessObjectClass, Class otherBusinessObjectClass)
      Deprecated.
      Directly validate simple fields, call completeValidation on Definition fields.
      Specified by:
      completeValidation in interface DataDictionaryDefinition
      Overrides:
      completeValidation in class DataDictionaryDefinitionBase
      Parameters:
      rootBusinessObjectClass - Class of the BusinessObjectEntry which ultimately contains this definition
      otherBusinessObjectClass - other stuff required to complete validation
      See Also:
    • completeValidation

      public void completeValidation(Class rootBusinessObjectClass, Class otherBusinessObjectClass, ValidationTrace tracer)
      Directly validate simple fields
      Specified by:
      completeValidation in interface DataDictionaryDefinition
      Overrides:
      completeValidation in class DataDictionaryDefinitionBase
      Parameters:
      rootBusinessObjectClass - Class of the BusinessObjectEntry which ultimately contains this definition
      otherBusinessObjectClass - other stuff required to complete validation
      tracer - ValidationTrace class used to track what was being validated at the time of any problems discovered
      See Also:
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object