Interface MetadataChild
- All Superinterfaces:
MetadataCommon,Serializable
- All Known Subinterfaces:
DataObjectCollection,DataObjectRelationship
- All Known Implementing Classes:
DataObjectCollectionImpl,DataObjectRelationshipImpl,MetadataChildBase
Interface shared by all non-top-level metadata objects which link to other persistable objects. This is used as the base interface for 1:1/M:1 Relationships and 1:M/N:M Collections.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Method Summary
Modifier and TypeMethodDescriptionGets the parent-child related fieldsGets bi-directional relationshipgetParentAttributeNameRelatedToChildAttributeName(String childAttribute) Gets foreign key attribute from parent.Class<?> Gets the type of related objectbooleanDetermines whether this object will be automatically deleted when the containing object is deleted.booleanDetermines whether object will be loaded with parentbooleanDetermines whether the object is reloaded automatically with parentbooleanDetermines whether object automatically savedMethods inherited from interface org.kuali.rice.krad.data.metadata.MetadataCommon
getBackingObjectName, getDescription, getLabel, getMergeAction, getName, getShortLabel, isReadOnly
-
Method Details
-
getRelatedType
Class<?> getRelatedType()Gets the type of related objectThis is the type of the object referenced by this relationship or contained in this collection.
- Returns:
- type of related object
-
getAttributeRelationships
List<DataObjectAttributeRelationship> getAttributeRelationships()Gets the parent-child related fieldsReturns the related fields between the parent and child objects.
- Returns:
- related fields. List must not be empty. There always must be at least one related field.
-
getInverseRelationship
MetadataChild getInverseRelationship()Gets bi-directional relationshipIf this metadata element is part of a bi-directional relationship, this method returns the other side of the bi-directional relationship.
- Returns:
- the inverse of this relationship if it is bi-directional, false otherwise
-
isSavedWithParent
boolean isSavedWithParent()Determines whether object automatically savedFor related objects, whether this object will be automatically saved when the containing object is persisted.
- Returns:
- whether object is automatically saved
-
isDeletedWithParent
boolean isDeletedWithParent()Determines whether this object will be automatically deleted when the containing object is deleted.This is a special case of the
isSavedWithParent()method. It probably would never be true if theisSavedWithParent()returns false.- Returns:
- whether automatically deleted
-
isLoadedAtParentLoadTime
boolean isLoadedAtParentLoadTime()Determines whether object will be loaded with parentFor related objects, whether this related object will be loaded from the persistence layer at the same time as the parent object.
If false, the object will be loaded upon demand, either via automatic lazy-loading provided by the infrastructure or by explicit request.
- Returns:
- whether object
-
isLoadedDynamicallyUponUse
boolean isLoadedDynamicallyUponUse()Determines whether the object is reloaded automatically with parentFor related objects, whether this related object will be loaded from the persistence layer automatically when it is accessed by client code.
If false, then the object must be refreshed manually by client code. (Though such a refresh may be possible by requesting the refresh from the persistence provider.)
- Returns:
- whether object loaded automatically with parent
-
getParentAttributeNameRelatedToChildAttributeName
Gets foreign key attribute from parent.For a given child key attribute, return the matching foreign key attribute on the parent object.
- Returns:
- null if the attribute name given is not part of the key relationship.
-