Package org.kuali.rice.krad.data
Class CompoundKey
java.lang.Object
org.kuali.rice.krad.data.CompoundKey
- All Implemented Interfaces:
Serializable
Stores the values for a multi-valued key. This is intended primarily for use on
DataObjectService.find(Class, Object) in situations where you have a data object which has a compound
primary key represented by more than one field. In such cases the keys in the map you construction this class with
should be the field names of the primary key fields, and the values in the maps should be the values by which you
want to perform the find.- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCompoundKey(Map<String, ?> keys) Construct a new instance of a CompoundKey from the given key values map. -
Method Summary
Modifier and TypeMethodDescriptiongetKeys()Returns an unmodifable Map of the key values on this CompoundKeybooleanReturns true if any of the fields in this compound key have null values, since that usually indicates an incomplete and unsaved object.
-
Constructor Details
-
CompoundKey
Construct a new instance of a CompoundKey from the given key values map.- Parameters:
keys- map of field name to value for the compound key, must be non-null and non-empty- Throws:
IllegalArgumentException- if the given Map is null or empty
-
-
Method Details
-
getKeys
Returns an unmodifable Map of the key values on this CompoundKey- Returns:
- unmodifiable map of the key values on this CompoundKey
-
hasNullKeyValues
public boolean hasNullKeyValues()Returns true if any of the fields in this compound key have null values, since that usually indicates an incomplete and unsaved object.- Returns:
-