diff options
author | Pierre <pierre.guillot@sonarsource.com> | 2022-07-08 16:28:19 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-07-12 14:30:04 +0000 |
commit | 201d5326c5e4471a1a77243cd2bd4ac71c9d4ada (patch) | |
tree | 59f2e3c3d101f2c2eec3c09eb55c3fd885b071f8 /server/sonar-db-dao | |
parent | b7337e90fe3a896367ec2f4dda1684e0a2b177a8 (diff) | |
download | sonarqube-201d5326c5e4471a1a77243cd2bd4ac71c9d4ada.tar.gz sonarqube-201d5326c5e4471a1a77243cd2bd4ac71c9d4ada.zip |
SONAR-16598 Rename generic concept to education principles
Diffstat (limited to 'server/sonar-db-dao')
5 files changed, 12 insertions, 12 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleDto.java index c3809c2ded6..79446dc84b6 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleDto.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/rule/RuleDto.java @@ -60,7 +60,7 @@ public class RuleDto { private String ruleKey = null; private final Set<RuleDescriptionSectionDto> ruleDescriptionSectionDtos = new HashSet<>(); - private String genericConceptsField = null; + private String educationPrinciplesField = null; /** * Description format can be null on external rule, otherwise it should never be null @@ -237,12 +237,12 @@ public class RuleDto { return Objects.equals(contextKey, otherContextKey); } - public Set<String> getGenericConcepts() { - return deserializeStringSet(genericConceptsField); + public Set<String> getEducationPrinciples() { + return deserializeStringSet(educationPrinciplesField); } - public RuleDto setGenericConcepts(Set<String> genericConcepts){ - this.genericConceptsField = serializeStringSet(genericConcepts); + public RuleDto setEducationPrinciples(Set<String> educationPrinciples){ + this.educationPrinciplesField = serializeStringSet(educationPrinciples); return this; } diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/rule/RuleMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/rule/RuleMapper.xml index 4ccbfe93651..fcd120cd8b5 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/rule/RuleMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/rule/RuleMapper.xml @@ -39,7 +39,7 @@ r.ad_hoc_description as "adHocDescription", r.ad_hoc_severity as "adHocSeverity", r.ad_hoc_type as "adHocType", - r.generic_concepts as "genericConceptsField" + r.education_principles as "educationPrinciplesField" </sql> <sql id="leftOuterJoinRulesDescriptionSections"> @@ -273,7 +273,7 @@ ad_hoc_description, ad_hoc_severity, ad_hoc_type, - generic_concepts, + education_principles, created_at, updated_at ) @@ -312,7 +312,7 @@ #{adHocDescription,jdbcType=CLOB}, #{adHocSeverity,jdbcType=VARCHAR}, #{adHocType,jdbcType=TINYINT}, - #{genericConceptsField,jdbcType=VARCHAR}, + #{educationPrinciplesField,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT} ) @@ -353,7 +353,7 @@ ad_hoc_description=#{adHocDescription,jdbcType=CLOB}, ad_hoc_severity=#{adHocSeverity,jdbcType=VARCHAR}, ad_hoc_type=#{adHocType,jdbcType=TINYINT}, - generic_concepts=#{genericConceptsField,jdbcType=VARCHAR}, + education_principles=#{educationPrinciplesField,jdbcType=VARCHAR}, updated_at=#{updatedAt,jdbcType=BIGINT} where uuid=#{uuid,jdbcType=VARCHAR} diff --git a/server/sonar-db-dao/src/schema/schema-sq.ddl b/server/sonar-db-dao/src/schema/schema-sq.ddl index 4c236994232..a9cfa3c66ad 100644 --- a/server/sonar-db-dao/src/schema/schema-sq.ddl +++ b/server/sonar-db-dao/src/schema/schema-sq.ddl @@ -865,7 +865,7 @@ CREATE TABLE "RULES"( "AD_HOC_DESCRIPTION" CHARACTER LARGE OBJECT, "AD_HOC_SEVERITY" CHARACTER VARYING(10), "AD_HOC_TYPE" TINYINT, - "GENERIC_CONCEPTS" CHARACTER VARYING(255) + "EDUCATION_PRINCIPLES" CHARACTER VARYING(255) ); ALTER TABLE "RULES" ADD CONSTRAINT "PK_RULES" PRIMARY KEY("UUID"); CREATE UNIQUE INDEX "RULES_REPO_KEY" ON "RULES"("PLUGIN_RULE_KEY" NULLS FIRST, "PLUGIN_NAME" NULLS FIRST); diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java index c26aea06e57..706fefe8adf 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java @@ -237,7 +237,7 @@ public class RuleDaoTest { assertThat(actual.getAdHocType()).isEqualTo(expected.getAdHocType()); assertThat(actual.getRuleDescriptionSectionDtos()).usingRecursiveFieldByFieldElementComparator() .containsExactlyInAnyOrderElementsOf(expected.getRuleDescriptionSectionDtos()); - assertThat(actual.getGenericConcepts()).isEqualTo(expected.getGenericConcepts()); + assertThat(actual.getEducationPrinciples()).isEqualTo(expected.getEducationPrinciples()); } @Test diff --git a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/rule/RuleTesting.java b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/rule/RuleTesting.java index 87e7ed0dde5..9fd58793de7 100644 --- a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/rule/RuleTesting.java +++ b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/rule/RuleTesting.java @@ -119,7 +119,7 @@ public class RuleTesting { .setCreatedAt(currentTimeMillis) .setUpdatedAt(currentTimeMillis + 5) .setScope(Scope.MAIN) - .setGenericConcepts(Set.of(randomAlphanumeric(5), randomAlphanumeric(5))); + .setEducationPrinciples(Set.of(randomAlphanumeric(5), randomAlphanumeric(5))); } public static RuleParamDto newRuleParam(RuleDto rule) { |