验证错误:“找不到类型:java.lang.Integer 的验证器”
2022-08-31 11:39:34
我正在与Spring一起处理一个项目,为什么我不断收到以下错误?
javax.validation.UnexpectedTypeException:
找不到类型:java.lang.Integer 的验证器
这是我的代码:
package com.s2rsolutions.model;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.NotEmpty;
@Entity
@Table(name = "sales")
public class Sales {
@NotEmpty(message = "The above field must not be blank.")
@Column(name = "ttl_d_sls_lst_mth", nullable = false)
private Integer ttl_d_sls_lst_mth;
@NotEmpty(message = "The above field must not be blank.")
@Column(name = "ttl_d_sls_6_mth", nullable = false)
private Integer ttl_d_sls_6_mth;
@Column(name = "date_added")
private Date addedDate;
@Id
@Column(name = "username")
private String username;
// other fields/getters/setters omitted for brevity
}