Guest User

Untitled

a guest
Oct 19th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. import javax.persistence.*;
  2. import java.util.Set;
  3.  
  4. @Entity
  5. @Table(name="product")
  6. public class Product {
  7. @Id
  8. private Long prod_id;
  9. private String title;
  10.  
  11. @ManyToOne
  12. @JoinColumn(name="category")
  13. private Category category;
  14.  
  15. @OneToMany(mappedBy = "product")
  16. private Set<Custom_fields> custom_fields;
  17.  
  18. @ManyToOne
  19. @JoinColumn(name="manufacturer")
  20. private Manufacturer manufacturer;
  21.  
  22. @OneToMany(mappedBy = "product")
  23. private Set<Product_image> img;
  24.  
  25. private Double sale;
  26. private Double price;
  27. private Long quantity;
  28. private java.sql.Timestamp date_added;
  29. private String description;
  30.  
  31. import javax.persistence.*;
  32.  
  33. @Entity
  34. @Table(name="product_image")
  35. public class Product_image {
  36. @Id
  37. private Long img_id;
  38. private String path;
  39. private String alt;
  40. private String title;
  41.  
  42. @ManyToOne
  43. @JoinColumn(name = "product_id")
  44. private Product product;
Add Comment
Please, Sign In to add comment