Advertisement
Guest User

Untitled

a guest
Nov 21st, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. @Entity
  2. public class Recipe {
  3. @Id
  4. @GeneratedValue(strategy = GenerationType.IDENTITY)
  5. private int recipe_id;
  6. private String name;
  7. @JoinColumn(name="user_id" , table="User")
  8. private int user_id;
  9. private LocalDate dateUploaded;
  10. private String description;
  11.  
  12. public int getId() {
  13. return recipe_id;
  14. }
  15.  
  16. public void setId(int recipe_id) {
  17. this.recipe_id = recipe_id;
  18. }
  19.  
  20. public String getName() {
  21. return name;
  22. }
  23.  
  24. public void setName(String name) {
  25. this.name = name;
  26. }
  27.  
  28. public int getUser() {
  29. return user_id;
  30. }
  31.  
  32. public void setUser(int user_id) {
  33. this.user_id = user_id;
  34. }
  35.  
  36. public LocalDate getDateUploaded() {
  37. return dateUploaded;
  38. }
  39.  
  40. public void setDateUploaded(LocalDate dateUploaded) {
  41. this.dateUploaded = dateUploaded;
  42. }
  43.  
  44. public String getDescription() {
  45. return description;
  46. }
  47.  
  48. public void setDescription(String description) {
  49. this.description = description;
  50. }
  51.  
  52. @Entity
  53. public class User {
  54. @Id
  55. @GeneratedValue(strategy = GenerationType.IDENTITY)
  56. private int user_id;
  57. private String firstName;
  58. private String lastName;
  59. private String userName;
  60. private String password;
  61.  
  62. public User(int user_id, String firstName, String lastName, String userName, String password, int[] favoriteRecipes, int[] myRecipes) {
  63. this.user_id = user_id;
  64. this.firstName = firstName;
  65. this.lastName = lastName;
  66. this.userName = userName;
  67. this.password = password;
  68. }
  69.  
  70. public int getId() {
  71. return user_id;
  72. }
  73.  
  74. public void setId(int user_id) {
  75. this.user_id = user_id;
  76. }
  77.  
  78. public String getFirstName() {
  79. return firstName;
  80. }
  81.  
  82. public void setFirstName(String firstName) {
  83. this.firstName = firstName;
  84. }
  85.  
  86. public String getLastName() {
  87. return lastName;
  88. }
  89.  
  90. public void setLastName(String lastName) {
  91. this.lastName = lastName;
  92. }
  93.  
  94. public String getUserName() {
  95. return userName;
  96. }
  97.  
  98. public void setUserName(String userName) {
  99. this.userName = userName;
  100. }
  101.  
  102. public String getPassword() {
  103. return password;
  104. }
  105.  
  106. public void setPassword(String password) {
  107. this.password = password;
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement