org.kuali.rice.krad.data.metadata
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 Summary
 DataObjectAttribute getAttribute(String attributeName)
          Get the named attribute's metadata from the data object.
 List<DataObjectAttribute> getAttributes()
          Get all the attributes defined on the data object in the order given by the MetadataProvider.
 Collection<UifAutoCreateViewType> getAutoCreateUifViewTypes()
           
 List<String> getBusinessKeyAttributeNames()
          List of attribute names which form a "user friendly" key.
 DataObjectCollection getCollection(String collectionName)
          Get the named collection's metadata from the data object.
 List<DataObjectCollection> getCollections()
          Get all the child collections defined on the data object in the order given by the MetadataProvider.
 String getPrimaryDisplayAttributeName()
          This is the field on the object which best represents it on displays.
 List<String> getPrimaryKeyAttributeNames()
          Get the list of primary key attribute names for this data object.
 DataObjectRelationship getRelationship(String relationshipName)
          Get the named relationship's metadata from the data object.
 DataObjectRelationship getRelationshipByLastAttributeInRelationship(String attributeName)
          Returns a single relationship for which the given attribute is the last in the foreign key relationship.
 List<DataObjectRelationship> getRelationships()
          Get all the child relationships defined on the data object in the order given by the MetadataProvider.
 List<DataObjectRelationship> getRelationshipsInvolvingAttribute(String attributeName)
          Returns all relationships of which the given attribute is part of the foreign key relationship.
 Class<?> getType()
          The type represented by this metadata object.
 Boolean hasDistinctBusinessKey()
          Returns true if the list of primary key names and business key attribute names are different.
 boolean isSupportsOptimisticLocking()
          Returns true if the underlying ORM tool performs optimistic locking checks on this object before saving.
 boolean shouldAutoCreateUifViewOfType(UifAutoCreateViewType viewType)
           
 
Methods inherited from interface org.kuali.rice.krad.data.metadata.MetadataCommon
getBackingObjectName, getDescription, getLabel, getMergeAction, getName, getShortLabel, isReadOnly
 

Method Detail

getType

Class<?> getType()
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. Will never return null.


getAttributes

List<DataObjectAttribute> getAttributes()
Get 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) Will never return null. Will return an empty list if no attributes defined.


getCollections

List<DataObjectCollection> getCollections()
Get all the child collections defined on the data object in the order given by the MetadataProvider. Will never return null. Will return an empty list if no collections defined.


getRelationships

List<DataObjectRelationship> getRelationships()
Get all the child relationships defined on the data object in the order given by the MetadataProvider. Will never return null. Will return an empty list if no relationships defined.


getAttribute

DataObjectAttribute getAttribute(String attributeName)
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)
Get 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)
Get 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)
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)
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.


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()
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()
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

getAutoCreateUifViewTypes

Collection<UifAutoCreateViewType> getAutoCreateUifViewTypes()

shouldAutoCreateUifViewOfType

boolean shouldAutoCreateUifViewOfType(UifAutoCreateViewType viewType)


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.