Class DatastoreUniqueLongId
java.lang.Object
org.datanucleus.identity.DatastoreUniqueLongId
- All Implemented Interfaces:
Serializable, Comparable, DatastoreId
Identity for use with datastore-identity where the datastore provides a unique "identity" long key per object
and hence doesn't need the class name. The behaviour of this class is governed by JDO spec 5.4.3.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDatastoreUniqueLongId(long key) Constructs an OID from its string representation that is consistent with the output of toString(). -
Method Summary
Modifier and TypeMethodDescriptionintbooleanlonggetKey()Provides the identity in a form that can be used by the database as a key.Accessor for the target class name for the persistable object this represents.inthashCode()toString()Creates a String representation of the datastore identity, formed from the key value.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
key
public final long key
-
-
Constructor Details
-
DatastoreUniqueLongId
public DatastoreUniqueLongId() -
DatastoreUniqueLongId
public DatastoreUniqueLongId(long key) -
DatastoreUniqueLongId
Constructs an OID from its string representation that is consistent with the output of toString().- Parameters:
str- the string representation of an OID- Throws:
IllegalArgumentException- if the given string representation is not valid.- See Also:
-
-
Method Details
-
getKeyAsObject
Description copied from interface:DatastoreIdProvides the identity in a form that can be used by the database as a key.- Specified by:
getKeyAsObjectin interfaceDatastoreId- Returns:
- The key value
-
getKey
public long getKey() -
getTargetClassName
Description copied from interface:DatastoreIdAccessor for the target class name for the persistable object this represents.- Specified by:
getTargetClassNamein interfaceDatastoreId- Returns:
- the class name of the persistable
-
equals
- Specified by:
equalsin interfaceDatastoreId- Overrides:
equalsin classObject
-
compareTo
- Specified by:
compareToin interfaceComparable
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceDatastoreId- Overrides:
hashCodein classObject
-
toString
Creates a String representation of the datastore identity, formed from the key value. This will be something like3254
- Specified by:
toStringin interfaceDatastoreId- Overrides:
toStringin classObject- Returns:
- The String form of the identity
-