Interface MetadataChild

All Superinterfaces:
MetadataCommon, Serializable
All Known Subinterfaces:
DataObjectCollection, DataObjectRelationship
All Known Implementing Classes:
DataObjectCollectionImpl, DataObjectRelationshipImpl, MetadataChildBase

public interface MetadataChild extends MetadataCommon
Non-top-level metadata object

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 Details

    • getRelatedType

      Class<?> getRelatedType()
      Gets the type of related object

      This 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 fields

      Returns 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 relationship

      If 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 saved

      For 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 the isSavedWithParent() returns false.

      Returns:
      whether automatically deleted
    • isLoadedAtParentLoadTime

      boolean isLoadedAtParentLoadTime()
      Determines whether object will be loaded with parent

      For 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 parent

      For 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

      String getParentAttributeNameRelatedToChildAttributeName(String childAttribute)
      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.