getDataStoreMapping(0).setObject(ps, param[0], null);
}
else
{
ApiAdapter api = om.getApiAdapter();
OID oid;
if (api.isPersistable(value))
{
oid = (OID) api.getIdForObject(value);
if (oid == null)
{
if (om.isInserting(value))
{
// Object is in the process of being inserted, but has no id yet so provide a null for now
// The "NotYetFlushedException" is caught by ParameterSetter and processed as an update being required.
getDataStoreMapping(0).setObject(ps, param[0], null);
throw new NotYetFlushedException(value);
}
else
{
// Object is not persist, nor in the process of being made persistent
om.persistObjectInternal(value, null, null, -1, StateManager.PC);
om.flushInternal(false);
}
}
oid = (OID) api.getIdForObject(value);
}
else
{
oid = (OID) value;
}
try
{
// Try as a Long
getDataStoreMapping(0).setObject(ps,param[0],oid.getKeyValue());
}
catch (Exception e)
{
// Must be a String
getDataStoreMapping(0).setObject(ps,param[0],oid.getKeyValue().toString());
}
}
}