验证框中@NotEmpty、@NotBlank、@NotNull乍一看还是容易弄混的。主要使用情况记录一下:
@NotEmpty 用在集合类上面
@NotBlank 用在String上面
@NotNull 用在基本类型上
依赖:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.3.1.Final</version>
</dependency>