}
// SELECT clause - set the required fields to be updated
if (updateFieldNumbers != null)
{
sm.provideFields(updateFieldNumbers, new ParameterSetter(sm, ps, mappingStatementIndex.getFields(), true));
}
if (versionMetaData != null && versionMetaData.getFieldName() == null)
{
// SELECT clause - set the surrogate version column to the new version
table.getVersionMapping(false).setObject(om, ps,
mappingStatementIndex.getVersion().getParameterIndex(), nextVersion);
}
// WHERE clause - primary key fields
if (table.getIdentityType() == IdentityType.DATASTORE)
{
// a). datastore identity
table.getDataStoreObjectIdMapping().setObject(om, ps, mappingStatementIndex.getDatastoreId().getParameterIndex(),
sm.getInternalObjectId());
}
else if (table.getIdentityType() == IdentityType.APPLICATION)
{
// b). application identity
sm.provideFields(pkFieldNumbers, new ParameterSetter(sm, ps, mappingStatementIndex.getPrimaryKeys(),true));
}
if (optimisticChecks)
{
if (currentVersion == null)