Interface DataObjectMetadata

All Superinterfaces:
MetadataCommon, Serializable
All Known Subinterfaces:
DataObjectMetadataInternal
All Known Implementing Classes:
DataObjectMetadataImpl

public interface DataObjectMetadata extends MetadataCommon
Metadata for a given data object type.

References the data object class and contains lists of all the attributes, collections, and relationships within the class.

Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Method Details

    • getType

      Class<?> getType()
      Gets metadata object type.

      The type represented by this metadata object. Usually this will simply contain the class name created by the persistence layer when it is loaded from the database.

      Returns:
      metadata object type. Will never return null.
    • getAttributes

      List<DataObjectAttribute> getAttributes()
      Gets attributes defined on the data object.

      Gets all the attributes defined on the data object in the order given by the MetadataProvider. This may or may not be the same as the backing object's (table) and is most likely the order in which they appear in the source persistence metadata (XML or annotations).

      Returns:
      Data object attributes. Will never return null. Will return an empty list if no attributes defined.
    • getCollections

      List<DataObjectCollection> getCollections()
      Gets child collections.

      Gets all the child collections defined on the data object in the order given by the MetadataProvider.

      Returns:
      Child collections. Will never return null. Will return an empty list if no collections defined.
    • getRelationships

      List<DataObjectRelationship> getRelationships()
      Gets child relationships.

      Gets all the child relationships defined on the data object in the order given by the MetadataProvider.

      Returns:
      Child relationships. Will never return null. Will return an empty list if no relationships defined.
    • getAttribute

      DataObjectAttribute getAttribute(String attributeName)
      Gets attribute metadata.

      Get the named attribute's metadata from the data object.

      Returns:
      null if the attributeName does not exist, the associated DataObjectAttribute otherwise.
    • getCollection

      DataObjectCollection getCollection(String collectionName)
      Gets the named collection's metadata from the data object.

      The name is the property on the data object which holds the Collection.

      Returns:
      null if the attributeName does not exist, the associated DataObjectCollection otherwise.
    • getRelationship

      DataObjectRelationship getRelationship(String relationshipName)
      Gets the named relationship's metadata from the data object.

      The name is the property on the data object which holds the related business object's instance.

      Returns:
      null if the attributeName does not exist, the associated DataObjectRelationship otherwise.
    • getRelationshipsInvolvingAttribute

      List<DataObjectRelationship> getRelationshipsInvolvingAttribute(String attributeName)
      Gets attribute relationships.

      Returns all relationships of which the given attribute is part of the foreign key relationship.

      Returns:
      The list of relationship metadata objects or an empty list if none found.
    • getRelationshipByLastAttributeInRelationship

      DataObjectRelationship getRelationshipByLastAttributeInRelationship(String attributeName)
      Gets relationship of last attribute.

      Returns a single relationship for which the given attribute is the last in the foreign key relationship.

      Returns:
      null if no relationship's foreign key set ends wit the given field. The DataObjectRelationship otherwise.
    • getPrimaryKeyAttributeNames

      List<String> getPrimaryKeyAttributeNames()
      Get the list of primary key attribute names for this data object.
      Returns:
      primary key attribute names.
    • getBusinessKeyAttributeNames

      List<String> getBusinessKeyAttributeNames()
      List of attribute names which form a "user friendly" key. (As opposed to a sequence number as used by some parts of the system).

      An example here would be the KIM Role object where the Role ID is the primary key, but the Namespace and Name properties form the user-visible and enterable key.

      Returns:
      a list containing the business key attributes names for the data object.
    • hasDistinctBusinessKey

      Boolean hasDistinctBusinessKey()
      Returns true if the list of primary key names and business key attribute names are different.
      Returns:
      true if the list of primary key names and business key attributes are different, false if they are the same.
    • getPrimaryDisplayAttributeName

      String getPrimaryDisplayAttributeName()
      Gets primary display attribute name

      This is the field on the object which best represents it on displays. It will be used to build inquiry links and determine where to place quickfinder links. Usually this will be the the primary key or the last field of the primary key if there are multiple fields.

      If not specified by the provider, the base implementation will default it to the last attribute in the primaryKeyAttributeNames list.

      Returns:
      the name of the attribute to use for primary display purposes.
    • isSupportsOptimisticLocking

      boolean isSupportsOptimisticLocking()
      Determines whether optimistic locking is supported.

      Returns true if the underlying ORM tool performs optimistic locking checks on this object before saving. Under the KNS, this was done via the versionNumber property and appropriate OJB configuration. In JPA, this is linked to the @Version annotation.

      Returns:
      true if this data object is configured for optimistic locking.