if (!metricIds.isEmpty()) {
MassUpdate massUpdate = context.prepareMassUpdate();
massUpdate.rowPluralName("measures");
SqlStatement select = massUpdate.select("SELECT pm.id, pm.value " +
", pm.variation_value_1 , pm.variation_value_2, pm.variation_value_3 " +
", pm.variation_value_4 , pm.variation_value_5 " +
" FROM project_measures pm " +
" WHERE pm.metric_id IN (" + StringUtils.repeat("?", ",", metricIds.size()) + ")");
for (int i = 0; i < metricIds.size(); i++) {
select.setLong(i + 1, metricIds.get(i));
}
massUpdate.update("UPDATE project_measures SET value=?," +
"variation_value_1=?,variation_value_2=?,variation_value_3=?,variation_value_4=?,variation_value_5=? WHERE id=?");
massUpdate.execute(new Converter());
}