【Bug】No validator... javax.validation.constraints.NotBlank validating type java.lang.Integer

经检查,是因为在 Integer 类型的字段上加了@NotBlank的校验注解,而该注解只能用于字符串类型,因此报类型不匹配异常
@NotBlank(message = "整季量不能为空")
private Integer totalSeasonNum;

解决方法:用其@NotNull注解代替 Integer类型字段的校验

posted @ 2022-11-23 17:52  珊瑚贝博客  阅读(27)  评论(0编辑  收藏  举报