File tree Expand file tree Collapse file tree 4 files changed +138
-355
lines changed
java/org/dependencytrack/persistence/repository
test/java/org/dependencytrack/persistence/repository
notification-publisher/src/test/java/org/dependencytrack/notification/publisher Expand file tree Collapse file tree 4 files changed +138
-355
lines changed Original file line number Diff line number Diff line change @@ -39,17 +39,12 @@ public class UserRepository {
39
39
@ SuppressWarnings ("unchecked" )
40
40
public List <String > findEmailsByTeam (final long teamId ) {
41
41
return entityManager .createNativeQuery ("""
42
- SELECT "MU"."EMAIL" AS "EMAIL" FROM "MANAGEDUSER" AS "MU"
43
- INNER JOIN "MANAGEDUSERS_TEAMS" AS "MUT" ON "MUT"."MANAGEDUSER_ID" = "MU"."ID"
44
- WHERE "MUT"."TEAM_ID" = :teamId AND "MU"."EMAIL" IS NOT NULL
45
- UNION
46
- SELECT "LU"."EMAIL" AS "EMAIL" FROM "LDAPUSER" AS "LU"
47
- INNER JOIN "LDAPUSERS_TEAMS" AS "LUT" ON "LUT"."LDAPUSER_ID" = "LU"."ID"
48
- WHERE "LUT"."TEAM_ID" = :teamId AND "LU"."EMAIL" IS NOT NULL
49
- UNION
50
- SELECT "OU"."EMAIL" AS "EMAIL" FROM "OIDCUSER" AS "OU"
51
- INNER JOIN "OIDCUSERS_TEAMS" AS "OUT" ON "OUT"."OIDCUSERS_ID" = "OU"."ID"
52
- WHERE "OUT"."TEAM_ID" = :teamId AND "OU"."EMAIL" IS NOT NULL
42
+ SELECT DISTINCT "USER"."EMAIL"
43
+ FROM "USERS_TEAMS"
44
+ INNER JOIN "USER"
45
+ ON "USER"."ID" = "USERS_TEAMS"."USER_ID"
46
+ WHERE "TEAM_ID" = :teamId
47
+ AND "USER"."EMAIL" IS NOT NULL
53
48
""" )
54
49
.setParameter ("teamId" , teamId )
55
50
.setHint (HINT_READ_ONLY , true )
You can’t perform that action at this time.
0 commit comments