Package org.datanucleus.identity
Class IdentityManagerImpl
java.lang.Object
org.datanucleus.identity.IdentityManagerImpl
- All Implemented Interfaces:
IdentityManager
Manager for identity operations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map
<String, Constructor<?>> Cache of id class Constructor, keyed by string of the type+args.private static final Class[]
private static final Class[]
private static final Class[]
private static final Class[]
private static final Class[]
protected Class
<? extends DatastoreId> Default DatastoreId implementation used by DataNucleus.protected IdentityKeyTranslator
Identity key translator (if any).protected IdentityStringTranslator
Identity string translator (if any).Fields inherited from interface org.datanucleus.identity.IdentityManager
IDENTITY_CLASS_TARGET_CLASS_NAME_FIELD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetApplicationId
(Class cls, Object key) Method to return a new object identity for the specified class, and key (possibly toString() output).getApplicationId
(Object pc, AbstractClassMetaData cmd) Method to create a new object identity for the passed object with the supplied MetaData.getApplicationId
(ClassLoaderResolver clr, AbstractClassMetaData acmd, 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.protected String
getConstructorNameForCache
(Class type, Class[] ctrArgTypes) getDatastoreId
(long value) Method to return a datastore-unique datastore identity, with the specified value.getDatastoreId
(String idString) Method to return a datastore identity, for the specified string which comes from the output of toString().getDatastoreId
(String className, Object value) Method to return a datastore identity, representing the persistable object with specified class name and key value.Class
<? extends DatastoreId> Accessor for the current identity key translator to use (if any).Accessor for the current identity string translator to use (if any).getSingleFieldId
(Class idType, Class pcType, Object key) Method to return a single-field identity, for the persistable type specified, and for the idType of SingleFieldId.
-
Field Details
-
CTR_CLASS_OBJECT_ARG_TYPES
-
CTR_CLASS_STRING_ARG_TYPES
-
CTR_STRING_OBJECT_ARG_TYPES
-
CTR_STRING_ARG_TYPES
-
CTR_LONG_ARG_TYPES
-
datastoreIdClass
Default DatastoreId implementation used by DataNucleus. -
idStringTranslator
Identity string translator (if any). -
idKeyTranslator
Identity key translator (if any). -
constructorCache
Cache of id class Constructor, keyed by string of the type+args.
-
-
Constructor Details
-
IdentityManagerImpl
-
-
Method Details
-
getConstructorNameForCache
-
getDatastoreIdClass
- Specified by:
getDatastoreIdClass
in interfaceIdentityManager
-
getIdentityStringTranslator
Description copied from interface:IdentityManager
Accessor for the current identity string translator to use (if any).- Specified by:
getIdentityStringTranslator
in interfaceIdentityManager
- Returns:
- Identity string translator instance (or null if persistence property not set)
-
getIdentityKeyTranslator
Description copied from interface:IdentityManager
Accessor for the current identity key translator to use (if any).- Specified by:
getIdentityKeyTranslator
in interfaceIdentityManager
- Returns:
- Identity key translator instance (or null if persistence property not set)
-
getDatastoreId
Description copied from interface:IdentityManager
Method to return a datastore identity, representing the persistable object with specified class name and key value.- Specified by:
getDatastoreId
in interfaceIdentityManager
- Parameters:
className
- The class name for the persistablevalue
- The key value for the persistable- Returns:
- The datastore id
-
getDatastoreId
Description copied from interface:IdentityManager
Method to return a datastore-unique datastore identity, with the specified value.- Specified by:
getDatastoreId
in interfaceIdentityManager
- Parameters:
value
- The long value that is unique across the datastore.- Returns:
- The datastore id
-
getDatastoreId
Description copied from interface:IdentityManager
Method to return a datastore identity, for the specified string which comes from the output of toString().- Specified by:
getDatastoreId
in interfaceIdentityManager
- Parameters:
idString
- The toString() value- Returns:
- The datastore id
-
getSingleFieldId
Description copied from interface:IdentityManager
Method to return a single-field identity, for the persistable type specified, and for the idType of SingleFieldId.- Specified by:
getSingleFieldId
in interfaceIdentityManager
- 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
public Object getApplicationId(ClassLoaderResolver clr, AbstractClassMetaData acmd, String keyToString) Description copied from interface:IdentityManager
Utility to create a new application identity when you know the metadata for the target class, and the toString() output of the identity.- Specified by:
getApplicationId
in interfaceIdentityManager
- Parameters:
clr
- ClassLoader resolveracmd
- MetaData for the target classkeyToString
- String form of the key- Returns:
- The identity
-
getApplicationId
Description copied from interface:IdentityManager
Method to create a new object identity for the passed object with the supplied MetaData. Only applies to application-identity cases.- Specified by:
getApplicationId
in interfaceIdentityManager
- Parameters:
pc
- The persistable objectcmd
- Its metadata- Returns:
- The new identity object
-
getApplicationId
Description copied from interface:IdentityManager
Method to return a new object identity for the specified class, and key (possibly toString() output).- Specified by:
getApplicationId
in interfaceIdentityManager
- Parameters:
cls
- Persistable classkey
- form of the object id- Returns:
- The object identity
-