Browse Source

Category: add NotNull constraint annotation to name attribute

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.4-alpha
Pekka Helenius 4 years ago
parent
commit
0fa63ac096
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      bookstore/src/main/java/com/fjordtek/bookstore/model/book/Category.java

+ 2
- 0
bookstore/src/main/java/com/fjordtek/bookstore/model/book/Category.java View File

@ -14,6 +14,7 @@ import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonIgnore;
@ -52,6 +53,7 @@ public class Category {
unique = true,
columnDefinition = "NVARCHAR(50)"
)
@NotNull
private String name;
// Omit from Jackson JSON serialization


Loading…
Cancel
Save