Examples of QProfileDto44


Examples of org.sonar.core.persistence.migration.v44.QProfileDto44

      Date now = new Date();
      Migration44Mapper mapper = session.getMapper(Migration44Mapper.class);
      for (ProfileMeasure profileMeasure : mapper.selectProfileMeasures()) {
        boolean updated = false;
        Integer version = mapper.selectProfileVersion(profileMeasure.getSnapshotId());
        QProfileDto44 profile = mapper.selectProfileById(profileMeasure.getProfileId());
        if (profile != null) {
          Date date = now;
          if (version != null) {
            date = (Date)ObjectUtils.defaultIfNull(
              mapper.selectProfileVersionDate(profileMeasure.getProfileId(), version), now);
          }
          // see format of JSON in org.sonar.batch.rule.UsedQProfiles
          StringWriter writer = new StringWriter();
          JsonWriter json = JsonWriter.of(writer);
          json
            .beginArray()
            .beginObject()
            .prop("key", profile.getKee())
            .prop("language", profile.getLanguage())
            .prop("name", profile.getName())
            .prop("rulesUpdatedAt", UtcDateUtils.formatDateTime(date))
            .endObject()
            .endArray()
            .close();
          mapper.updateProfileMeasure(profileMeasure.getId(), writer.toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.