Advertisement
vmzik

User

Oct 23rd, 2019
503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 KB | None | 0 0
  1. package org.forpdi.core.user;
  2.  
  3. import java.util.Date;
  4.  
  5. import javax.persistence.Column;
  6. import javax.persistence.Entity;
  7. import javax.persistence.Table;
  8. import javax.persistence.Temporal;
  9. import javax.persistence.TemporalType;
  10. import javax.persistence.Transient;
  11.  
  12. import org.forpdi.core.user.authz.AccessLevels;
  13.  
  14. import br.com.caelum.vraptor.boilerplate.SimpleLogicalDeletableEntity;
  15. import br.com.caelum.vraptor.serialization.SkipSerialization;
  16.  
  17. /**
  18. * @author Renato R. R. de Oliveira
  19. *
  20. */
  21. @Entity(name = User.TABLE)
  22. @Table(name = User.TABLE)
  23. public class User extends SimpleLogicalDeletableEntity {
  24. public static final String TABLE = "fpdi_user";
  25. private static final long serialVersionUID = 1L;
  26.  
  27. @Column(nullable=false, unique=true, length=255)
  28. private String email;
  29.  
  30. @Column(nullable=true, unique=true, length=255)
  31. private String cpf;
  32.  
  33. @Column(nullable=true, unique=true, length=255)
  34. private String cellphone;
  35.  
  36. @Column(nullable=true, length=255)
  37. @SkipSerialization
  38. private String password;
  39.  
  40. @Column(nullable=false, length=255)
  41. private String name;
  42.  
  43. @Column(nullable=true, length=255)
  44. private String phone;
  45.  
  46. @Column(nullable=true, length=255)
  47. private String department;
  48.  
  49. @Column(nullable=true, length=255)
  50. private String picture;
  51.  
  52. @Temporal(TemporalType.DATE)
  53. @Column(nullable=true)
  54. private Date birthdate;
  55.  
  56. @Temporal(TemporalType.TIMESTAMP)
  57. @Column(nullable=false)
  58. private Date creation = new Date();
  59.  
  60. @Column(nullable=true, length=128, unique=true)
  61. private String inviteToken;
  62.  
  63. private boolean active = false;
  64. private int accessLevel = AccessLevels.NONE.getLevel();
  65.  
  66. @Transient
  67. private boolean blocked = false;
  68.  
  69. @Transient
  70. private int notificationSettings;
  71.  
  72. public int getNotificationSettings() {
  73. return notificationSettings;
  74. }
  75.  
  76. public void setNotificationSettings(int notificationSettings) {
  77. this.notificationSettings = notificationSettings;
  78. }
  79.  
  80. public String getEmail() {
  81. return email;
  82. }
  83.  
  84. public void setEmail(String email) {
  85. this.email = email;
  86. }
  87.  
  88. public String getCpf() {
  89. return cpf;
  90. }
  91.  
  92. public void setCpf(String cpf) {
  93. this.cpf = cpf;
  94. }
  95.  
  96. public String getCellphone() {
  97. return cellphone;
  98. }
  99.  
  100. public void setCellphone(String cellphone) {
  101. this.cellphone = cellphone;
  102. }
  103.  
  104. public String getPassword() {
  105. return password;
  106. }
  107.  
  108. public void setPassword(String password) {
  109. this.password = password;
  110. }
  111.  
  112. public String getName() {
  113. return name;
  114. }
  115.  
  116. public void setName(String name) {
  117. this.name = name;
  118. }
  119.  
  120. public String getPhone() {
  121. return phone;
  122. }
  123.  
  124. public void setPhone(String phone) {
  125. this.phone = phone;
  126. }
  127.  
  128. public String getDepartment() {
  129. return department;
  130. }
  131.  
  132. public void setDepartment(String department) {
  133. this.department = department;
  134. }
  135.  
  136. public String getPicture() {
  137. return picture;
  138. }
  139.  
  140. public void setPicture(String picture) {
  141. this.picture = picture;
  142. }
  143.  
  144. public Date getBirthdate() {
  145. return birthdate;
  146. }
  147.  
  148. public void setBirthdate(Date birthdate) {
  149. this.birthdate = birthdate;
  150. }
  151.  
  152. public Date getCreation() {
  153. return creation;
  154. }
  155.  
  156. public void setCreation(Date creation) {
  157. this.creation = creation;
  158. }
  159.  
  160. public boolean isActive() {
  161. return active;
  162. }
  163.  
  164. public void setActive(boolean active) {
  165. this.active = active;
  166. }
  167.  
  168. public int getAccessLevel() {
  169. return accessLevel;
  170. }
  171.  
  172. public void setAccessLevel(int accessLevel) {
  173. this.accessLevel = accessLevel;
  174. }
  175.  
  176. public String getInviteToken() {
  177. return inviteToken;
  178. }
  179.  
  180. public void setInviteToken(String inviteToken) {
  181. this.inviteToken = inviteToken;
  182. }
  183.  
  184. public boolean isBlocked() {
  185. return blocked;
  186. }
  187.  
  188. public void setBlocked(boolean blocked) {
  189. this.blocked = blocked;
  190. }
  191.  
  192. @Override
  193. public String toString() {
  194. return "User [email=" + email + ", cpf=" + cpf + ", cellphone=" + cellphone + ", password=" + password
  195. + ", name=" + name + ", phone=" + phone + ", department=" + department + ", picture=" + picture
  196. + ", birthdate=" + birthdate + ", creation=" + creation + ", inviteToken=" + inviteToken + ", active="
  197. + active + ", accessLevel=" + accessLevel + ", blocked=" + blocked + ", notificationSettings="
  198. + notificationSettings + "]";
  199. }
  200.  
  201.  
  202.  
  203.  
  204.  
  205. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement