Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.util
Class PersistentObjectMap

    java.lang.Object
      org.apache.cayenne.util.RelationshipFault
          org.apache.cayenne.util.PersistentObjectMap

All Implemented Interfaces:
  Serializable, Map, ValueHolder

    public class PersistentObjectMap

extends RelationshipFault
implements Map, ValueHolder

Since:
  3.0
See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from interface java.util.Map
`Map.Entry<K,V>`

Field Summary
`protected Accessor` | `mapKeyAccessor`
`protected Map` | `objectMap`

Fields inherited from class org.apache.cayenne.util.RelationshipFault
`relationshipName, relationshipOwner`

Constructor Summary
`PersistentObjectMap(Persistent relationshipOwner, String relationshipName, Accessor mapKeyAccessor)` Creates PersistentObjectList initializing it with list owner persistent object and relationship name that this list maps to.

Method Summary
`void` | `clear()`
`boolean` | `containsKey(Object key)`
`boolean` | `containsValue(Object value)`
`Set` | `entrySet()`
`Object` | `get(Object key)`
`Object` | `getValue()` Returns an object stored by this ValueHolder.
`Object` | `getValueDirectly()` Retrieves ValueHolder value without triggering fault resolution.
`protected Map` | `indexCollection(Collection collection)` Converts a collection into a map indexed by map key.
`void` | `invalidate()` Turns a ValueHolder into a fault.
`boolean` | `isEmpty()`
`boolean` | `isFault()` Returns true if the internal value is not yet resolved.
`Set` | `keySet()`
`Object` | `put(Object key, Object value)`
`void` | `putAll(Map map)`
`Object` | `remove(Object key)`
`protected Map` | `resolvedObjectMap()` Returns internal objects list resolving it if needed.
`void` | `setObjectMap(Map objectMap)`
`Object` | `setValue(Object value)` Sets an object stored by this ValueHolder.
`Object` | `setValueDirectly(Object value)` Sets ValueHolder vaue without triggering fault resolution.
`int` | `size()`
`String` | `toString()`
`Collection` | `values()`

Methods inherited from class org.apache.cayenne.util.RelationshipFault
`getRelationshipName, getRelationshipOwner, isTransientParent, isUncommittedParent, resolveFromDB, updateReverse`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.util.Map
`equals, hashCode`

Field Detail

### objectMap

    protected Map objectMap

### mapKeyAccessor

    protected Accessor mapKeyAccessor

Constructor Detail

### PersistentObjectMap

    public PersistentObjectMap(Persistent relationshipOwner,
                               String relationshipName,
                               Accessor mapKeyAccessor)

  Creates PersistentObjectList initializing it with list owner persistent object and relationship name that this list maps to.

  Parameters:
    `relationshipOwner` - persistent object that owns this list.
    `relationshipName` - a query used to resolve the list
    `mapKeyAccessor` - an accessor that can read a map key from an object.

Method Detail

### getValue

    public Object getValue()
                    throws CayenneRuntimeException

  Description copied from interface: `ValueHolder`
  Returns an object stored by this ValueHolder.

  Specified by:
    `getValue` in interface `ValueHolder`
  Throws:
    `CayenneRuntimeException`

### getValueDirectly

    public Object getValueDirectly()
                            throws CayenneRuntimeException

  Description copied from interface: `ValueHolder`
  Retrieves ValueHolder value without triggering fault resolution.

  Specified by:
    `getValueDirectly` in interface `ValueHolder`
  Throws:
    `CayenneRuntimeException`

### invalidate

    public void invalidate()

  Description copied from interface: `ValueHolder`
  Turns a ValueHolder into a fault.

  Specified by:
    `invalidate` in interface `ValueHolder`

### isFault

    public boolean isFault()

  Description copied from interface: `ValueHolder`
  Returns true if the internal value is not yet resolved.

  Specified by:
    `isFault` in interface `ValueHolder`

### setValue

    public Object setValue(Object value)
                    throws CayenneRuntimeException

  Description copied from interface: `ValueHolder`
  Sets an object stored by this ValueHolder.

  Specified by:
    `setValue` in interface `ValueHolder`
  Parameters:
    `value` - a new value of the ValueHolder.
  Returns:
    a previous value saved in the ValueHolder.
  Throws:
    `CayenneRuntimeException`

### setValueDirectly

    public Object setValueDirectly(Object value)
                            throws CayenneRuntimeException

  Description copied from interface: `ValueHolder`
  Sets ValueHolder vaue without triggering fault resolution.

  Specified by:
    `setValueDirectly` in interface `ValueHolder`
  Throws:
    `CayenneRuntimeException`

### setObjectMap

    public void setObjectMap(Map objectMap)

### resolvedObjectMap

    protected Map resolvedObjectMap()

  Returns internal objects list resolving it if needed.

### indexCollection

    protected Map indexCollection(Collection collection)

  Converts a collection into a map indexed by map key.

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### clear

    public void clear()

  Specified by:
    `clear` in interface `Map`

### containsKey

    public boolean containsKey(Object key)

  Specified by:
    `containsKey` in interface `Map`

### containsValue

    public boolean containsValue(Object value)

  Specified by:
    `containsValue` in interface `Map`

### entrySet

    public Set entrySet()

  Specified by:
    `entrySet` in interface `Map`

### get

    public Object get(Object key)

  Specified by:
    `get` in interface `Map`

### isEmpty

    public boolean isEmpty()

  Specified by:
    `isEmpty` in interface `Map`

### keySet

    public Set keySet()

  Specified by:
    `keySet` in interface `Map`

### put

    public Object put(Object key,
                      Object value)

  Specified by:
    `put` in interface `Map`

### putAll

    public void putAll(Map map)

  Specified by:
    `putAll` in interface `Map`

### remove

    public Object remove(Object key)

  Specified by:
    `remove` in interface `Map`

### size

    public int size()

  Specified by:
    `size` in interface `Map`

### values

    public Collection values()

  Specified by:
    `values` in interface `Map`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.