Package org.datanucleus.identity
Class DatastoreIdImplXcalia
- java.lang.Object
-
- org.datanucleus.identity.DatastoreIdImplXcalia
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable,DatastoreId
public class DatastoreIdImplXcalia extends java.lang.Object implements java.io.Serializable, DatastoreId, java.lang.Comparable
Object identifier, typically used for datastore identity. The behaviour of this class is governed by JDO spec 5.4.3. Utilises a String form of the style "mydomain.MyClass:3258"; this is a form similar to Xcalia. Note : Xcalia also allows "{alias}:3258" but this isn't catered for here- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description inthashCodejava.lang.ObjectkeyAsObjectprivate static longserialVersionUIDprotected static java.lang.StringSTRING_DELIMITERjava.lang.StringtargetClassNamejava.lang.StringtoString
-
Constructor Summary
Constructors Constructor Description DatastoreIdImplXcalia(java.lang.String str)Constructs a DatastoreId from its string representation that is consistent with the output of toString().DatastoreIdImplXcalia(java.lang.String pcClass, java.lang.Object key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(java.lang.Object o)booleanequals(java.lang.Object obj)java.lang.ObjectgetKeyAsObject()Provides the identity in a form that can be used by the database as a key.java.lang.StringgetTargetClassName()Accessor for the target class name for the persistable object this represents.inthashCode()java.lang.StringtoString()Creates a String representation of the datastore identity, formed from the target class name and the key value.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
STRING_DELIMITER
protected static final transient java.lang.String STRING_DELIMITER
- See Also:
- Constant Field Values
-
keyAsObject
public final java.lang.Object keyAsObject
-
targetClassName
public final java.lang.String targetClassName
-
toString
public final java.lang.String toString
-
hashCode
public final int hashCode
-
-
Constructor Detail
-
DatastoreIdImplXcalia
public DatastoreIdImplXcalia(java.lang.String pcClass, java.lang.Object key)
-
DatastoreIdImplXcalia
public DatastoreIdImplXcalia(java.lang.String str) throws java.lang.IllegalArgumentExceptionConstructs a DatastoreId from its string representation that is consistent with the output of toString().- Parameters:
str- the string representation of a DatastoreId- Throws:
java.lang.IllegalArgumentException- if the given string representation is not valid.- See Also:
toString
-
-
Method Detail
-
getKeyAsObject
public java.lang.Object 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
-
getTargetClassName
public java.lang.String 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
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfaceDatastoreId- Overrides:
equalsin classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareToin interfacejava.lang.Comparable
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceDatastoreId- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
Creates a String representation of the datastore identity, formed from the target class name and the key value. This will be something likemydomain.MyClass:3254
- Specified by:
toStringin interfaceDatastoreId- Overrides:
toStringin classjava.lang.Object- Returns:
- The String form of the identity
-
-