mirror of
https://github.com/DependencyTrack/dependency-track.git
synced 2025-10-19 07:53:18 +00:00
delete policy violations before component
Signed-off-by: Arjav <arjavdongaonkar@gmail.com>
This commit is contained in:
parent
db4c4d1503
commit
b305b224ed
1 changed files with 6 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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue