org.kuali.rice.krad.bo
Class DataObjectRelationship

java.lang.Object
  extended by org.kuali.rice.krad.bo.DataObjectRelationship
All Implemented Interfaces:
Serializable

public class DataObjectRelationship
extends Object
implements Serializable

Represents a relationship to another class that exists within a given parent class

In terms of relational db, this can be thought of as a foreign key relationship. That is one of the properties (fields) of the parent class (parent table) has a relationship to another class (table)

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Constructor Summary
DataObjectRelationship()
           
DataObjectRelationship(Class<?> parentClass, String parentAttributeName, Class<?> relatedClass)
           
 
Method Summary
 String getChildAttributeForParentAttribute(String parentAttributeName)
          Retrieves the attribute within the related class that is related to the given attribute of the parent class by the relationship represented by this object
 String getParentAttributeForChildAttribute(String childAttributeName)
          Retrieves the attribute within the parent class that is related to the given attribute of the related class by the relationship represented by this object
 String getParentAttributeName()
          Returns the name of the attribute within the parent class that holds the related class object
 Class<?> getParentClass()
          Returns the Class that contains the relationship (the parent)
 Map<String,String> getParentToChildReferences()
          Provides a Map of attribute pairs that make up the relationship, where the map key is the attribute name on the parent class and the map value is the attribute name on the related class
 Class<?> getRelatedClass()
          Returns the class the attribute within the parent class has a relationship to
 String getUserVisibleIdentifierKey()
           
 void setParentToChildReferences(Map<String,String> referenceAttributes)
          Setter for the Map of attributes that participate in the relationship
 void setUserVisibleIdentifierKey(String userVisibleIdentifierKey)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataObjectRelationship

public DataObjectRelationship()

DataObjectRelationship

public DataObjectRelationship(Class<?> parentClass,
                              String parentAttributeName,
                              Class<?> relatedClass)
Method Detail

getParentClass

public Class<?> getParentClass()
Returns the Class that contains the relationship (the parent)

Returns:
Class parent class

getRelatedClass

public Class<?> getRelatedClass()
Returns the class the attribute within the parent class has a relationship to

Returns:
Class related class

getParentAttributeName

public String getParentAttributeName()
Returns the name of the attribute within the parent class that holds the related class object

Note this attribute should be of type given by #getRelatedClass

Returns:
String attribute name within parent class

getParentToChildReferences

public Map<String,String> getParentToChildReferences()
Provides a Map of attribute pairs that make up the relationship, where the map key is the attribute name on the parent class and the map value is the attribute name on the related class

Returns:
Map related attribute pairs

setParentToChildReferences

public void setParentToChildReferences(Map<String,String> referenceAttributes)
Setter for the Map of attributes that participate in the relationship

Parameters:
referenceAttributes -

getParentAttributeForChildAttribute

public String getParentAttributeForChildAttribute(String childAttributeName)
Retrieves the attribute within the parent class that is related to the given attribute of the related class by the relationship represented by this object

Parameters:
childAttributeName - - name of attribute within the related class to find parent attribute for
Returns:
String attribute name within parent class

getChildAttributeForParentAttribute

public String getChildAttributeForParentAttribute(String parentAttributeName)
Retrieves the attribute within the related class that is related to the given attribute of the parent class by the relationship represented by this object

Parameters:
parentAttributeName - - name of attribute within the parent class to find related (child) attribute for
Returns:
String attribute name within the related class

getUserVisibleIdentifierKey

public String getUserVisibleIdentifierKey()

setUserVisibleIdentifierKey

public void setUserVisibleIdentifierKey(String userVisibleIdentifierKey)

toString

public String toString()
Overrides:
toString in class Object


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