]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7330 remove unused SQL requests from RuleMapper
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 1 Mar 2016 09:08:24 +0000 (10:08 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 1 Mar 2016 14:08:34 +0000 (15:08 +0100)
sonar-db/src/main/java/org/sonar/db/rule/RuleMapper.java
sonar-db/src/main/resources/org/sonar/db/rule/RuleMapper.xml

index 8001cc380fbce876c593d6ac608e3e526974e53d..c98b551dbd010d66a8babb578171b6832e37f7f3 100644 (file)
@@ -19,9 +19,7 @@
  */
 package org.sonar.db.rule;
 
-import java.sql.Timestamp;
 import java.util.List;
-import javax.annotation.Nullable;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.session.ResultHandler;
 import org.sonar.api.rule.RuleKey;
@@ -53,25 +51,17 @@ public interface RuleMapper {
 
   void update(RuleDto rule);
 
-  void batchInsert(RuleDto rule);
-
   void insert(RuleDto rule);
 
-  List<RuleParamDto> selectAllParams();
-
   List<RuleParamDto> selectParamsByRuleIds(@Param("ruleIds") List<Integer> ruleIds);
 
   List<RuleParamDto> selectParamsByRuleKey(RuleKey ruleKey);
 
   List<RuleParamDto> selectParamsByRuleKeys(@Param("ruleKeys") List<RuleKey> ruleKeys);
 
-  RuleParamDto selectParamByRuleAndKey(@Param("ruleId") Integer ruleId, @Param("key") String key);
-
   void insertParameter(RuleParamDto param);
 
   void updateParameter(RuleParamDto param);
 
   void deleteParameter(Integer paramId);
-
-  List<RuleDto> selectAfterDate(@Nullable @Param("date") Timestamp timestamp);
 }
index aded450d1996a21497ec8d66f4c4b2d51ee29e29..fd22b8d057694afbe672ee32155ab754ce0bd310 100644 (file)
     from rules r
   </select>
 
-  <select id="selectAfterDate" resultType="Rule" fetchSize="${_scrollFetchSize}" resultSetType="FORWARD_ONLY">
-    select
-    <include refid="selectColumns"/>
-    from rules r
-    <where>
-      <if test="date != null">
-        r.updated_at IS NULL or r.updated_at &gt;= #{date}
-      </if>
-    </where>
-  </select>
-
   <select id="selectEnabledAndNonManual" resultType="Rule">
     select
     <include refid="selectColumns"/>
     #{noteUpdatedAt}, #{createdAt}, #{updatedAt})
   </insert>
 
-  <insert id="batchInsert" parameterType="Rule" useGeneratedKeys="false">
-    insert into rules
-    <include refid="insertColumns"/>
-    values (#{ruleKey,jdbcType=VARCHAR}, #{repositoryKey,jdbcType=VARCHAR}, #{description,jdbcType=CLOB},
-    #{descriptionFormat,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
-    #{configKey,jdbcType=VARCHAR},
-    #{severity,jdbcType=INTEGER}, #{isTemplate,jdbcType=BOOLEAN}, #{language,jdbcType=VARCHAR},
-    #{templateId,jdbcType=INTEGER},
-    #{remediationFunction,jdbcType=VARCHAR}, #{defaultRemediationFunction,jdbcType=VARCHAR},
-    #{remediationCoefficient,jdbcType=VARCHAR}, #{defaultRemediationCoefficient,jdbcType=VARCHAR},
-    #{remediationOffset,jdbcType=VARCHAR}, #{defaultRemediationOffset,jdbcType=VARCHAR},
-    #{effortToFixDescription}, #{tagsField}, #{systemTagsField}, #{noteData}, #{noteUserLogin}, #{noteCreatedAt},
-    #{noteUpdatedAt,jdbcType=TIMESTAMP},
-    #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}
-    )
-  </insert>
-
   <delete id="deleteParams" parameterType="Integer">
     delete from active_rule_parameters where rules_parameter_id=#{id}
   </delete>
     p.description as "description"
   </sql>
 
-  <select id="selectAllParams" resultType="RuleParam">
-    select
-    <include refid="paramColumns"/>
-    from rules_parameters p
-  </select>
-
   <select id="selectParamsByRuleIds" resultType="RuleParam">
     SELECT
     <include refid="paramColumns"/>
     </foreach>
   </select>
 
-  <select id="selectParamByRuleAndKey" resultType="RuleParam">
-    SELECT
-    <include refid="paramColumns"/>
-    FROM rules_parameters p
-    WHERE p.rule_id=#{ruleId} AND p.name=#{key}
-  </select>
-
   <delete id="deleteParameter" parameterType="Integer">
     delete from rules_parameters where id=#{id}
   </delete>