]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3437 Simplify mapping files
authorDavid Gageot <david@gageot.net>
Tue, 10 Jul 2012 14:58:35 +0000 (16:58 +0200)
committerDavid Gageot <david@gageot.net>
Tue, 10 Jul 2012 14:58:35 +0000 (16:58 +0200)
sonar-plugin-api/src/main/resources/org/sonar/api/database/model/MeasureMapper-oracle.xml
sonar-plugin-api/src/main/resources/org/sonar/api/database/model/MeasureMapper.xml

index 2e4c7fd0d2f64db043dbc9a3b50c7669ddfe9b18..bac51609efe2e933de06ec105c18f8a508851960 100644 (file)
@@ -4,33 +4,31 @@
 <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},
index c89f8eed8d1450cb884c52ede49621851f56962c..e4eb62d7310b32eee4d475855e98237d7320197e 100644 (file)
@@ -9,9 +9,9 @@
       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>
@@ -22,9 +22,9 @@
       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},