]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9140 a bit of formatting on RoleMapper.xml
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 14 Apr 2017 15:03:51 +0000 (17:03 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Thu, 27 Apr 2017 12:25:54 +0000 (14:25 +0200)
server/sonar-db-dao/src/main/resources/org/sonar/db/user/RoleMapper.xml

index 545d512be750014fb27a5206dcfca9c1b9e8b5cf..7ce32c4118dc58316ffc755b24b6f98ee9cc0e62 100644 (file)
@@ -4,26 +4,33 @@
 <mapper namespace="org.sonar.db.user.RoleMapper">
 
   <select id="selectComponentIdsByPermissionAndUserId" parameterType="map" resultType="long">
-    select ur.resource_id
-    from user_roles ur
-    <where>
-      and ur.user_id = #{userId,jdbcType=INTEGER}
+    select
+      ur.resource_id
+    from
+      user_roles ur
+    where
+      ur.user_id = #{userId,jdbcType=INTEGER}
       and ur.role = #{permission,jdbcType=VARCHAR}
-      and ur.resource_id IS NOT NULL
-    </where>
-    UNION
-    select gr.resource_id
-    from group_roles gr
-    inner join groups_users gu on gr.group_id=gu.group_id
-    <where>
-      and gr.role = #{permission,jdbcType=VARCHAR}
+      and ur.resource_id is not null
+    union
+    select
+      gr.resource_id
+    from
+      group_roles gr
+    inner join groups_users gu on
+      gr.group_id=gu.group_id
+    where
+      gr.role = #{permission,jdbcType=VARCHAR}
       and gr.resource_id is not null
       and gu.user_id=#{userId,jdbcType=INTEGER}
-    </where>
-    ORDER by resource_id
+    order by
+      resource_id
   </select>
 
   <delete id="deleteGroupRolesByGroupId" parameterType="int">
-    delete from group_roles where group_id=#{id,jdbcType=INTEGER}
+    delete from
+      group_roles
+    where
+      group_id=#{id,jdbcType=INTEGER}
   </delete>
 </mapper>