aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-10-28 16:22:36 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-10-28 16:45:56 +0100
commit2e2ef2b8b496365be9072894491820ed752d1a1a (patch)
tree633c6fc2ecf39a0854cb0c24a5c16469c149202c
parent92521dc6547d516be403e2621fc2cf536face4d2 (diff)
downloadsonarqube-2e2ef2b8b496365be9072894491820ed752d1a1a.tar.gz
sonarqube-2e2ef2b8b496365be9072894491820ed752d1a1a.zip
SONAR-5755 fix cursor mode on PostgresSQL
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/migration/v50/Migration50Mapper.java17
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/migration/v50/Migration50Mapper.xml16
2 files changed, 16 insertions, 17 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/migration/v50/Migration50Mapper.java b/sonar-core/src/main/java/org/sonar/core/persistence/migration/v50/Migration50Mapper.java
index 61c1c43fb91..8fa97afee1e 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/migration/v50/Migration50Mapper.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/migration/v50/Migration50Mapper.java
@@ -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 " +
diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/migration/v50/Migration50Mapper.xml b/sonar-core/src/main/resources/org/sonar/core/persistence/migration/v50/Migration50Mapper.xml
index 1db97943867..5d69ead06e5 100644
--- a/sonar-core/src/main/resources/org/sonar/core/persistence/migration/v50/Migration50Mapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/persistence/migration/v50/Migration50Mapper.xml
@@ -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>