Skip to content

Commit

Permalink
Use ResultSet#getTimestamp over ResultSet#getDate when mapping vu…
Browse files Browse the repository at this point in the history
…ln policies (#481)
  • Loading branch information
nscuro authored Dec 11, 2023
1 parent 29e94b1 commit 7135fde
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ public List<VulnerabilityPolicy> 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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7135fde

Please sign in to comment.