public class IdentityUtils extends Object
Constructor and Description |
---|
IdentityUtils() |
Modifier and Type | Method and Description |
---|---|
static Object |
getApplicationIdentityForResultSetRow(ExecutionContext ec,
AbstractClassMetaData cmd,
Class pcClass,
boolean inheritanceCheck,
FieldManager resultsFM)
Method to return the object application identity for a row of the result set.
|
static String |
getClassNameForIdentitySimple(ApiAdapter api,
Object id)
Simple method to return the class name that the provided id represents.
|
static String |
getIdentityAsString(ApiAdapter api,
Object id)
Convenience method to return the identity as a String.
|
static Object |
getObjectFromIdString(String idStr,
AbstractClassMetaData cmd,
ExecutionContext ec,
boolean checkInheritance)
Convenience method to find an object given a string form of its identity, and the metadata for the
class (or a superclass).
|
static Object |
getObjectFromIdString(String idStr,
AbstractMemberMetaData mmd,
int fieldRole,
ExecutionContext ec,
boolean checkInheritance)
Convenience method to find an object given a string form of its identity, and the metadata for the member.
|
static Object |
getObjectFromPersistableIdentity(String persistableId,
AbstractClassMetaData cmd,
ExecutionContext ec)
Convenience method to find an object given a string form of its identity, and the metadata for the class (or a superclass).
|
static String |
getPersistableIdentityForId(ApiAdapter api,
Object id)
Method to return a persistable form of the identity of a persistable object.
|
static Object |
getValueForMemberInId(Object id,
AbstractMemberMetaData pkMmd)
Convenience method that interrogates a user-supplied object identity and returns the value of a particular member
in that id.
|
public static String getClassNameForIdentitySimple(ApiAdapter api, Object id)
api
- The API adapterid
- The identitypublic static String getPersistableIdentityForId(ApiAdapter api, Object id)
api
- API adapterid
- The idpublic static Object getObjectFromPersistableIdentity(String persistableId, AbstractClassMetaData cmd, ExecutionContext ec)
persistableId
- The persistable idcmd
- (Root) metadata for the classec
- Execution Contextpublic static String getIdentityAsString(ApiAdapter api, Object id)
id
- The idpublic static Object getApplicationIdentityForResultSetRow(ExecutionContext ec, AbstractClassMetaData cmd, Class pcClass, boolean inheritanceCheck, FieldManager resultsFM)
ec
- Execution Contextcmd
- Metadata for the classpcClass
- The class requiredinheritanceCheck
- Whether need an inheritance check (may be for a subclass)resultsFM
- FieldManager servicing the resultspublic static Object getValueForMemberInId(Object id, AbstractMemberMetaData pkMmd)
id
- The (user-defined) identitypkMmd
- Metadata for the member that we require the value forpublic static Object getObjectFromIdString(String idStr, AbstractClassMetaData cmd, ExecutionContext ec, boolean checkInheritance)
idStr
- The id stringcmd
- Metadata for the classec
- Execution ContextcheckInheritance
- Whether to check the inheritance level of this objectpublic static Object getObjectFromIdString(String idStr, AbstractMemberMetaData mmd, int fieldRole, ExecutionContext ec, boolean checkInheritance)
idStr
- The id stringmmd
- Metadata for the memberfieldRole
- Role of this field (see org.datanucleus.metadata.FieldRole)ec
- Execution ContextcheckInheritance
- Whether to check the inheritance level of this objectCopyright © 2021. All rights reserved.