Package org.sonar.server.db.migrations

Examples of org.sonar.server.db.migrations.SqlStatement


    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());
    }
View Full Code Here

TOP

Related Classes of org.sonar.server.db.migrations.SqlStatement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.