Package org.apache.openjpa.util
Class OpenJPAId
java.lang.Object
org.apache.openjpa.util.OpenJPAId
- All Implemented Interfaces:
Serializable
,Comparable
- Direct Known Subclasses:
BigDecimalId
,BigIntegerId
,BooleanId
,ByteId
,CharId
,DateId
,DoubleId
,FloatId
,Id
,IntId
,LongId
,ObjectId
,ShortId
,StringId
Identity class extended by built-in OpenJPA identity objects.
- Author:
- Steve Kim
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
abstract Object
Return the identity value as an object.getType()
Return the persistent class which this id instance represents.int
hashCode()
Generate the hash code for this Id.boolean
Whether this oid might be for a subclass of the given type.protected abstract boolean
Compare the id to the id of the given instance.protected abstract int
idHash()
Return the id's hash code.void
setManagedInstanceType
(Class type) Set the exact type of the described instance once it is known.void
setManagedInstanceType
(Class type, boolean subs) Set the exact type of the described instance once it is known.toString()
-
Field Details
-
TYPE_VALUE_SEP
public static final char TYPE_VALUE_SEP- See Also:
-
type
-
subs
protected boolean subs
-
-
Constructor Details
-
OpenJPAId
protected OpenJPAId() -
OpenJPAId
-
OpenJPAId
-
-
Method Details
-
getType
Return the persistent class which this id instance represents. -
hasSubclasses
public boolean hasSubclasses()Whether this oid might be for a subclass of the given type. Defaults to true. -
setManagedInstanceType
Set the exact type of the described instance once it is known. -
setManagedInstanceType
Set the exact type of the described instance once it is known. -
getIdObject
Return the identity value as an object. -
idHash
protected abstract int idHash()Return the id's hash code. -
idEquals
Compare the id to the id of the given instance. -
hashCode
public int hashCode()Generate the hash code for this Id. Cache the type's generated hash code so that it doesn't have to be generated each time. -
equals
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable
-