Class MetadataChildBase

java.lang.Object
org.kuali.rice.krad.data.metadata.impl.MetadataCommonBase
org.kuali.rice.krad.data.metadata.impl.MetadataChildBase
All Implemented Interfaces:
Serializable, MetadataCommonInternal, MetadataChild, MetadataCommon
Direct Known Subclasses:
DataObjectCollectionImpl, DataObjectRelationshipImpl

public abstract class MetadataChildBase extends MetadataCommonBase implements MetadataChild
See Also:
  • Field Details

    • embeddedMetadataChild

      protected MetadataChild embeddedMetadataChild
    • relatedType

      protected Class<?> relatedType
    • attributeRelationships

      protected List<DataObjectAttributeRelationship> attributeRelationships
    • inverseRelationship

      protected MetadataChild inverseRelationship
    • savedWithParent

      protected Boolean savedWithParent
    • deletedWithParent

      protected Boolean deletedWithParent
    • loadedAtParentLoadTime

      protected Boolean loadedAtParentLoadTime
    • loadedDynamicallyUponUse

      protected Boolean loadedDynamicallyUponUse
  • Constructor Details

    • MetadataChildBase

      public MetadataChildBase()
  • Method Details

    • isSavedWithParent

      public boolean isSavedWithParent()
      Determines whether object automatically saved

      For related objects, whether this object will be automatically saved when the containing object is persisted.

      Specified by:
      isSavedWithParent in interface MetadataChild
      Returns:
      whether object is automatically saved
    • setSavedWithParent

      public void setSavedWithParent(boolean savedWithParent)
    • isDeletedWithParent

      public boolean isDeletedWithParent()
      Determines whether this object will be automatically deleted when the containing object is deleted.

      This is a special case of the MetadataChild.isSavedWithParent() method. It probably would never be true if the MetadataChild.isSavedWithParent() returns false.

      Specified by:
      isDeletedWithParent in interface MetadataChild
      Returns:
      whether automatically deleted
    • setDeletedWithParent

      public void setDeletedWithParent(boolean deletedWithParent)
    • isLoadedAtParentLoadTime

      public 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.

      Specified by:
      isLoadedAtParentLoadTime in interface MetadataChild
      Returns:
      whether object
    • setLoadedAtParentLoadTime

      public void setLoadedAtParentLoadTime(boolean loadedAtParentLoadTime)
    • isLoadedDynamicallyUponUse

      public 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.)

      Specified by:
      isLoadedDynamicallyUponUse in interface MetadataChild
      Returns:
      whether object loaded automatically with parent
    • setLoadedDynamicallyUponUse

      public void setLoadedDynamicallyUponUse(boolean loadedDynamicallyUponUse)
    • getAttributeRelationships

      public List<DataObjectAttributeRelationship> getAttributeRelationships()
      Gets the parent-child related fields

      Returns the related fields between the parent and child objects.

      Specified by:
      getAttributeRelationships in interface MetadataChild
      Returns:
      related fields. List must not be empty. There always must be at least one related field.
    • setAttributeRelationships

      public void setAttributeRelationships(List<DataObjectAttributeRelationship> attributeRelationships)
    • getInverseRelationship

      public 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.

      Specified by:
      getInverseRelationship in interface MetadataChild
      Returns:
      the inverse of this relationship if it is bi-directional, false otherwise
    • setInverseRelationship

      public void setInverseRelationship(MetadataChild inverseRelationship)
    • getParentAttributeNameRelatedToChildAttributeName

      public 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.

      Specified by:
      getParentAttributeNameRelatedToChildAttributeName in interface MetadataChild
      Returns:
      null if the attribute name given is not part of the key relationship.
    • toString

      public String toString()
      Overrides:
      toString in class MetadataCommonBase
    • getRelatedType

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

      This is the type of the object referenced by this relationship or contained in this collection.

      Specified by:
      getRelatedType in interface MetadataChild
      Returns:
      type of related object
    • setRelatedType

      public void setRelatedType(Class<?> relatedType)
    • getEmbeddedMetadataChild

      public MetadataChild getEmbeddedMetadataChild()
      Gets the metadata from the child
      Returns:
      embedded metadata
    • setEmbeddedMetadataChild

      public void setEmbeddedMetadataChild(MetadataChild embeddedMetadataChild)