if (!mmd.isPrimaryKey())
{
// Make sure the field is loaded
nucleusCtx.getApiAdapter().isLoaded(sm, mmd.getAbsoluteFieldNumber());
}
FieldManager fm = new SingleValueFieldManager();
sm.provideFields(new int[] {mmd.getAbsoluteFieldNumber()}, fm);
return fm.fetchObjectField(mmd.getAbsoluteFieldNumber());
}
else if (cmd.getIdentityType() == IdentityType.DATASTORE)
{
OID oid = (OID)nucleusCtx.getApiAdapter().getIdForObject(value);
return oid != null ? oid.getKeyValue() : null;