diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-10-31 21:04:52 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-10-31 21:30:05 +0400 |
commit | b4b0ff15e0b4390aab270d017ee764d528fb8b02 (patch) | |
tree | b5b4efb850207ad338ef435dfeb55a72170a0aab /sonar-core | |
parent | 6e9ec5e893b586d1e7e92d00c30d5a2111ef5e05 (diff) | |
download | sonarqube-b4b0ff15e0b4390aab270d017ee764d528fb8b02.tar.gz sonarqube-b4b0ff15e0b4390aab270d017ee764d528fb8b02.zip |
SONAR-2642 Support MSSQL DB for cross-project CPD
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/resources/org/sonar/persistence/model/DuplicationMapper-mssql.xml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sonar-core/src/main/resources/org/sonar/persistence/model/DuplicationMapper-mssql.xml b/sonar-core/src/main/resources/org/sonar/persistence/model/DuplicationMapper-mssql.xml new file mode 100644 index 00000000000..fe3e76926dd --- /dev/null +++ b/sonar-core/src/main/resources/org/sonar/persistence/model/DuplicationMapper-mssql.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="org.sonar.persistence.model.DuplicationMapper"> + + <select id="selectCandidates" parameterType="map" resultType="DuplicationUnit"> + SELECT DISTINCT to_blocks.hash hash, res.kee resourceKey, to_blocks.index_in_file indexInFile, to_blocks.start_line startLine, to_blocks.end_line endLine + FROM duplications_index to_blocks, duplications_index from_blocks, snapshots snapshot, projects res + WHERE from_blocks.snapshot_id = #{resource_snapshot_id} + AND to_blocks.hash = from_blocks.hash + AND to_blocks.snapshot_id = snapshot.id + AND snapshot.islast = 1 + AND snapshot.project_id = res.id + <if test="last_project_snapshot_id != null"> + AND to_blocks.project_snapshot_id != #{last_project_snapshot_id} + </if> + </select> + + <insert id="insert" parameterType="DuplicationUnit" keyColumn="id" useGeneratedKeys="true"> + INSERT INTO duplications_index (snapshot_id, project_snapshot_id, hash, index_in_file, start_line, end_line) + VALUES (#{snapshotId}, #{projectSnapshotId}, #{hash}, #{indexInFile}, #{startLine}, #{endLine}) + </insert> + +</mapper> |