Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bookrental.model.book;
- import bookrental.model.account.User;
- import com.fasterxml.jackson.annotation.JsonIgnore;
- import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
- import com.fasterxml.jackson.annotation.JsonProperty;
- import lombok.*;
- import javax.persistence.*;
- @Entity
- @Getter
- @Setter
- @EqualsAndHashCode
- @AllArgsConstructor
- @NoArgsConstructor
- public class BookRentals {
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- private int id;
- @OneToOne
- private Book book;
- @OneToOne
- private User user;
- public BookRentals(Book book, User user) {
- this.book = book;
- this.user = user;
- }
- }
Add Comment
Please, Sign In to add comment