summaryrefslogtreecommitdiffstats
path: root/sonar-core/src/main
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2013-12-20 18:07:25 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2013-12-20 18:07:36 +0100
commit193260715b52e175f6875a4e0056cebdd5d30fa3 (patch)
tree8e611d0bcd1365e18e76ba99d1344e4bb0835a64 /sonar-core/src/main
parent568e5ddf9c1f805f269055d20b1601ea58f01304 (diff)
downloadsonarqube-193260715b52e175f6875a4e0056cebdd5d30fa3.tar.gz
sonarqube-193260715b52e175f6875a4e0056cebdd5d30fa3.zip
SONAR-4535 Add update and delete rule note in QProfileOperations
Diffstat (limited to 'sonar-core/src/main')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/rule/RuleDto.java55
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml27
2 files changed, 59 insertions, 23 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/rule/RuleDto.java b/sonar-core/src/main/java/org/sonar/core/rule/RuleDto.java
index 62bd1b9b880..7af9e56ff6f 100644
--- a/sonar-core/src/main/java/org/sonar/core/rule/RuleDto.java
+++ b/sonar-core/src/main/java/org/sonar/core/rule/RuleDto.java
@@ -47,56 +47,63 @@ public final class RuleDto {
return id;
}
- public void setId(Integer id) {
+ public RuleDto setId(Integer id) {
this.id = id;
+ return this;
}
public String getRepositoryKey() {
return repositoryKey;
}
- public void setRepositoryKey(String repositoryKey) {
+ public RuleDto setRepositoryKey(String repositoryKey) {
this.repositoryKey = repositoryKey;
+ return this;
}
public String getRuleKey() {
return ruleKey;
}
- public void setRuleKey(String ruleKey) {
+ public RuleDto setRuleKey(String ruleKey) {
this.ruleKey = ruleKey;
+ return this;
}
public String getDescription() {
return description;
}
- public void setDescription(String description) {
+ public RuleDto setDescription(String description) {
this.description = description;
+ return this;
}
public String getStatus() {
return status;
}
- public void setStatus(String status) {
+ public RuleDto setStatus(String status) {
this.status = status;
+ return this;
}
public String getName() {
return name;
}
- public void setName(String name) {
+ public RuleDto setName(String name) {
this.name = name;
+ return this;
}
public String getConfigKey() {
return configKey;
}
- public void setConfigKey(String configKey) {
+ public RuleDto setConfigKey(String configKey) {
this.configKey = configKey;
+ return this;
}
public Priority getPriority() {
@@ -107,83 +114,95 @@ public final class RuleDto {
return priority.ordinal();
}
- public void setPriority(Priority priority) {
+ // TODO do not use Priority
+ public RuleDto setPriority(Priority priority) {
this.priority = priority;
+ return this;
}
- public void setPriorityOrdinal(int ordinal) {
+ public RuleDto setPriorityOrdinal(int ordinal) {
this.priority = Priority.values()[ordinal];
+ return this;
}
public Cardinality getCardinality() {
return cardinality;
}
- public void setCardinality(Cardinality cardinality) {
+ public RuleDto setCardinality(Cardinality cardinality) {
this.cardinality = cardinality;
+ return this;
}
public String getLanguage() {
return language;
}
- public void setLanguage(String language) {
+ public RuleDto setLanguage(String language) {
this.language = language;
+ return this;
}
public Integer getParentId() {
return parentId;
}
- public void setParentId(Integer parentId) {
+ public RuleDto setParentId(Integer parentId) {
this.parentId = parentId;
+ return this;
}
public Date getCreatedAt() {
return createdAt;
}
- public void setCreatedAt(Date createdAt) {
+ public RuleDto setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
+ return this;
}
public Date getUpdatedAt() {
return updatedAt;
}
- public void setUpdatedAt(Date updatedAt) {
+ public RuleDto setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
+ return this;
}
public String getNoteData() {
return noteData;
}
- public void setNoteData(String noteData) {
+ public RuleDto setNoteData(String noteData) {
this.noteData = noteData;
+ return this;
}
public String getNoteUserLogin() {
return noteUserLogin;
}
- public void setNoteUserLogin(String noteUserLogin) {
+ public RuleDto setNoteUserLogin(String noteUserLogin) {
this.noteUserLogin = noteUserLogin;
+ return this;
}
public Date getNoteCreatedAt() {
return noteCreatedAt;
}
- public void setNoteCreatedAt(Date noteCreatedAt) {
+ public RuleDto setNoteCreatedAt(Date noteCreatedAt) {
this.noteCreatedAt = noteCreatedAt;
+ return this;
}
public Date getNoteUpdatedAt() {
return noteUpdatedAt;
}
- public void setNoteUpdatedAt(Date noteUpdatedAt) {
+ public RuleDto setNoteUpdatedAt(Date noteUpdatedAt) {
this.noteUpdatedAt = noteUpdatedAt;
+ return this;
}
}
diff --git a/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml b/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml
index ef858d7559c..0979713ca73 100644
--- a/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml
@@ -4,10 +4,23 @@
<mapper namespace="org.sonar.core.rule.RuleMapper">
<sql id="selectColumns">
- id, plugin_rule_key as "ruleKey", plugin_name as "repositoryKey", description, status, name, plugin_config_key as "configKey",
- priority as "priorityOrdinal", cardinality, language as "language", parent_id as "parentId",
- created_at as "createdAt", updated_at as "updatedAt",
- note_data as "noteData", note_user_login as "noteUserLogin", note_created_at as "noteCreatedAt", note_updated_at as "noteUpdatedAt"
+ id,
+ plugin_rule_key as "ruleKey",
+ plugin_name as "repositoryKey",
+ description,
+ status,
+ name,
+ plugin_config_key as "configKey",
+ priority as "priorityOrdinal",
+ cardinality,
+ language as "language",
+ parent_id as "parentId",
+ created_at as "createdAt",
+ updated_at as "updatedAt",
+ note_data as "noteData",
+ note_user_login as "noteUserLogin",
+ note_created_at as "noteCreatedAt",
+ note_updated_at as "noteUpdatedAt"
</sql>
<select id="selectAll" resultType="Rule">
@@ -35,7 +48,11 @@
cardinality=#{cardinality},
language=#{language},
parent_id=#{parentId},
- updated_at=#{updatedAt}
+ updated_at=#{updatedAt},
+ note_data=#{noteData},
+ note_user_login=#{noteUserLogin},
+ note_created_at=#{noteCreatedAt},
+ note_updated_at=#{noteUpdatedAt}
where id=#{id}
</update>