aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2016-08-26 17:18:45 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-08-30 09:30:12 +0200
commit98330dc19f1f972ff0bf6e88fb827d9e6141a12f (patch)
treee1fee4e91f57d8c780f0d1b32909e8bbce0c08d4 /sonar-db
parent443ad96989ae5f3e5c3388da90a36dcb90d09bf7 (diff)
downloadsonarqube-98330dc19f1f972ff0bf6e88fb827d9e6141a12f.tar.gz
sonarqube-98330dc19f1f972ff0bf6e88fb827d9e6141a12f.zip
SONAR-7986 Remove property set values when removing property set
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/main/java/org/sonar/db/property/PropertiesDao.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/property/PropertiesDao.java b/sonar-db/src/main/java/org/sonar/db/property/PropertiesDao.java
index 38683018c91..cba42d90e9f 100644
--- a/sonar-db/src/main/java/org/sonar/db/property/PropertiesDao.java
+++ b/sonar-db/src/main/java/org/sonar/db/property/PropertiesDao.java
@@ -152,14 +152,18 @@ public class PropertiesDao implements Dao {
@CheckForNull
public PropertyDto selectProjectProperty(long resourceId, String propertyKey) {
DbSession session = mybatis.openSession(false);
- PropertiesMapper mapper = session.getMapper(PropertiesMapper.class);
try {
- return mapper.selectByKey(new PropertyDto().setKey(propertyKey).setResourceId(resourceId));
+ return selectProjectProperty(session, resourceId, propertyKey);
} finally {
MyBatis.closeQuietly(session);
}
}
+ @CheckForNull
+ public PropertyDto selectProjectProperty(DbSession dbSession, long resourceId, String propertyKey) {
+ return dbSession.getMapper(PropertiesMapper.class).selectByKey(new PropertyDto().setKey(propertyKey).setResourceId(resourceId));
+ }
+
public List<PropertyDto> selectByQuery(PropertyQuery query, DbSession session) {
return session.getMapper(PropertiesMapper.class).selectByQuery(query);
}