diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/model/book/Book.java b/bookstore/src/main/java/com/fjordtek/bookstore/model/book/Book.java index 9ac6710..127f35b 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/model/book/Book.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/model/book/Book.java @@ -24,7 +24,6 @@ import javax.validation.Valid; import javax.validation.constraints.DecimalMax; import javax.validation.constraints.DecimalMin; import javax.validation.constraints.Digits; -import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Pattern; @@ -233,14 +232,15 @@ public class Book { ) private Category category; + /* + * TODO should this be a separate Entity with one-to-one relationship? + */ @Column( nullable = false, columnDefinition = "BIT" ) - @Min(0) - @Max(1) @JsonIgnore - private int publish; + private boolean publish; //////////////////// // Attribute setters @@ -284,7 +284,7 @@ public class Book { this.category = category; } - public void setPublish(int publish) { + public void setPublish(boolean publish) { this.publish = publish; } @@ -326,7 +326,7 @@ public class Book { return category; } - public int getPublish() { + public boolean getPublish() { return publish; } @@ -335,7 +335,7 @@ public class Book { public Book() {} - public Book(String title, Author author, int year, String isbn, BigDecimal price, Category category, int publish) { + public Book(String title, Author author, int year, String isbn, BigDecimal price, Category category, boolean publish) { // super(); this.title = title; this.author = author; diff --git a/bookstore/src/main/resources/templates/booklist.html b/bookstore/src/main/resources/templates/booklist.html index de092b9..982187b 100644 --- a/bookstore/src/main/resources/templates/booklist.html +++ b/bookstore/src/main/resources/templates/booklist.html @@ -104,7 +104,7 @@ Idea of the following syntax used in this and other HTML document: