3. Book 클래스 필드에 대해 JSR-380을 선언합니다.
코드13-3 Book.java
package com.springmvc.domain;
...
➊
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import javax.validation.constraints.Min;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;
public class Book {
@Pattern(regexp="ISBN[1-9]+") ➋
private String bookId;
@Size(min=4, max=50) ➌
private String name;
@Min(value=0) ➍
@Digits(integer=8, fraction=2) ➎
@NotNull ➏
private int unitPrice;
...
}