Package helma.objectmodel.db
Class SyntheticKey
- java.lang.Object
-
- helma.objectmodel.db.SyntheticKey
-
- All Implemented Interfaces:
Key
,java.io.Serializable
public final class SyntheticKey extends java.lang.Object implements Key, java.io.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, java.lang.String name)
Make a symbolic key for an object using its parent key and its property name/id.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Returns true if this key equals objjava.lang.String
getID()
Get the ID part of this keyKey
getParentKey()
Get the parent key part of this keyjava.lang.String
getStorageName()
Get the storage name for this key.int
hashCode()
Get the hash-code for this keyjava.lang.String
toString()
Return a string representation for this key
-
-
-
Constructor Detail
-
SyntheticKey
public SyntheticKey(Key key, java.lang.String name)
Make a symbolic key for an object using its parent key and its property name/id.- Parameters:
key
- the parent keyname
- the property or collection name
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object obj)
Returns true if this key equals obj- Overrides:
equals
in classjava.lang.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 classjava.lang.Object
- Returns:
- the hash-code
-
getParentKey
public Key getParentKey()
Get the parent key part of this key- Specified by:
getParentKey
in interfaceKey
- Returns:
- the parent key
-
getID
public java.lang.String getID()
Get the ID part of this key
-
getStorageName
public java.lang.String getStorageName()
Get the storage name for this key. This alwys returns null for symbolic keys.- Specified by:
getStorageName
in interfaceKey
- Returns:
- null
-
toString
public java.lang.String toString()
Return a string representation for this key- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation for this key
-
-