Package helma.objectmodel.db

# Class SyntheticKey

java.lang.Object
helma.objectmodel.db.SyntheticKey

All Implemented Interfaces:
  `Key`, `Serializable`

public final class SyntheticKey extends Object implements Key, Serializable
This is the internal key for an object that is not - or not directly - fetched from a db, but derived from another object. This is useful for all kinds of object accessed via a symbolic name from another object, like objects mounted via a property name column, virtual nodes and groupby nodes.

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`SyntheticKey(Key key, String name)`
Make a symbolic key for an object using its parent key and its property name/id.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
Returns true if this key equals obj
`String`
`getID()`
Get the ID part of this key
`Key`
`getParentKey()`
Get the parent key part of this key
`String`
`getStorageName()`
Get the storage name for this key.
`int`
`hashCode()`
Get the hash-code for this key
`String`
`toString()`
Return a string representation for this key

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### SyntheticKey

public SyntheticKey(Key key, String name)
Make a symbolic key for an object using its parent key and its property name/id.

Parameters:
  `key` - the parent key
  `name` - the property or collection name

## Method Details

### equals

public boolean equals(Object obj)
Returns true if this key equals obj

Overrides:
  `equals` in class `Object`
Parameters:
  `obj` - another object
Returns:
  true if obj represents the same key as this

### hashCode

public int hashCode()
Get the hash-code for this key

Overrides:
  `hashCode` in class `Object`
Returns:
  the hash-code

### getParentKey

public Key getParentKey()
Get the parent key part of this key

Specified by:
  `getParentKey` in interface `Key`
Returns:
  the parent key

### getID

public String getID()
Get the ID part of this key

Specified by:
  `getID` in interface `Key`
Returns:
  the id part

### getStorageName

public String getStorageName()
Get the storage name for this key. This alwys returns null for symbolic keys.

Specified by:
  `getStorageName` in interface `Key`
Returns:
  null

### toString

public String toString()
Return a string representation for this key

Overrides:
  `toString` in class `Object`
Returns:
  a string representation for this key