diff --git a/src/main/java/org/dependencytrack/persistence/VulnerabilityPolicyQueryManager.java b/src/main/java/org/dependencytrack/persistence/VulnerabilityPolicyQueryManager.java index c4965c3ce..85a724fae 100644 --- a/src/main/java/org/dependencytrack/persistence/VulnerabilityPolicyQueryManager.java +++ b/src/main/java/org/dependencytrack/persistence/VulnerabilityPolicyQueryManager.java @@ -87,15 +87,15 @@ public List getAllVulnerabilityPolicies() { vulnerabilityPolicy.setAuthor(rs.getString("AUTHOR")); Array conditions = rs.getArray("CONDITIONS"); vulnerabilityPolicy.setConditions((String[]) conditions.getArray()); - vulnerabilityPolicy.setCreated(rs.getDate("CREATED")); + vulnerabilityPolicy.setCreated(rs.getTimestamp("CREATED")); vulnerabilityPolicy.setDescription(rs.getString("DESCRIPTION")); vulnerabilityPolicy.setName(rs.getString("NAME")); JSONArray ratingsJson = new JSONArray(rs.getString("RATINGS")); vulnerabilityPolicy.setRatings(MAPPER.convertValue(ratingsJson, new TypeReference<>() { })); - vulnerabilityPolicy.setUpdated(rs.getDate("UPDATED")); - vulnerabilityPolicy.setValidFrom(rs.getDate("VALID_FROM")); - vulnerabilityPolicy.setValidUntil(rs.getDate("VALID_UNTIL")); + vulnerabilityPolicy.setUpdated(rs.getTimestamp("UPDATED")); + vulnerabilityPolicy.setValidFrom(rs.getTimestamp("VALID_FROM")); + vulnerabilityPolicy.setValidUntil(rs.getTimestamp("VALID_UNTIL")); vulnerabilityPolicies.add(vulnerabilityPolicy); } } catch (Exception ex) { @@ -129,15 +129,15 @@ public VulnerabilityPolicy getVulnerabilityPolicyByName(String name) { vulnerabilityPolicy.setAuthor(rs.getString("AUTHOR")); Array conditions = rs.getArray("CONDITIONS"); vulnerabilityPolicy.setConditions((String[]) conditions.getArray()); - vulnerabilityPolicy.setCreated(rs.getDate("CREATED")); + vulnerabilityPolicy.setCreated(rs.getTimestamp("CREATED")); vulnerabilityPolicy.setDescription(rs.getString("DESCRIPTION")); vulnerabilityPolicy.setName(rs.getString("NAME")); JSONArray ratingsJson = new JSONArray(rs.getString("RATINGS")); vulnerabilityPolicy.setRatings(MAPPER.convertValue(ratingsJson, new TypeReference<>() { })); - vulnerabilityPolicy.setUpdated(rs.getDate("UPDATED")); - vulnerabilityPolicy.setValidFrom(rs.getDate("VALID_FROM")); - vulnerabilityPolicy.setValidUntil(rs.getDate("VALID_UNTIL")); + vulnerabilityPolicy.setUpdated(rs.getTimestamp("UPDATED")); + vulnerabilityPolicy.setValidFrom(rs.getTimestamp("VALID_FROM")); + vulnerabilityPolicy.setValidUntil(rs.getTimestamp("VALID_UNTIL")); } } catch (Exception ex) { LOGGER.error("error in executing workflow state cte query to update states", ex);