My app uses javax validation for the salary field, which is int. With what annotation should I use it, to avoid the error message like that
Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'salary'; nested exception is java.lang.NumberFormatException: For input string: ""
My current implementation looks like this:
@Column(name = "salary", nullable = false)
@NotNull(message= "salary may not be empty")
@Range(min = 1)
private int salary;
I know that I can not use NotBlank for a int field, that leads to an error. How can I display the message "salary may not be empty" instead of the exception above, if the "string" is empty? Thanks