aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/OrgQProfileDto.java26
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QProfileDto.java4
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/RulesProfileDto.java28
-rw-r--r--server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QualityProfileMapper.xml18
4 files changed, 36 insertions, 40 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/OrgQProfileDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/OrgQProfileDto.java
index c7c2ffe1d37..479e14e37ef 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/OrgQProfileDto.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/OrgQProfileDto.java
@@ -31,6 +31,8 @@ public class OrgQProfileDto {
private String organizationUuid;
private String rulesProfileUuid;
private String parentUuid;
+ private Long lastUsed;
+ private Long userUpdatedAt;
public String getOrganizationUuid() {
return organizationUuid;
@@ -69,11 +71,33 @@ public class OrgQProfileDto {
return this;
}
+ @CheckForNull
+ public Long getLastUsed() {
+ return lastUsed;
+ }
+
+ public OrgQProfileDto setLastUsed(@Nullable Long lastUsed) {
+ this.lastUsed = lastUsed;
+ return this;
+ }
+
+ @CheckForNull
+ public Long getUserUpdatedAt() {
+ return userUpdatedAt;
+ }
+
+ public OrgQProfileDto setUserUpdatedAt(@Nullable Long userUpdatedAt) {
+ this.userUpdatedAt = userUpdatedAt;
+ return this;
+ }
+
public static OrgQProfileDto from(QProfileDto qProfileDto) {
return new OrgQProfileDto()
.setUuid(qProfileDto.getKee())
.setOrganizationUuid(qProfileDto.getOrganizationUuid())
.setRulesProfileUuid(qProfileDto.getRulesProfileUuid())
- .setParentUuid(qProfileDto.getParentKee());
+ .setParentUuid(qProfileDto.getParentKee())
+ .setLastUsed(qProfileDto.getLastUsed())
+ .setUserUpdatedAt(qProfileDto.getUserUpdatedAt());
}
}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QProfileDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QProfileDto.java
index 385ce1b6629..69e0176d044 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QProfileDto.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QProfileDto.java
@@ -165,7 +165,7 @@ public class QProfileDto {
.setLanguage(rules.getLanguage())
.setName(rules.getName())
.setRulesUpdatedAt(rules.getRulesUpdatedAt())
- .setLastUsed(rules.getLastUsed())
- .setUserUpdatedAt(rules.getUserUpdatedAt());
+ .setLastUsed(org.getLastUsed())
+ .setUserUpdatedAt(org.getUserUpdatedAt());
}
}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/RulesProfileDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/RulesProfileDto.java
index ae487c75411..b1d2ad5a95d 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/RulesProfileDto.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/RulesProfileDto.java
@@ -20,8 +20,6 @@
package org.sonar.db.qualityprofile;
import java.util.Date;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
import org.sonar.core.util.UtcDateUtils;
/**
@@ -34,8 +32,6 @@ public class RulesProfileDto {
private String name;
private String language;
private String rulesUpdatedAt;
- private Long lastUsed;
- private Long userUpdatedAt;
private boolean isBuiltIn;
public String getKee() {
@@ -88,26 +84,6 @@ public class RulesProfileDto {
return this;
}
- @CheckForNull
- public Long getLastUsed() {
- return lastUsed;
- }
-
- public RulesProfileDto setLastUsed(@Nullable Long lastUsed) {
- this.lastUsed = lastUsed;
- return this;
- }
-
- @CheckForNull
- public Long getUserUpdatedAt() {
- return userUpdatedAt;
- }
-
- public RulesProfileDto setUserUpdatedAt(@Nullable Long userUpdatedAt) {
- this.userUpdatedAt = userUpdatedAt;
- return this;
- }
-
public boolean isBuiltIn() {
return isBuiltIn;
}
@@ -124,8 +100,6 @@ public class RulesProfileDto {
.setName(qProfileDto.getName())
.setIsBuiltIn(qProfileDto.isBuiltIn())
.setId(qProfileDto.getId())
- .setLastUsed(qProfileDto.getLastUsed())
- .setRulesUpdatedAt(qProfileDto.getRulesUpdatedAt())
- .setUserUpdatedAt(qProfileDto.getUserUpdatedAt());
+ .setRulesUpdatedAt(qProfileDto.getRulesUpdatedAt());
}
}
diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QualityProfileMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QualityProfileMapper.xml
index b09d6fc0f97..35b8cbdfcb0 100644
--- a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QualityProfileMapper.xml
+++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QualityProfileMapper.xml
@@ -7,13 +7,13 @@
oqp.uuid as kee,
oqp.organization_uuid as organizationUuid,
oqp.parent_uuid as parentKee,
+ oqp.last_used as lastUsed,
+ oqp.user_updated_at as userUpdatedAt,
rp.id as id,
rp.kee as rulesProfileUuid,
rp.name as name,
rp.language as language,
rp.rules_updated_at as rulesUpdatedAt,
- rp.last_used as lastUsed,
- rp.user_updated_at as userUpdatedAt,
rp.is_built_in as isBuiltIn
</sql>
@@ -23,8 +23,6 @@
rp.name as name,
rp.language as language,
rp.rules_updated_at as rulesUpdatedAt,
- rp.last_used as lastUsed,
- rp.user_updated_at as userUpdatedAt,
rp.is_built_in as isBuiltIn
</sql>
@@ -36,8 +34,6 @@
created_at,
updated_at,
rules_updated_at,
- last_used,
- user_updated_at,
is_built_in
) values (
#{dto.kee, jdbcType=VARCHAR},
@@ -46,8 +42,6 @@
#{now, jdbcType=TIMESTAMP},
#{now, jdbcType=TIMESTAMP},
#{dto.rulesUpdatedAt, jdbcType=VARCHAR},
- #{dto.lastUsed, jdbcType=BIGINT},
- #{dto.userUpdatedAt, jdbcType=BIGINT},
#{dto.isBuiltIn, jdbcType=BOOLEAN}
)
</insert>
@@ -58,6 +52,8 @@
organization_uuid,
rules_profile_uuid,
parent_uuid,
+ last_used,
+ user_updated_at,
created_at,
updated_at
) values (
@@ -65,6 +61,8 @@
#{dto.organizationUuid, jdbcType=VARCHAR},
#{dto.rulesProfileUuid, jdbcType=VARCHAR},
#{dto.parentUuid, jdbcType=VARCHAR},
+ #{dto.lastUsed, jdbcType=BIGINT},
+ #{dto.userUpdatedAt, jdbcType=BIGINT},
#{now, jdbcType=BIGINT},
#{now, jdbcType=BIGINT}
)
@@ -77,8 +75,6 @@
language = #{dto.language, jdbcType=VARCHAR},
updated_at = #{now, jdbcType=TIMESTAMP},
rules_updated_at = #{dto.rulesUpdatedAt, jdbcType=VARCHAR},
- last_used = #{dto.lastUsed, jdbcType=BIGINT},
- user_updated_at = #{dto.userUpdatedAt, jdbcType=BIGINT},
is_built_in = #{dto.isBuiltIn, jdbcType=BOOLEAN}
where
kee = #{dto.rulesProfileUuid, jdbcType=VARCHAR}
@@ -88,6 +84,8 @@
update org_qprofiles
set
parent_uuid = #{dto.parentKee, jdbcType=VARCHAR},
+ last_used = #{dto.lastUsed, jdbcType=BIGINT},
+ user_updated_at = #{dto.userUpdatedAt, jdbcType=BIGINT},
updated_at = #{now, jdbcType=BIGINT}
where
uuid = #{dto.kee, jdbcType=VARCHAR}