aboutsummaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources/mybatis/sql
diff options
context:
space:
mode:
Diffstat (limited to 'intentanalysis/src/main/resources/mybatis/sql')
-rw-r--r--intentanalysis/src/main/resources/mybatis/sql/ObjectInstanceMapper.xml12
1 files changed, 7 insertions, 5 deletions
diff --git a/intentanalysis/src/main/resources/mybatis/sql/ObjectInstanceMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/ObjectInstanceMapper.xml
index 63047ce..cec563c 100644
--- a/intentanalysis/src/main/resources/mybatis/sql/ObjectInstanceMapper.xml
+++ b/intentanalysis/src/main/resources/mybatis/sql/ObjectInstanceMapper.xml
@@ -5,11 +5,13 @@
<mapper namespace="org.onap.usecaseui.intentanalysis.mapper.ObjectInstanceMapper">
<insert id="insertObjectInstanceList">
- insert into object_instance(parent_id, object_instance)
- values
- <foreach collection="objectInstances" index="index" item="item" separator=",">
- (#{parentId}, #{item})
- </foreach>
+ <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">