|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.cayenne.ObjectId
public class ObjectId
A portable global identifier for persistent objects. ObjectId can be temporary (used for transient or new uncommitted objects) or permanent (used for objects that have been already stored in DB). A temporary ObjectId stores object entity name and a pseudo-unique binary key; permanent id stores a map of values from an external persistent store (aka "primary key").
| Field Summary | |
|---|---|
protected java.lang.String |
entityName
|
protected byte[] |
key
|
protected java.util.Map<java.lang.String,java.lang.Object> |
objectIdKeys
|
protected java.util.Map<java.lang.String,java.lang.Object> |
replacementIdMap
|
| Constructor Summary | |
|---|---|
ObjectId(java.lang.String entityName)
Creates a TEMPORARY ObjectId. |
|
ObjectId(java.lang.String entityName,
byte[] key)
Creates a TEMPORARY id with a specified entity name and a binary key. |
|
ObjectId(java.lang.String entityName,
java.util.Map<java.lang.String,?> idMap)
Creates a portable permanent ObjectId as a compound primary key. |
|
ObjectId(java.lang.String entityName,
java.lang.String key,
int value)
Creates a portable permanent ObjectId. |
|
ObjectId(java.lang.String entityName,
java.lang.String key,
java.lang.Object value)
Creates a portable permanent ObjectId. |
|
| Method Summary | |
|---|---|
ObjectId |
createReplacementId()
Creates and returns a replacement ObjectId. |
boolean |
equals(java.lang.Object object)
|
java.lang.String |
getEntityName()
|
java.util.Map<java.lang.String,java.lang.Object> |
getIdSnapshot()
Returns an unmodifiable Map of persistent id values, essentially a primary key map. |
byte[] |
getKey()
Get the binary temporary object id. |
java.util.Map<java.lang.String,java.lang.Object> |
getReplacementIdMap()
Returns a non-null mutable map that can be used to append replacement id values. |
int |
hashCode()
|
boolean |
isReplacementIdAttached()
Returns true if there is full or partial replacement id attached to this id. |
boolean |
isTemporary()
Is this is temporary object id (used for objects which are not yet persisted to the data store). |
java.lang.String |
toString()
A standard toString method used for debugging. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String entityName
protected java.util.Map<java.lang.String,java.lang.Object> objectIdKeys
protected byte[] key
protected java.util.Map<java.lang.String,java.lang.Object> replacementIdMap
| Constructor Detail |
|---|
public ObjectId(java.lang.String entityName)
public ObjectId(java.lang.String entityName,
byte[] key)
public ObjectId(java.lang.String entityName,
java.lang.String key,
int value)
entityName - The entity name which this object id is forkey - A key describing this object id, usually the attribute name for the
primary keyvalue - The unique value for this object id
public ObjectId(java.lang.String entityName,
java.lang.String key,
java.lang.Object value)
entityName - The entity name which this object id is forkey - A key describing this object id, usually the attribute name for the
primary keyvalue - The unique value for this object id
public ObjectId(java.lang.String entityName,
java.util.Map<java.lang.String,?> idMap)
entityName - The entity name which this object id is foridMap - Keys are usually the attribute names for each part of the primary key.
Values are unique when taken as a whole.| Method Detail |
|---|
public boolean isTemporary()
public java.lang.String getEntityName()
public byte[] getKey()
public java.util.Map<java.lang.String,java.lang.Object> getIdSnapshot()
public boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.util.Map<java.lang.String,java.lang.Object> getReplacementIdMap()
public ObjectId createReplacementId()
public boolean isReplacementIdAttached()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||