summaryrefslogtreecommitdiffstats
path: root/sonar-core/src
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2015-02-13 10:40:05 +0100
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-02-13 14:39:56 +0100
commitd11e107895b68fbf056523f6551903c9c02021fb (patch)
treec9ca576d4810e58e617e7203cd47023ab6d308e1 /sonar-core/src
parentdf1952e05ec5bfed9ce8b69a01c12ada13dcb29a (diff)
downloadsonarqube-d11e107895b68fbf056523f6551903c9c02021fb.tar.gz
sonarqube-d11e107895b68fbf056523f6551903c9c02021fb.zip
SONAR-6122 Update /batch/projects WS with new module UUID path
Diffstat (limited to 'sonar-core/src')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/component/db/ComponentIndexMapper.java2
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/component/db/ComponentIndexMapper.xml2
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml11
3 files changed, 7 insertions, 8 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/component/db/ComponentIndexMapper.java b/sonar-core/src/main/java/org/sonar/core/component/db/ComponentIndexMapper.java
index 114b8da6ba0..694d0c752a6 100644
--- a/sonar-core/src/main/java/org/sonar/core/component/db/ComponentIndexMapper.java
+++ b/sonar-core/src/main/java/org/sonar/core/component/db/ComponentIndexMapper.java
@@ -26,5 +26,5 @@ import java.util.List;
public interface ComponentIndexMapper {
- List<Long> selectProjectIdsFromQueryAndViewOrSubViewUuid(@Param("query") String query, @Param("viewOrSubViewUuid") String viewOrSubViewUuid);
+ List<Long> selectProjectIdsFromQueryAndViewOrSubViewUuid(@Param("query") String query, @Param("viewUuidQuery") String viewUuidQuery);
}
diff --git a/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentIndexMapper.xml b/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentIndexMapper.xml
index 6b80ef94aac..1e88b4100b9 100644
--- a/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentIndexMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentIndexMapper.xml
@@ -6,7 +6,7 @@
SELECT r.resource_id FROM resource_index r
INNER JOIN projects copy ON copy.copy_resource_id = r.resource_id
<where>
- AND copy.module_uuid_path LIKE #{viewOrSubViewUuid}
+ AND copy.module_uuid_path LIKE #{viewUuidQuery}
AND r.kee LIKE #{query}
</where>
ORDER BY r.name_size
diff --git a/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml b/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml
index ee96cd81563..e48052debb5 100644
--- a/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml
@@ -143,23 +143,22 @@
<sql id="modulesTreeQuery">
INNER JOIN projects root_project ON root_project.uuid = p.project_uuid AND root_project.enabled = ${_true}
- INNER JOIN projects module ON module.project_uuid = root_project.uuid AND module.enabled = ${_true} AND module.uuid = #{moduleUuid}
+ INNER JOIN projects module ON module.project_uuid = root_project.uuid AND module.enabled = ${_true} AND module.uuid = #{moduleUuid} AND module.scope='PRJ'
<where>
p.enabled = ${_true}
AND p.scope = #{scope}
- AND (p.uuid = module.uuid OR
+ AND
<choose>
<when test="_databaseId == 'mssql'">
- p.module_uuid_path LIKE module.module_uuid_path + module.uuid + '.%'
+ p.module_uuid_path LIKE module.module_uuid_path + '%'
</when>
<when test="_databaseId == 'mysql'">
- p.module_uuid_path LIKE concat(module.module_uuid_path, module.uuid, '.%')
+ p.module_uuid_path LIKE concat(module.module_uuid_path, '%')
</when>
<otherwise>
- p.module_uuid_path LIKE module.module_uuid_path || module.uuid || '.%'
+ p.module_uuid_path LIKE module.module_uuid_path || '%'
</otherwise>
</choose>
- )
</where>
</sql>