Guest User

Untitled

a guest
Nov 30th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1. package com.scheduler.dao.entities;
  2.  
  3. import javax.persistence.*;
  4. import java.util.List;
  5.  
  6. @Entity
  7. public class User extends AbstractEntity{
  8.  
  9. @Column(nullable = false)
  10. String username;
  11.  
  12. @Column(nullable = false)
  13. String password;
  14.  
  15. @Column(nullable = false)
  16. Boolean enabled;
  17.  
  18. @Column
  19. String avatarPath;
  20.  
  21. @Column
  22. String verifyUuid;
  23.  
  24. @Column
  25. Long storeId;
  26.  
  27. @ElementCollection
  28. @CollectionTable(name = "user_authorities", joinColumns = @JoinColumn(name = "user_id"))
  29. @Column(name = "authorities")
  30. List<String> authorities;
  31.  
  32. @ManyToMany(cascade = CascadeType.PERSIST)
  33. List<Account> accounts;
  34.  
  35. @OneToMany(cascade = CascadeType.ALL)
  36. List<Post> posts;
  37.  
  38. @OneToMany(cascade = CascadeType.ALL)
  39. List<Event> events;
  40.  
  41. @OneToMany(cascade = CascadeType.ALL)
  42. List<Media> mediaList;
  43.  
  44. @OneToMany(cascade = CascadeType.ALL)
  45. List<News> newsList;
  46.  
  47. public User() {
  48. }
  49.  
  50. public User(String username,
  51. String password,
  52. Boolean enabled,
  53. String avatarPath,
  54. Long storeId,
  55. List<String> authorities,
  56. List<Account> accounts,
  57. List<Post> posts,
  58. List<Event> events,
  59. List<Media> mediaList,
  60. List<News> newsList) {
  61. this.username = username;
  62. this.password = password;
  63. this.enabled = enabled;
  64. this.avatarPath = avatarPath;
  65. this.storeId = storeId;
  66. this.authorities = authorities;
  67. this.accounts = accounts;
  68. this.posts = posts;
  69. this.events = events;
  70. this.mediaList = mediaList;
  71. this.newsList = newsList;
  72. }
  73.  
  74. public String getAvatarPath() {
  75. return avatarPath;
  76. }
  77.  
  78. public void setAvatarPath(String avatarPath) {
  79. this.avatarPath = avatarPath;
  80. }
  81.  
  82. public String getUsername() {
  83. return username;
  84. }
  85.  
  86. public void setUsername(String username) {
  87. this.username = username;
  88. }
  89.  
  90. public String getPassword() {
  91. return password;
  92. }
  93.  
  94. public void setPassword(String password) {
  95. this.password = password;
  96. }
  97.  
  98. public Boolean getEnabled() {
  99. return enabled;
  100. }
  101.  
  102. public void setEnabled(Boolean enabled) {
  103. this.enabled = enabled;
  104. }
  105.  
  106. public String getVerifyUuid() {
  107. return verifyUuid;
  108. }
  109.  
  110. public void setVerifyUuid(String verifyUuid) {
  111. this.verifyUuid = verifyUuid;
  112. }
  113.  
  114. public Long getStoreId() {
  115. return storeId;
  116. }
  117.  
  118. public void setStoreId(Long storeId) {
  119. this.storeId = storeId;
  120. }
  121.  
  122. public List<String> getAuthorities() {
  123. return authorities;
  124. }
  125.  
  126. public void setAuthorities(List<String> authorities) {
  127. this.authorities = authorities;
  128. }
  129.  
  130. public List<Account> getAccounts() {
  131. return accounts;
  132. }
  133.  
  134. public void setAccounts(List<Account> accounts) {
  135. this.accounts = accounts;
  136. }
  137.  
  138. public List<Post> getPosts() {
  139. return posts;
  140. }
  141.  
  142. public void setPosts(List<Post> posts) {
  143. this.posts = posts;
  144. }
  145.  
  146. public List<Event> getEvents() {
  147. return events;
  148. }
  149.  
  150. public void setEvents(List<Event> events) {
  151. this.events = events;
  152. }
  153.  
  154. public List<Media> getMediaList() {
  155. return mediaList;
  156. }
  157.  
  158. public void setMediaList(List<Media> mediaList) {
  159. this.mediaList = mediaList;
  160. }
  161.  
  162. public List<News> getNewsList() {
  163. return newsList;
  164. }
  165.  
  166. public void setNewsList(List<News> newsList) {
  167. this.newsList = newsList;
  168. }
  169. }
Add Comment
Please, Sign In to add comment