bill.util.persist
Class EntityKey

java.lang.Object
  |
  +--bill.util.persist.EntityKey

public class EntityKey
extends Object

Defines the elements that may up the key of an entity.


Constructor Summary
EntityKey(EntityData entity)
          Creates a new EntityKey object for the specified entity object.
 
Method Summary
 void addKeyElement(String element)
          Adds the specified element to the list of elements that make up this entity's key.
 Vector getKeyElements()
          Retrieves the list of this entity's key elements.
 Hashtable getKeyValues()
          Gets a list of the key elements and their values.
 void setKeyElements(Vector elements)
          Mass setter for the list of elements that make up this entity's key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityKey

public EntityKey(EntityData entity)
Creates a new EntityKey object for the specified entity object.
Parameters:
entity - The entity this object is the key for.
Method Detail

addKeyElement

public void addKeyElement(String element)
                   throws PersistException
Adds the specified element to the list of elements that make up this entity's key.
Parameters:
element - Then logical name of the element being added to the list of key elements.
Throws:
PersistException - If the specified key element is not a defined element of the entity.

setKeyElements

public void setKeyElements(Vector elements)
                    throws PersistException
Mass setter for the list of elements that make up this entity's key.
Parameters:
elements - The list of elements to set as the key. This vector contains a list of logical element name strings.
Throws:
PersistException - If any of the element names in the vector are not a defined element of the entity.

getKeyElements

public Vector getKeyElements()
Retrieves the list of this entity's key elements. The list contains logical element name strings.
Returns:
The list of key elements.

getKeyValues

public Hashtable getKeyValues()
Gets a list of the key elements and their values.
Returns:
A Hashtable keyed by the key element's logical name, with the element's value as the result.