aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-08-12 10:34:49 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-08-12 10:34:49 +0200
commitcf786503239c86eadd59dd518833a4b8bb456e66 (patch)
tree32e8844f649c5cd4989074281e45b8964d98be3f /sonar-core
parent20669607afc1668d6fdebab35169951409f4781f (diff)
downloadsonarqube-cf786503239c86eadd59dd518833a4b8bb456e66.tar.gz
sonarqube-cf786503239c86eadd59dd518833a4b8bb456e66.zip
SONAR-5417 Get batch project referentials using WS
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/component/ComponentDto.java1
-rw-r--r--sonar-core/src/main/java/org/sonar/core/component/db/ComponentMapper.java2
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/component/db/ComponentMapper.xml9
3 files changed, 11 insertions, 1 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/component/ComponentDto.java b/sonar-core/src/main/java/org/sonar/core/component/ComponentDto.java
index 569e8646269..6691124af8a 100644
--- a/sonar-core/src/main/java/org/sonar/core/component/ComponentDto.java
+++ b/sonar-core/src/main/java/org/sonar/core/component/ComponentDto.java
@@ -77,7 +77,6 @@ public class ComponentDto extends AuthorizedComponentDto implements Component {
return this;
}
- @Override
public String qualifier() {
return qualifier;
}
diff --git a/sonar-core/src/main/java/org/sonar/core/component/db/ComponentMapper.java b/sonar-core/src/main/java/org/sonar/core/component/db/ComponentMapper.java
index 5561948dc8c..58cfdba2b5d 100644
--- a/sonar-core/src/main/java/org/sonar/core/component/db/ComponentMapper.java
+++ b/sonar-core/src/main/java/org/sonar/core/component/db/ComponentMapper.java
@@ -54,5 +54,7 @@ public interface ComponentMapper {
@CheckForNull
AuthorizedComponentDto selectAuthorizedComponentById(long id);
+ AuthorizedComponentDto selectAuthorizedComponentByKey(String key);
+
void insert(ComponentDto rule);
}
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 77a9ad0a35d..452bebb9fcf 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
@@ -92,6 +92,15 @@
</where>
</select>
+ <select id="selectAuthorizedComponentByKey" parameterType="String" resultType="AuthorizedComponent">
+ SELECT <include refid="authorizedComponentColumns"/>
+ FROM projects p
+ <where>
+ AND p.enabled=${_true}
+ AND p.kee=#{key}
+ </where>
+ </select>
+
<sql id="insertColumns">
(kee, name, long_name, qualifier, scope, language, root_id, path, created_at)
</sql>