Package org.apache.openjpa.util
Class Id
- java.lang.Object
-
- org.apache.openjpa.util.OpenJPAId
-
- org.apache.openjpa.util.Id
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable
public final class Id extends OpenJPAId
Datastore identity type. Implementations may choose to use this type, or choose to use their own datastore identity values.- Author:
- Abe White
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.openjpa.util.OpenJPAId
subs, type, TYPE_VALUE_SEP
-
-
Constructor Summary
Constructors Constructor Description Id(java.lang.Class cls, long key)
Construct from key value.Id(java.lang.Class cls, long key, boolean subs)
Construct from key value.Id(java.lang.Class cls, java.lang.Long key)
Construct from key value.Id(java.lang.Class cls, java.lang.String key)
Construct from the result of aOpenJPAId.toString()
call on another instance.Id(java.lang.String str)
Create an id from the result of aOpenJPAId.toString()
call on another instance.Id(java.lang.String str, java.lang.ClassLoader loader)
Create an id from the result of anOpenJPAId.toString()
call on another instance.Id(java.lang.String str, OpenJPAConfiguration conf, java.lang.ClassLoader brokerLoader)
Create an id from the result of anOpenJPAId.toString()
call on another instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getId()
Primary key.java.lang.Object
getIdObject()
Return the identity value as an object.protected boolean
idEquals(OpenJPAId other)
Compare the id to the id of the given instance.protected int
idHash()
Return the id's hash code.static Id
newInstance(java.lang.Class cls, java.lang.Object val)
Create an id from the given type and value; the value might be an id instance, a stringified id, or a primary key value.-
Methods inherited from class org.apache.openjpa.util.OpenJPAId
compareTo, equals, getType, hashCode, hasSubclasses, setManagedInstanceType, setManagedInstanceType, toString
-
-
-
-
Constructor Detail
-
Id
public Id(java.lang.String str)
Create an id from the result of aOpenJPAId.toString()
call on another instance.
-
Id
public Id(java.lang.String str, OpenJPAConfiguration conf, java.lang.ClassLoader brokerLoader)
Create an id from the result of anOpenJPAId.toString()
call on another instance.
-
Id
public Id(java.lang.String str, java.lang.ClassLoader loader)
Create an id from the result of anOpenJPAId.toString()
call on another instance.
-
Id
public Id(java.lang.Class cls, java.lang.String key)
Construct from the result of aOpenJPAId.toString()
call on another instance.
-
Id
public Id(java.lang.Class cls, java.lang.Long key)
Construct from key value.
-
Id
public Id(java.lang.Class cls, long key)
Construct from key value.
-
Id
public Id(java.lang.Class cls, long key, boolean subs)
Construct from key value.
-
-
Method Detail
-
newInstance
public static Id newInstance(java.lang.Class cls, java.lang.Object val)
Create an id from the given type and value; the value might be an id instance, a stringified id, or a primary key value.
-
getId
public long getId()
Primary key.
-
getIdObject
public java.lang.Object getIdObject()
Description copied from class:OpenJPAId
Return the identity value as an object.- Specified by:
getIdObject
in classOpenJPAId
-
idHash
protected int idHash()
Description copied from class:OpenJPAId
Return the id's hash code.
-
-