<mapper namespace="org.sonar.core.filter.CriterionMapper">
<insert id="insert" parameterType="Criterion" keyColumn="id" useGeneratedKeys="true" keyProperty="id">
+ <selectKey order="BEFORE" resultType="Long" keyProperty="id">
+ select criteria_seq.NEXTVAL from DUAL
+ </selectKey>
INSERT INTO criteria (id, filter_id, family, kee, operator, value, text_value, variation)
- VALUES (criteria_seq.NEXTVAL, #{filterId, jdbcType=INTEGER}, #{family, jdbcType=VARCHAR}, #{key, jdbcType=VARCHAR}, #{operator, jdbcType=VARCHAR}, #{value, jdbcType=FLOAT},
- #{textValue, jdbcType=VARCHAR}, #{variation})
+ VALUES (#{id}, #{filterId, jdbcType=INTEGER}, #{family, jdbcType=VARCHAR}, #{key, jdbcType=VARCHAR}, #{operator, jdbcType=VARCHAR}, #{value, jdbcType=FLOAT}, #{textValue, jdbcType=VARCHAR}, #{variation})
</insert>
</mapper>
<mapper namespace="org.sonar.core.filter.FilterColumnMapper">
- <insert id="insert" parameterType="FilterColumn" keyColumn="id" useGeneratedKeys="true" keyProperty="id">
+ <insert id="insert" parameterType="FilterColumn" keyColumn="id" useGeneratedKeys="true" keyProperty ="id">
+ <selectKey order="BEFORE" resultType="Long" keyProperty="id" >
+ select filter_columns_seq.NEXTVAL from DUAL
+ </selectKey>
INSERT INTO filter_columns (id, filter_id, family, kee, sort_direction, order_index, variation)
- VALUES (filter_columns_seq.NEXTVAL, #{filterId, jdbcType=INTEGER}, #{family, jdbcType=VARCHAR}, #{key, jdbcType=VARCHAR}, #{sortDirection, jdbcType=VARCHAR},
+ VALUES ((#{id}, #{filterId, jdbcType=INTEGER}, #{family, jdbcType=VARCHAR}, #{key, jdbcType=VARCHAR}, #{sortDirection, jdbcType=VARCHAR},
#{orderIndex, jdbcType=INTEGER}, #{variation})
</insert>
<select id="findFilter" parameterType="string" resultType="Filter">
select id, name, user_id as "userId", shared, favourites, resource_id as "resourceId", default_view as "defaultView", page_size as "pageSize", period_index as "periodIndex"
- from filters WHERE name=#{id}
+ from filters WHERE name=#{id} and user_id is null
</select>
- <insert id="insert" parameterType="Filter" keyColumn="id" useGeneratedKeys="true" keyProperty="id">
- <selectKey order="BEFORE" resultType="Long" keyProperty="id">
- select filters_seq.NEXTVAL from DUAL
+ <insert id="insert" parameterType="Filter" keyColumn="id" useGeneratedKeys="true" keyProperty ="id">
+ <selectKey order="BEFORE" resultType="Long" keyProperty="id" >
+ select filters_seq.NEXTVAL from DUAL
</selectKey>
INSERT INTO filters (id, name, user_id, shared, favourites, resource_id, default_view, page_size, period_index)
VALUES (#{id}, #{name, jdbcType=VARCHAR}, #{userId, jdbcType=FLOAT}, #{shared}, #{favourites}, #{resourceId, jdbcType=INTEGER}, #{defaultView, jdbcType=VARCHAR},
<select id="findFilter" parameterType="string" resultType="Filter">
select id, name, user_id as "userId", shared, favourites, resource_id as "resourceId", default_view as "defaultView", page_size as "pageSize", period_index as "periodIndex"
- from filters WHERE name=#{id}
+ from filters WHERE name=#{id} and user_id is null
</select>
<insert id="insert" parameterType="Filter" useGeneratedKeys="true" keyProperty="id">