You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by he...@apache.org on 2022/03/01 09:14:50 UTC
[incubator-inlong] branch master updated: [INLONG-2798][Manager] Fix bugs in SortSourceConfig xml file (#2801)
This is an automated email from the ASF dual-hosted git repository.
healchow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong.git
The following commit(s) were added to refs/heads/master by this push:
new 3f85fde [INLONG-2798][Manager] Fix bugs in SortSourceConfig xml file (#2801)
3f85fde is described below
commit 3f85fde49408dd939fda820628e0c519b3f61fc4
Author: imvan <de...@pku.edu.cn>
AuthorDate: Tue Mar 1 17:14:00 2022 +0800
[INLONG-2798][Manager] Fix bugs in SortSourceConfig xml file (#2801)
---
.../dao/mapper/SortSourceConfigEntityMapper.java | 10 ++++
.../src/main/resources/generatorConfig.xml | 6 +-
.../mappers/SortSourceConfigEntityMapper.xml | 68 +++++++++++++++++++++-
3 files changed, 80 insertions(+), 4 deletions(-)
diff --git a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/SortSourceConfigEntityMapper.java b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/SortSourceConfigEntityMapper.java
index 30398f9..80dfe03 100644
--- a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/SortSourceConfigEntityMapper.java
+++ b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/SortSourceConfigEntityMapper.java
@@ -25,10 +25,20 @@ import java.util.List;
@Repository
public interface SortSourceConfigEntityMapper {
+ int deleteByPrimaryKey(Integer id);
+
int insert(SortSourceConfigEntity record);
int insertSelective(SortSourceConfigEntity record);
+ SortSourceConfigEntity selectByPrimaryKey(Integer id);
+
+ int updateByPrimaryKeySelective(SortSourceConfigEntity record);
+
+ int updateByPrimaryKeyWithBLOBs(SortSourceConfigEntity record);
+
+ int updateByPrimaryKey(SortSourceConfigEntity record);
+
List<SortSourceConfigEntity> selectByClusterAndTask(
@Param("clusterName") String clusterName,
@Param("taskName") String taskName);
diff --git a/inlong-manager/manager-dao/src/main/resources/generatorConfig.xml b/inlong-manager/manager-dao/src/main/resources/generatorConfig.xml
index a310ca1..b44d175 100644
--- a/inlong-manager/manager-dao/src/main/resources/generatorConfig.xml
+++ b/inlong-manager/manager-dao/src/main/resources/generatorConfig.xml
@@ -262,9 +262,9 @@
enableSelectByExample="false" enableUpdateByExample="false"/>
<table tableName="sort_source_config" domainObjectName="SortSourceConfigEntity"
- enableSelectByPrimaryKey="false"
- enableUpdateByPrimaryKey="false"
- enableDeleteByPrimaryKey="false" enableInsert="true"
+ enableSelectByPrimaryKey="true"
+ enableUpdateByPrimaryKey="true"
+ enableDeleteByPrimaryKey="true" enableInsert="true"
enableCountByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" enableUpdateByExample="false"/>-->
diff --git a/inlong-manager/manager-dao/src/main/resources/mappers/SortSourceConfigEntityMapper.xml b/inlong-manager/manager-dao/src/main/resources/mappers/SortSourceConfigEntityMapper.xml
index 1cccf90..cfcfb54 100644
--- a/inlong-manager/manager-dao/src/main/resources/mappers/SortSourceConfigEntityMapper.xml
+++ b/inlong-manager/manager-dao/src/main/resources/mappers/SortSourceConfigEntityMapper.xml
@@ -19,6 +19,34 @@
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.apache.inlong.manager.dao.mapper.SortSourceConfigEntityMapper">
+ <resultMap id="BaseResultMap" type="org.apache.inlong.manager.dao.entity.SortSourceConfigEntity">
+ <id column="id" jdbcType="INTEGER" property="id" />
+ <result column="cluster_name" jdbcType="VARCHAR" property="clusterName" />
+ <result column="task_name" jdbcType="VARCHAR" property="taskName" />
+ <result column="zone_name" jdbcType="VARCHAR" property="zoneName" />
+ <result column="topic" jdbcType="VARCHAR" property="topic" />
+ </resultMap>
+ <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="org.apache.inlong.manager.dao.entity.SortSourceConfigEntity">
+ <result column="ext_params" jdbcType="LONGVARCHAR" property="extParams" />
+ </resultMap>
+ <sql id="Base_Column_List">
+ id, cluster_name, task_name, zone_name, topic
+ </sql>
+ <sql id="Blob_Column_List">
+ ext_params
+ </sql>
+ <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
+ select
+ <include refid="Base_Column_List" />
+ ,
+ <include refid="Blob_Column_List" />
+ from sort_source_config
+ where id = #{id,jdbcType=INTEGER}
+ </select>
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+ delete from sort_source_config
+ where id = #{id,jdbcType=INTEGER}
+ </delete>
<insert id="insert" parameterType="org.apache.inlong.manager.dao.entity.SortSourceConfigEntity">
insert into sort_source_config (id, cluster_name, task_name,
zone_name, topic, ext_params
@@ -70,8 +98,46 @@
</if>
</trim>
</insert>
+ <update id="updateByPrimaryKeySelective" parameterType="org.apache.inlong.manager.dao.entity.SortSourceConfigEntity">
+ update sort_source_config
+ <set>
+ <if test="clusterName != null">
+ cluster_name = #{clusterName,jdbcType=VARCHAR},
+ </if>
+ <if test="taskName != null">
+ task_name = #{taskName,jdbcType=VARCHAR},
+ </if>
+ <if test="zoneName != null">
+ zone_name = #{zoneName,jdbcType=VARCHAR},
+ </if>
+ <if test="topic != null">
+ topic = #{topic,jdbcType=VARCHAR},
+ </if>
+ <if test="extParams != null">
+ ext_params = #{extParams,jdbcType=LONGVARCHAR},
+ </if>
+ </set>
+ where id = #{id,jdbcType=INTEGER}
+ </update>
+ <update id="updateByPrimaryKeyWithBLOBs" parameterType="org.apache.inlong.manager.dao.entity.SortSourceConfigEntity">
+ update sort_source_config
+ set cluster_name = #{clusterName,jdbcType=VARCHAR},
+ task_name = #{taskName,jdbcType=VARCHAR},
+ zone_name = #{zoneName,jdbcType=VARCHAR},
+ topic = #{topic,jdbcType=VARCHAR},
+ ext_params = #{extParams,jdbcType=LONGVARCHAR}
+ where id = #{id,jdbcType=INTEGER}
+ </update>
+ <update id="updateByPrimaryKey" parameterType="org.apache.inlong.manager.dao.entity.SortSourceConfigEntity">
+ update sort_source_config
+ set cluster_name = #{clusterName,jdbcType=VARCHAR},
+ task_name = #{taskName,jdbcType=VARCHAR},
+ zone_name = #{zoneName,jdbcType=VARCHAR},
+ topic = #{topic,jdbcType=VARCHAR}
+ where id = #{id,jdbcType=INTEGER}
+ </update>
- <select id="selectByClusterAndTask" resultMap="BaseResultMap">
+ <select id="selectByClusterAndTask" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
from sort_source_config