org.kuali.rice.krad.data.provider.annotation
Annotation Type CollectionRelationship


@Target(value=FIELD)
@Retention(value=RUNTIME)
@Documented
public @interface CollectionRelationship

Defines that the associated Collection field contains a collection of DataObjects.

Analog to the DataObjectCollection metadata.

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

Required Element Summary
 AttributeRelationship[] attributeRelationships
          The list of attribute relationships linking the parent object and the collection objects.
 
Optional Element Summary
 Class<?> collectionElementClass
          The element type of the collection.
 String elementLabel
          When needed, how to label each element of the collection.
 boolean indirectCollection
          Whether this collection uses an indirection table between the parent and collection objects.
 String label
          The label of the collection itself.
 long maxItemsInCollection
          The maximum items that can appear in the collection.
 long minItemsInCollection
          The minimum items that can appear in the collection.
 CollectionSortAttribute[] sortAttributes
          The default sort order for the collection.
 

Element Detail

attributeRelationships

public abstract AttributeRelationship[] attributeRelationships
The list of attribute relationships linking the parent object and the collection objects.

Returns:
list of attribute relationships linking the parent object and the collection objects.

collectionElementClass

public abstract Class<?> collectionElementClass
The element type of the collection.

If the collection contains Generics, it will be derived automatically.

Returns:
the element type of the collection.
Default:
java.lang.Object.class

sortAttributes

public abstract CollectionSortAttribute[] sortAttributes
The default sort order for the collection.

Returns:
the default sort order for the collection.
Default:
{}

minItemsInCollection

public abstract long minItemsInCollection
The minimum items that can appear in the collection.

Returns:
lhe minimum items that can appear in the collection.
Default:
0L

maxItemsInCollection

public abstract long maxItemsInCollection
The maximum items that can appear in the collection.

Returns:
lhe maximum items that can appear in the collection.
Default:
9223372036854775807L

indirectCollection

public abstract boolean indirectCollection
Whether this collection uses an indirection table between the parent and collection objects.

This has no function at present, but is here for informational purposes.

Returns:
whether this collection uses an indirection table between the parent and collection objects.
Default:
false

elementLabel

public abstract String elementLabel
When needed, how to label each element of the collection.

This is usually singular. Will default to the label of the contained element type.

Returns:
how to label each element of the collection.
Default:
""

label

public abstract String label
The label of the collection itself.

This is usually plural.

Returns:
the label of the collection itself.
Default:
""


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