diff options
author | Stephane Gamard <stephane.gamard@searchbox.com> | 2014-08-19 18:19:39 +0200 |
---|---|---|
committer | Stephane Gamard <stephane.gamard@searchbox.com> | 2014-08-20 18:18:38 +0200 |
commit | dd237c28a020d890e77a275e07ee09adaac39979 (patch) | |
tree | e4e8c86cfc5dbce2cc99a7dc7453afedf3d23f8e /sonar-core | |
parent | ba80308af044487d736ecb66d6f7874d82d172f1 (diff) | |
download | sonarqube-dd237c28a020d890e77a275e07ee09adaac39979.tar.gz sonarqube-dd237c28a020d890e77a275e07ee09adaac39979.zip |
Updated DAO with findAfterDate method
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/rule/RuleMapper.java | 38 | ||||
-rw-r--r-- | sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml | 6 |
2 files changed, 38 insertions, 6 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/rule/RuleMapper.java b/sonar-core/src/main/java/org/sonar/core/rule/RuleMapper.java index 5aeb9fbfaa7..3b9a1a9ab78 100644 --- a/sonar-core/src/main/java/org/sonar/core/rule/RuleMapper.java +++ b/sonar-core/src/main/java/org/sonar/core/rule/RuleMapper.java @@ -19,9 +19,13 @@ */ package org.sonar.core.rule; +import org.apache.ibatis.annotations.Options; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Select; import org.sonar.api.rule.RuleKey; +import java.sql.Timestamp; import java.util.List; public interface RuleMapper { @@ -60,4 +64,38 @@ public interface RuleMapper { void deleteParameter(Integer paramId); + final String SELECT_FIELDS="r.id,\n" + + " r.plugin_rule_key as \"ruleKey\",\n" + + " r.plugin_name as \"repositoryKey\",\n" + + " r.description,\n" + + " r.description_format as \"descriptionFormat\",\n" + + " r.status,\n" + + " r.name,\n" + + " r.plugin_config_key as \"configKey\",\n" + + " r.priority as \"severity\",\n" + + " r.is_template as \"isTemplate\",\n" + + " r.language as \"language\",\n" + + " r.template_id as \"templateId\",\n" + + " r.note_data as \"noteData\",\n" + + " r.note_user_login as \"noteUserLogin\",\n" + + " r.note_created_at as \"noteCreatedAt\",\n" + + " r.note_updated_at as \"noteUpdatedAt\",\n" + + " r.characteristic_id as \"subCharacteristicId\",\n" + + " r.default_characteristic_id as \"defaultSubCharacteristicId\",\n" + + " r.remediation_function as \"remediationFunction\",\n" + + " r.default_remediation_function as \"defaultRemediationFunction\",\n" + + " r.remediation_coeff as \"remediationCoefficient\",\n" + + " r.default_remediation_coeff as \"defaultRemediationCoefficient\",\n" + + " r.remediation_offset as \"remediationOffset\",\n" + + " r.default_remediation_offset as \"defaultRemediationOffset\",\n" + + " r.effort_to_fix_description as \"effortToFixDescription\",\n" + + " r.tags as \"tagsField\",\n" + + " r.system_tags as \"systemTagsField\",\n" + + " r.created_at as \"createdAt\",\n" + + " r.updated_at as \"updatedAt\""; + + @Select("SELECT " + SELECT_FIELDS + " FROM rules r WHERE r.updated_at IS NULL or r.updated_at >= #{date} ") + @Options(fetchSize = 200, useCache = false, flushCache = true) + @Result(javaType = RuleDto.class) + List<RuleDto> selectAfterDate(@Param("date") Timestamp timestamp); } 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 6255c904b7d..bb2e84f6ca1 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 @@ -177,11 +177,5 @@ description=#{description} WHERE id=#{id} </update> - - <select id="selectKeysOfRulesUpdatedSince" resultType="map" > - SELECT r.plugin_name as "repoField", r.plugin_rule_key as "ruleField" - FROM rules r - WHERE r.updated_at IS NULL or r.updated_at >= #{id} - </select> </mapper> |