Advertisement
Guest User

Untitled

a guest
Oct 10th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. package org.tc.models;
  2.  
  3. import javax.persistence.Column;
  4. import javax.persistence.Entity;
  5. import javax.persistence.GeneratedValue;
  6. import javax.persistence.Id;
  7. import javax.persistence.JoinColumn;
  8. import javax.persistence.ManyToOne;
  9. import javax.persistence.Table;
  10. import java.util.BitSet;
  11.  
  12. @Entity
  13. @Table(name = "User")
  14. public class User {
  15. @Id
  16. @GeneratedValue
  17. @Column(name = "UserId")
  18. private int id;
  19. @Column
  20. private String password;
  21. @Column
  22. private String userName;
  23. @Column
  24. private String email;
  25. @ManyToOne
  26. @JoinColumn(name = "RoleId")
  27. private Role role;
  28.  
  29. public User(int id, String password, String userName, String email,
  30. Role role) {
  31. this.id = id;
  32. this.password = password;
  33. this.userName = userName;
  34. this.email = email;
  35. this.role = role;
  36. }
  37.  
  38. public User(int id) {
  39. this.id = id;
  40. }
  41.  
  42. public User() {
  43. }
  44.  
  45. public int getId() {
  46. return this.id;
  47. }
  48.  
  49. public void setId(int id) {
  50. this.id = id;
  51. }
  52.  
  53. public String getPassword() {
  54. return this.password;
  55. }
  56.  
  57. public void setPassword(String password) {
  58. this.password = password;
  59. }
  60.  
  61. public String getUserName() {
  62. return this.userName;
  63. }
  64.  
  65. public void setUserName(String userName) {
  66. this.userName = userName;
  67. }
  68.  
  69. public String getEmail() {
  70. return this.email;
  71. }
  72.  
  73. public void setEmail(String email) {
  74. this.email = email;
  75. }
  76.  
  77. public Role getRole() {
  78. return this.role;
  79. }
  80.  
  81. public void setRole(Role role) {
  82. this.role = role;
  83. }
  84.  
  85.  
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement