Package org.datanucleus.identity
Interface IdentityManager
-
- All Known Implementing Classes:
IdentityManagerImpl
public interface IdentityManagerManager for identity creation etc.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringIDENTITY_CLASS_TARGET_CLASS_NAME_FIELD
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.ObjectgetApplicationId(java.lang.Class cls, java.lang.Object key)Method to return a new object identity for the specified class, and key (possibly toString() output).java.lang.ObjectgetApplicationId(java.lang.Object pc, AbstractClassMetaData cmd)Method to create a new object identity for the passed object with the supplied MetaData.java.lang.ObjectgetApplicationId(ClassLoaderResolver clr, AbstractClassMetaData acmd, java.lang.String keyToString)Utility to create a new application identity when you know the metadata for the target class, and the toString() output of the identity.DatastoreIdgetDatastoreId(long value)Method to return a datastore-unique datastore identity, with the specified value.DatastoreIdgetDatastoreId(java.lang.String oidString)Method to return a datastore identity, for the specified string which comes from the output of toString().DatastoreIdgetDatastoreId(java.lang.String className, java.lang.Object value)Method to return a datastore identity, representing the persistable object with specified class name and key value.java.lang.ClassgetDatastoreIdClass()IdentityKeyTranslatorgetIdentityKeyTranslator()Accessor for the current identity key translator to use (if any).IdentityStringTranslatorgetIdentityStringTranslator()Accessor for the current identity string translator to use (if any).SingleFieldIdgetSingleFieldId(java.lang.Class idType, java.lang.Class pcType, java.lang.Object key)Method to return a single-field identity, for the persistable type specified, and for the idType of SingleFieldId.
-
-
-
Field Detail
-
IDENTITY_CLASS_TARGET_CLASS_NAME_FIELD
static final java.lang.String IDENTITY_CLASS_TARGET_CLASS_NAME_FIELD
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDatastoreIdClass
java.lang.Class getDatastoreIdClass()
-
getIdentityStringTranslator
IdentityStringTranslator getIdentityStringTranslator()
Accessor for the current identity string translator to use (if any).- Returns:
- Identity string translator instance (or null if persistence property not set)
-
getIdentityKeyTranslator
IdentityKeyTranslator getIdentityKeyTranslator()
Accessor for the current identity key translator to use (if any).- Returns:
- Identity key translator instance (or null if persistence property not set)
-
getDatastoreId
DatastoreId getDatastoreId(java.lang.String className, java.lang.Object value)
Method to return a datastore identity, representing the persistable object with specified class name and key value.- Parameters:
className- The class name for the persistablevalue- The key value for the persistable- Returns:
- The datastore id
-
getDatastoreId
DatastoreId getDatastoreId(long value)
Method to return a datastore-unique datastore identity, with the specified value.- Parameters:
value- The long value that is unique across the datastore.- Returns:
- The datastore id
-
getDatastoreId
DatastoreId getDatastoreId(java.lang.String oidString)
Method to return a datastore identity, for the specified string which comes from the output of toString().- Parameters:
oidString- The toString() value- Returns:
- The datastore id
-
getSingleFieldId
SingleFieldId getSingleFieldId(java.lang.Class idType, java.lang.Class pcType, java.lang.Object key)
Method to return a single-field identity, for the persistable type specified, and for the idType of SingleFieldId.- Parameters:
idType- Type of the idpcType- Type of the Persistablekey- The value for the identity (the Long, or Int, or ... etc).- Returns:
- Single field identity
-
getApplicationId
java.lang.Object getApplicationId(ClassLoaderResolver clr, AbstractClassMetaData acmd, java.lang.String keyToString)
Utility to create a new application identity when you know the metadata for the target class, and the toString() output of the identity.- Parameters:
clr- ClassLoader resolveracmd- MetaData for the target classkeyToString- String form of the key- Returns:
- The identity
-
getApplicationId
java.lang.Object getApplicationId(java.lang.Object pc, AbstractClassMetaData cmd)Method to create a new object identity for the passed object with the supplied MetaData. Only applies to application-identity cases.- Parameters:
pc- The persistable objectcmd- Its metadata- Returns:
- The new identity object
-
getApplicationId
java.lang.Object getApplicationId(java.lang.Class cls, java.lang.Object key)Method to return a new object identity for the specified class, and key (possibly toString() output).- Parameters:
cls- Persistable classkey- form of the object id- Returns:
- The object identity
-
-