public class DataObjectRelationship extends Object implements Serializable
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)
Constructor and Description |
---|
DataObjectRelationship() |
DataObjectRelationship(Class<?> parentClass,
String parentAttributeName,
Class<?> relatedClass) |
Modifier and Type | Method and Description |
---|---|
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() |
public DataObjectRelationship()
public DataObjectRelationship(Class<?> parentClass, String parentAttributeName, Class<?> relatedClass)
public Class<?> getParentClass()
public Class<?> getRelatedClass()
public String getParentAttributeName()
Note this attribute should be of type given by #getRelatedClass
public Map<String,String> getParentToChildReferences()
public void setParentToChildReferences(Map<String,String> referenceAttributes)
referenceAttributes
- public String getParentAttributeForChildAttribute(String childAttributeName)
childAttributeName
- - name of attribute within the related class to find parent attribute forpublic String getChildAttributeForParentAttribute(String parentAttributeName)
parentAttributeName
- - name of attribute within the parent class to find related (child) attribute forpublic String getUserVisibleIdentifierKey()
public void setUserVisibleIdentifierKey(String userVisibleIdentifierKey)
Copyright © 2005-2015 The Kuali Foundation. All Rights Reserved.