org.sonar.db.duplication.DuplicationMapper.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-db Show documentation
Show all versions of sonar-db Show documentation
Create and request SonarQube schema
<?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.db.duplication.DuplicationMapper"> <select id="selectCandidates" parameterType="map" resultType="DuplicationUnit"> SELECT DISTINCT duplication_block.id as id, duplication_block.snapshot_id as snapshotId, duplication_block.project_snapshot_id as projectSnapshotId, duplication_block.hash as hash, duplication_block.index_in_file as indexInFile, duplication_block.start_line as startLine, duplication_block.end_line as endLine, file_component.kee as componentKey FROM duplications_index duplication_block INNER JOIN snapshots snapshot ON duplication_block.snapshot_id=snapshot.id AND snapshot.islast=${_true} INNER JOIN projects file_component ON file_component.id=snapshot.project_id AND file_component.language=#{language} AND file_component.enabled=${_true} <where> AND duplication_block.hash in <foreach collection="hashes" open="(" close=")" item="hash" separator=",">#{hash}</foreach> <if test="projectSnapshotId != null"> AND duplication_block.project_snapshot_id <> #{projectSnapshotId} </if> </where> </select> <insert id="batchInsert" parameterType="DuplicationUnit" useGeneratedKeys="false"> 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>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy