All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.db.component.ComponentLinkMapper.xml Maven / Gradle / Ivy

There is a newer version: 6.3.1
Show newest version
<?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.component.ComponentLinkMapper">

  <sql id="componentLinkColumns">
    p.id,
    p.component_uuid as "componentUuid",
    p.link_type as "type",
    p.name as name,
    p.href as href
  </sql>

  <select id="selectByComponentUuid" parameterType="String" resultType="ComponentLink">
    SELECT
    <include refid="componentLinkColumns"/>
    FROM project_links p
    <where>
      AND p.component_uuid=#{uuid}
    </where>
  </select>

  <insert id="insert" parameterType="ComponentLink" keyColumn="id" useGeneratedKeys="true" keyProperty="id">
    INSERT INTO project_links (component_uuid, link_type, name, href)
    VALUES (#{componentUuid,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
    #{href,jdbcType=VARCHAR})
  </insert>

  <insert id="update" parameterType="ComponentLink" useGeneratedKeys="false">
    UPDATE project_links SET component_uuid=#{componentUuid,jdbcType=VARCHAR}, link_type=#{type,jdbcType=VARCHAR},
    name=#{name,jdbcType=VARCHAR}, href=#{href,jdbcType=VARCHAR}
    WHERE id=#{id}
  </insert>

  <delete id="delete">
    DELETE FROM project_links WHERE id=#{id}
  </delete>

</mapper>





© 2015 - 2025 Weber Informatics LLC | Privacy Policy