Guest User

Untitled

a guest
Dec 15th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. package bookrental.model.book;
  2.  
  3. import bookrental.model.account.User;
  4. import com.fasterxml.jackson.annotation.JsonIgnore;
  5. import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  6. import com.fasterxml.jackson.annotation.JsonProperty;
  7. import lombok.*;
  8.  
  9. import javax.persistence.*;
  10.  
  11. @Entity
  12. @Getter
  13. @Setter
  14. @EqualsAndHashCode
  15. @AllArgsConstructor
  16. @NoArgsConstructor
  17.  
  18. public class BookRentals {
  19.  
  20.     @Id
  21.     @GeneratedValue(strategy = GenerationType.AUTO)
  22.     private int id;
  23.     @OneToOne
  24.     private Book book;
  25.     @OneToOne
  26.     private User user;
  27.  
  28.     public BookRentals(Book book, User user) {
  29.         this.book = book;
  30.         this.user = user;
  31.     }
  32. }
Add Comment
Please, Sign In to add comment