diff options
3 files changed, 16 insertions, 0 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesDao.java index 4db1a4cda5c..9cbaf376819 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesDao.java @@ -175,6 +175,10 @@ public class PropertiesDao implements Dao { return getMapper(session).selectEntityPropertyByKeyAndUserUuid(key, userUuid); } + public List<PropertyDto> selectProjectPropertyByKey(DbSession session, String key) { + return getMapper(session).selectProjectPropertyByKey(key); + } + /** * Saves the specified property and its value. * <p> diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesMapper.java index 6689fe4f62c..80a424f8c1f 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesMapper.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/property/PropertiesMapper.java @@ -40,6 +40,8 @@ public interface PropertiesMapper { List<PropertyDto> selectEntityPropertyByKeyAndUserUuid(@Param("key") String key, @Param("userUuid") String userUuid); + List<PropertyDto> selectProjectPropertyByKey(@Param("key") String key); + List<PropertyDto> selectByEntityUuids(@Param("entityUuids") List<String> entityUuids); List<PropertyDto> selectByQuery(@Param("query") PropertyQuery query); diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/property/PropertiesMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/property/PropertiesMapper.xml index 110d99e50e3..b186e885986 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/property/PropertiesMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/property/PropertiesMapper.xml @@ -153,6 +153,16 @@ and por.uuid is not null </select> + <select id="selectProjectPropertyByKey" parameterType="map" resultType="ScrapProperty"> + select + <include refid="columnsToScrapPropertyDto"/> + from properties p + inner join projects prj on prj.uuid=p.entity_uuid + where + p.prop_key = #{key, jdbcType=VARCHAR} + and p.user_uuid is null + </select> + <select id="selectByQuery" parameterType="map" resultType="ScrapProperty"> select <include refid="columnsToScrapPropertyDto"/> |