Class CompoundKey

java.lang.Object
org.kuali.rice.krad.data.CompoundKey
All Implemented Interfaces:
Serializable

public final class CompoundKey extends Object implements 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

    Constructors
    Constructor
    Description
    Construct a new instance of a CompoundKey from the given key values map.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an unmodifable Map of the key values on this CompoundKey
    boolean
    Returns true if any of the fields in this compound key have null values, since that usually indicates an incomplete and unsaved object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CompoundKey

      public CompoundKey(Map<String,?> keys)
      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

      public Map<String,?> 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: