Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bookrental.model.book;
- import com.fasterxml.jackson.annotation.JsonIgnore;
- import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
- import com.fasterxml.jackson.annotation.JsonView;
- import lombok.*;
- import javax.persistence.*;
- import javax.validation.constraints.NotNull;
- @Entity
- @Getter
- @Setter
- @EqualsAndHashCode
- @AllArgsConstructor
- @NoArgsConstructor
- public class Book {
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- private int id;
- @NotNull
- private String title;
- @NotNull
- private String author;
- @NotNull
- private String category;
- private boolean available;
- public Book(String title, String author, String category, boolean available) {
- this.title = title;
- this.author = author;
- this.category = category;
- this.available = available;
- }
- public Book(int bookID) {
- this.id = bookID;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement