mirror of
https://github.com/DependencyTrack/dependency-track.git
synced 2025-10-19 07:53:18 +00:00
Compare commits
6 commits
e5d2b14af6
...
db7198805c
Author | SHA1 | Date | |
---|---|---|---|
![]() |
db7198805c | ||
![]() |
a009379079 | ||
![]() |
aa5956e5c7 | ||
![]() |
645c710d7a | ||
![]() |
20929ed18e | ||
![]() |
b305b224ed |
2 changed files with 10 additions and 6 deletions
|
@ -1074,6 +1074,12 @@ final class ProjectQueryManager extends QueryManager implements IQueryManager {
|
|||
);
|
||||
executeAndCloseWithArray(sqlQuery, queryParameter);
|
||||
|
||||
sqlQuery = pm.newQuery(JDOQuery.SQL_QUERY_LANGUAGE, """
|
||||
DELETE FROM "POLICYVIOLATION" WHERE "PROJECT_ID" = ANY(?);
|
||||
""".replace("= ANY(?)", inExpression)
|
||||
);
|
||||
executeAndCloseWithArray(sqlQuery, queryParameter);
|
||||
|
||||
// Deletion with CTEs does not work with H2, but verified on Postgres and MS SQL Server
|
||||
if (!DbUtil.isH2()) {
|
||||
if (DbUtil.isPostgreSQL()) {
|
||||
|
@ -1186,12 +1192,6 @@ final class ProjectQueryManager extends QueryManager implements IQueryManager {
|
|||
);
|
||||
executeAndCloseWithArray(sqlQuery, queryParameter);
|
||||
|
||||
sqlQuery = pm.newQuery(JDOQuery.SQL_QUERY_LANGUAGE, """
|
||||
DELETE FROM "POLICYVIOLATION" WHERE "PROJECT_ID" = ANY(?);
|
||||
""".replace("= ANY(?)", inExpression)
|
||||
);
|
||||
executeAndCloseWithArray(sqlQuery, queryParameter);
|
||||
|
||||
sqlQuery = pm.newQuery(JDOQuery.SQL_QUERY_LANGUAGE, """
|
||||
DELETE FROM "POLICY_PROJECTS" WHERE "PROJECT_ID" = ANY(?);
|
||||
""".replace("= ANY(?)", inExpression)
|
||||
|
|
|
@ -1542,6 +1542,10 @@ public class QueryManager extends AlpineQueryManager {
|
|||
final Query<?> aclDeleteQuery = pm.newQuery(JDOQuery.SQL_QUERY_LANGUAGE, """
|
||||
DELETE FROM "PROJECT_ACCESS_TEAMS" WHERE "PROJECT_ACCESS_TEAMS"."TEAM_ID" = ?""");
|
||||
executeAndCloseWithArray(aclDeleteQuery, team.getId());
|
||||
|
||||
final Query<?> notificationRuleQuery = pm.newQuery(JDOQuery.SQL_QUERY_LANGUAGE, """
|
||||
DELETE FROM "NOTIFICATIONRULE_TEAMS" WHERE "NOTIFICATIONRULE_TEAMS"."TEAM_ID" = ?""");
|
||||
executeAndCloseWithArray(notificationRuleQuery, team.getId());
|
||||
}
|
||||
|
||||
pm.deletePersistent(team);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue