public class IdentityManagerImpl extends Object implements IdentityManager
Modifier and Type | Field and Description |
---|---|
protected Class |
datastoreIdClass
Default DatastoreId implementation used by DataNucleus.
|
protected IdentityKeyTranslator |
idKeyTranslator
Identity key translator (if any).
|
protected IdentityStringTranslator |
idStringTranslator
Identity string translator (if any).
|
Constructor and Description |
---|
IdentityManagerImpl(PersistenceNucleusContext nucCtx) |
Modifier and Type | Method and Description |
---|---|
Object |
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.
|
Object |
getApplicationId(Class cls,
Object key)
Method to return a new object identity for the specified class, and key (possibly toString() output).
|
Object |
getApplicationId(Object pc,
AbstractClassMetaData cmd)
Method to create a new (application) identity for the passed object with the supplied MetaData (when using APPLICATION identity).
|
protected String |
getConstructorNameForCache(Class type,
Class[] ctrArgTypes) |
DatastoreId |
getDatastoreId(long value)
Method to return a datastore-unique datastore identity, with the specified value.
|
DatastoreId |
getDatastoreId(String idString)
Method to return a datastore identity, for the specified string which comes from the output of toString().
|
DatastoreId |
getDatastoreId(String className,
Object value)
Method to return a datastore identity, representing the persistable object with specified class name and key value.
|
Class |
getDatastoreIdClass() |
IdentityKeyTranslator |
getIdentityKeyTranslator()
Accessor for the current identity key translator to use (if any).
|
IdentityStringTranslator |
getIdentityStringTranslator()
Accessor for the current identity string translator to use (if any).
|
SingleFieldId |
getSingleFieldId(Class idType,
Class pcType,
Object key)
Utility to create a new SingleFieldId using reflection when you know the type of the Persistable, and also which SingleFieldId type, and the value of the key.
|
protected Class datastoreIdClass
protected IdentityStringTranslator idStringTranslator
protected IdentityKeyTranslator idKeyTranslator
public IdentityManagerImpl(PersistenceNucleusContext nucCtx)
protected String getConstructorNameForCache(Class type, Class[] ctrArgTypes)
public Class getDatastoreIdClass()
getDatastoreIdClass
in interface IdentityManager
public IdentityStringTranslator getIdentityStringTranslator()
IdentityManager
getIdentityStringTranslator
in interface IdentityManager
public IdentityKeyTranslator getIdentityKeyTranslator()
IdentityManager
getIdentityKeyTranslator
in interface IdentityManager
public DatastoreId getDatastoreId(String className, Object value)
IdentityManager
getDatastoreId
in interface IdentityManager
className
- The class name for the persistablevalue
- The key value for the persistablepublic DatastoreId getDatastoreId(long value)
IdentityManager
getDatastoreId
in interface IdentityManager
value
- The long value that is unique across the datastore.public DatastoreId getDatastoreId(String idString)
IdentityManager
getDatastoreId
in interface IdentityManager
idString
- The toString() valuepublic SingleFieldId getSingleFieldId(Class idType, Class pcType, Object key)
getSingleFieldId
in interface IdentityManager
idType
- Type of SingleFieldIdpcType
- Type of the Persistablekey
- The value for the identity (the Long, or Int, or ... etc).NucleusException
- if invalid input is receivedpublic Object getApplicationId(ClassLoaderResolver clr, AbstractClassMetaData acmd, String keyToString)
getApplicationId
in interface IdentityManager
clr
- ClassLoader resolveracmd
- MetaData for the target classkeyToString
- String form of the keypublic Object getApplicationId(Object pc, AbstractClassMetaData cmd)
getApplicationId
in interface IdentityManager
pc
- The persistable objectcmd
- Metadata for the persistable objectpublic Object getApplicationId(Class cls, Object key)
getApplicationId
in interface IdentityManager
cls
- Persistable classkey
- form of the object idCopyright © 2019. All rights reserved.