Skip to content

Commit

Permalink
Simplify and speedup VulnerabilityMetricsUpdateTask with safe aliases
Browse files Browse the repository at this point in the history
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
  • Loading branch information
valentijnscholten committed Feb 11, 2023
1 parent a0a4875 commit e98ab7e
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -120,7 +120,7 @@ private static Collection<YearMonthMetric> queryForMetrics(PersistenceManager pm
// You cannot seem to use IF ELSE with GROUP BY in JDOQL
// So we end up doing two queries instead of one with an IF ELSE
String queryTemplate =
"SELECT %s.getYear() as year, %s.getMonth()+1 as month, count(this) as count " +
"SELECT %s.getYear() as y, %s.getMonth()+1 as m, count(this) as count " +
"FROM org.dependencytrack.model.Vulnerability " +
"WHERE %s != null && %s == null " +
"GROUP BY %s.getYear(), %s.getMonth() + 1";
Expand Down

0 comments on commit e98ab7e

Please sign in to comment.