<mapper namespace="org.sonar.api.database.model.MeasureMapper">
<insert id="insert" parameterType="MeasureModel" keyColumn="id" useGeneratedKeys="true" keyProperty="id">
- <selectKey order="BEFORE" resultType="Long" keyProperty="id">
- select project_measures_seq.NEXTVAL from DUAL
- </selectKey>
- INSERT INTO project_measures (id,
+ INSERT INTO project_measures (
+ id,
value, metric_id, snapshot_id, rule_id, text_value, tendency, measure_date,
project_id, alert_status, alert_text, url, description, rule_priority, characteristic_id, variation_value_1,
variation_value_2, variation_value_3, variation_value_4, variation_value_5, person_id)
- VALUES (#{id},
- #{value}, #{metricId}, #{snapshotId}, #{ruleId}, #{textValue, jdbcType=VARCHAR}, #{tendency},
- #{measureDate, jdbcType=TIMESTAMP}, #{projectId}, #{alertStatus, jdbcType=VARCHAR}, #{alertText, jdbcType=VARCHAR},
- #{url, jdbcType=VARCHAR}, #{description, jdbcType=VARCHAR}, #{rulePriority.ordinal}, #{characteristic.id}, #{variationValue1},
+ VALUES (
+ project_measures_seq.NEXTVAL,
+ #{value}, #{metricId}, #{snapshotId}, #{ruleId}, #{textValue}, #{tendency},
+ #{measureDate}, #{projectId}, #{alertStatus}, #{alertText},
+ #{url}, #{description}, #{rulePriority.ordinal}, #{characteristic.id}, #{variationValue1},
#{variationValue2}, #{variationValue3}, #{variationValue4}, #{variationValue5}, #{personId}
)
</insert>
<insert id="batchInsert" parameterType="MeasureModel" useGeneratedKeys="false">
- <selectKey order="BEFORE" resultType="Long" keyProperty="id">
- select project_measures_seq.NEXTVAL from DUAL
- </selectKey>
- INSERT INTO project_measures (id,
+ INSERT INTO project_measures (
+ id,
value, metric_id, snapshot_id, rule_id, text_value, tendency, measure_date,
project_id, alert_status, alert_text, url, description, rule_priority, characteristic_id, variation_value_1,
variation_value_2, variation_value_3, variation_value_4, variation_value_5, person_id)
- VALUES (#{id},
- #{value}, #{metricId}, #{snapshotId}, #{ruleId}, #{textValue, jdbcType=VARCHAR}, #{tendency},
- #{measureDate, jdbcType=TIMESTAMP}, #{projectId}, #{alertStatus, jdbcType=VARCHAR}, #{alertText, jdbcType=VARCHAR},
- #{url, jdbcType=VARCHAR}, #{description, jdbcType=VARCHAR}, #{rulePriority.ordinal}, #{characteristic.id}, #{variationValue1},
+ VALUES (
+ project_measures_seq.NEXTVAL,
+ #{value}, #{metricId}, #{snapshotId}, #{ruleId}, #{textValue}, #{tendency},
+ #{measureDate, jdbcType=TIMESTAMP}, #{projectId}, #{alertStatus}, #{alertText},
+ #{url}, #{description}, #{rulePriority.ordinal}, #{characteristic.id}, #{variationValue1},
#{variationValue2}, #{variationValue3}, #{variationValue4}, #{variationValue5}, #{personId}
)
</insert>
value = #{value},
metric_id = #{metricId},
rule_id = #{ruleId},
- text_value = #{textValue, jdbcType=VARCHAR},
+ text_value = #{textValue},
tendency = #{tendency},
- alert_status = #{alertStatus, jdbcType=VARCHAR},
- alert_text = #{alertText, jdbcType=VARCHAR},
- url = #{url, jdbcType=VARCHAR},
- description = #{description, jdbcType=VARCHAR},
+ alert_status = #{alertStatus},
+ alert_text = #{alertText},
+ url = #{url},
+ description = #{description},
rule_priority = #{rulePriority.ordinal},
characteristic_id = #{characteristic.id},
variation_value_1 = #{variationValue1},
project_id, alert_status, alert_text, url, description, rule_priority, characteristic_id, variation_value_1,
variation_value_2, variation_value_3, variation_value_4, variation_value_5, person_id)
VALUES (
- #{value}, #{metricId}, #{snapshotId}, #{ruleId}, #{textValue, jdbcType=VARCHAR}, #{tendency},
- #{measureDate, jdbcType=TIMESTAMP}, #{projectId}, #{alertStatus, jdbcType=VARCHAR}, #{alertText, jdbcType=VARCHAR},
- #{url, jdbcType=VARCHAR}, #{description, jdbcType=VARCHAR}, #{rulePriority.ordinal}, #{characteristic.id}, #{variationValue1},
+ #{value}, #{metricId}, #{snapshotId}, #{ruleId}, #{textValue}, #{tendency},
+ #{measureDate}, #{projectId}, #{alertStatus}, #{alertText},
+ #{url}, #{description}, #{rulePriority.ordinal}, #{characteristic.id}, #{variationValue1},
#{variationValue2}, #{variationValue3}, #{variationValue4}, #{variationValue5}, #{personId}
)
</insert>
project_id, alert_status, alert_text, url, description, rule_priority, characteristic_id, variation_value_1,
variation_value_2, variation_value_3, variation_value_4, variation_value_5, person_id)
VALUES (
- #{value}, #{metricId}, #{snapshotId}, #{ruleId}, #{textValue, jdbcType=VARCHAR}, #{tendency},
- #{measureDate, jdbcType=TIMESTAMP}, #{projectId}, #{alertStatus, jdbcType=VARCHAR}, #{alertText, jdbcType=VARCHAR},
- #{url, jdbcType=VARCHAR}, #{description, jdbcType=VARCHAR}, #{rulePriority.ordinal}, #{characteristic.id}, #{variationValue1},
+ #{value}, #{metricId}, #{snapshotId}, #{ruleId}, #{textValue}, #{tendency},
+ #{measureDate}, #{projectId}, #{alertStatus}, #{alertText},
+ #{url}, #{description}, #{rulePriority.ordinal}, #{characteristic.id}, #{variationValue1},
#{variationValue2}, #{variationValue3}, #{variationValue4}, #{variationValue5}, #{personId}
)
</insert>
value = #{value},
metric_id = #{metricId},
rule_id = #{ruleId},
- text_value = #{textValue, jdbcType=VARCHAR},
+ text_value = #{textValue},
tendency = #{tendency},
- alert_status = #{alertStatus, jdbcType=VARCHAR},
- alert_text = #{alertText, jdbcType=VARCHAR},
- url = #{url, jdbcType=VARCHAR},
- description = #{description, jdbcType=VARCHAR},
+ alert_status = #{alertStatus},
+ alert_text = #{alertText},
+ url = #{url},
+ description = #{description},
rule_priority = #{rulePriority.ordinal},
characteristic_id = #{characteristic.id},
variation_value_1 = #{variationValue1},