summaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources/mybatis/sql/ObjectInstanceMapper.xml
blob: cec563c02ba61d26c460f0c6950b029fb29a15c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?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.onap.usecaseui.intentanalysis.mapper.ObjectInstanceMapper">

    <insert id="insertObjectInstanceList">
        <if test="objectInstances != null and objectInstances.size>0">
          insert into object_instance(parent_id, object_instance)
          values
            <foreach collection="objectInstances" index="index" item="item" separator=",">
                  (#{parentId}, #{item})
            </foreach>
        </if>
    </insert>

    <select id="getObjectInstances" resultType="java.lang.String">
        select object_instance  from object_instance where parent_id = #{parentId}
    </select>

    <delete id="deleteObjectInstances">
        delete from object_instance where parent_id = #{parentId}
    </delete>

</mapper>