]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5755 fix cursor mode on PostgresSQL
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 28 Oct 2014 15:22:36 +0000 (16:22 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 28 Oct 2014 15:45:56 +0000 (16:45 +0100)
sonar-core/src/main/java/org/sonar/core/persistence/migration/v50/Migration50Mapper.java
sonar-core/src/main/resources/org/sonar/core/persistence/migration/v50/Migration50Mapper.xml

index 61c1c43fb91c9171319239b3f02a5353453dd3e2..8fa97afee1e103b4922b41898b96083b26bf9f6a 100644 (file)
@@ -21,8 +21,6 @@
 package org.sonar.core.persistence.migration.v50;
 
 import org.apache.ibatis.annotations.*;
-import org.apache.ibatis.mapping.ResultSetType;
-import org.apache.ibatis.mapping.StatementType;
 
 import java.util.List;
 
@@ -31,21 +29,6 @@ public interface Migration50Mapper {
   /**
    * Return root projects (Views and Developers are NOT returned)
    */
-  @Select("SELECT " +
-    "  p.id AS \"id\", " +
-    "  p.uuid AS \"uuid\", " +
-    "  p.project_uuid AS \"projectUuid\", " +
-    "  s.root_project_id AS \"projectId\", " +
-    "  s.id AS \"snapshotId\", " +
-    "  s.path AS \"snapshotPath\", " +
-    "  p.scope AS \"scope\" " +
-    "FROM projects p " +
-    "  LEFT OUTER JOIN snapshots s ON s.project_id = p.id AND s.islast = ${_true} " +
-    "  WHERE " +
-    "   p.scope = 'PRJ' " +
-    "   AND p.root_id IS NULL ")
-  @Result(javaType = Component.class)
-  @Options(statementType = StatementType.PREPARED, resultSetType = ResultSetType.FORWARD_ONLY, fetchSize = 200)
   List<Component> selectRootProjects();
 
   @Select("SELECT " +
index 1db97943867f5c3168e9e2fdf4eda0d4ba9a2eaf..5d69ead06e54780b5098899aafae386b6d43d8d2 100644 (file)
@@ -3,5 +3,21 @@
 
 <mapper namespace="org.sonar.core.persistence.migration.v50.Migration50Mapper">
 
+  <select id="selectRootProjects" resultType="org.sonar.core.persistence.migration.v50.Component" fetchSize="200" resultSetType="FORWARD_ONLY">
+    SELECT
+    p.id AS "id",
+    p.uuid AS "uuid",
+    p.project_uuid AS "projectUuid",
+    s.root_project_id AS "projectId",
+    s.id AS "snapshotId",
+    s.path AS "snapshotPath",
+    p.scope AS "scope"
+    FROM projects p
+    LEFT OUTER JOIN snapshots s ON s.project_id = p.id AND s.islast = ${_true}
+    WHERE
+    p.scope = 'PRJ'
+    AND p.root_id IS NULL
+  </select>
+
 </mapper>