public class ProjectMetrics implements Serializable {
...
@Persistent
@Column(name = "UNASSIGNED_SEVERITY", allowsNull = "true") // New column, must allow nulls on existing databases)
private Integer unassigned;
...
Nullable properties should be handled like this:
public int getUnassigned() {
return unassigned; -> Will fail on MS SQL
return unassigned == null ? 0 : unassigned; -> That would be correct
}
Steps to Reproduce
Get projects having metrics where "unassigned" is null
Expected Behavior
No error should occur, when getProject().getMetrics().getUnasigned() is called.
Current Behavior
public class ProjectMetrics implements Serializable { ... @Persistent @Column(name = "UNASSIGNED_SEVERITY", allowsNull = "true") // New column, must allow nulls on existing databases) private Integer unassigned; ...
Nullable properties should be handled like this: public int getUnassigned() { return unassigned; -> Will fail on MS SQL return unassigned == null ? 0 : unassigned; -> That would be correct }
Steps to Reproduce
Expected Behavior
No error should occur, when getProject().getMetrics().getUnasigned() is called.
Dependency-Track Version
4.11.1
Dependency-Track Distribution
Executable WAR
Database Server
Microsoft SQL Server
Database Server Version
No response
Browser
Microsoft Edge
Checklist