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

META-INF.modeler-mybatis-mappings.ModelRelation.xml Maven / Gradle / Ivy

The 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.flowable.ui.modeler.domain.ModelRelation">

	<resultMap id="modelRelationResultMap" type="org.flowable.ui.modeler.domain.ModelRelation">
		<id property="id" column="id" jdbcType="VARCHAR" />
		<result property="parentModelId" column="parent_model_id" jdbcType="VARCHAR" />
		<result property="modelId" column="model_id" jdbcType="VARCHAR" />
		<result property="type" column="relation_type" jdbcType="VARCHAR" />
	</resultMap>
	
	<resultMap id="modelInformationResultMap" type="org.flowable.ui.modeler.domain.ModelInformation">
        <id property="id" column="id" jdbcType="VARCHAR" />
        <result property="name" column="name" jdbcType="VARCHAR" />
        <result property="type" column="model_type" jdbcType="INTEGER" />
    </resultMap>
	
    <insert id="insertModelRelation" parameterType="org.flowable.ui.modeler.domain.ModelRelation">
        insert into ${prefix}ACT_DE_MODEL_RELATION (
            id,
            parent_model_id,
            model_id,
            relation_type) 
         values (
            #{id, jdbcType=VARCHAR},
            #{parentModelId, jdbcType=VARCHAR},
            #{modelId, jdbcType=VARCHAR},
            #{type, jdbcType=VARCHAR}
          )
    </insert>
    
    <update id="updateModelRelation" parameterType="org.flowable.ui.modeler.domain.ModelRelation">
        update ${prefix}ACT_DE_MODEL_RELATION
        <set>
            parent_model_id = #{parentModelId, jdbcType=VARCHAR},
            model_id = #{modelId, jdbcType=VARCHAR},
            relation_type = #{type, jdbcType=VARCHAR}
        </set>
        where id = #{id, jdbcType=VARCHAR}
    </update>
    
    <select id="selectModelRelationByParentModelIdAndType" parameterType="map" resultMap="modelRelationResultMap">
        select * from ${prefix}ACT_DE_MODEL_RELATION
        where parent_model_id = #{parentModelId, jdbcType=VARCHAR} and relation_type = #{type, jdbcType=VARCHAR}
    </select>
    
    <select id="selectModelInformationByParentModelId" parameterType="string" resultMap="modelInformationResultMap">
        select m.id as id, m.name as name, m.model_type as model_type 
        from ${prefix}ACT_DE_MODEL_RELATION mr inner join ${prefix}ACT_DE_MODEL m on mr.model_id = m.id
        where mr.parent_model_id = #{parentModelId, jdbcType=VARCHAR}
    </select>
    
    <select id="selectModelInformationModelId" parameterType="string" resultMap="modelInformationResultMap">
        select m.id as id, m.name as name, m.model_type as model_type 
        from ${prefix}ACT_DE_MODEL_RELATION mr inner join ${prefix}ACT_DE_MODEL m on mr.parent_model_id = m.id
        where mr.model_id = #{modelId, jdbcType=VARCHAR}
    </select>
    
    <delete id="deleteModelRelation" parameterType="org.flowable.ui.modeler.domain.ModelRelation">
        delete from ${prefix}ACT_DE_MODEL_RELATION where id = #{id, jdbcType=VARCHAR}
    </delete>
    
    <delete id="deleteModelRelationByParentModelId" parameterType="string">
        delete from ${prefix}ACT_DE_MODEL_RELATION  where parent_model_id = #{parentModelId, jdbcType=VARCHAR}
    </delete>
    
</mapper>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy