Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1.  
  2. package domain;
  3.  
  4. import javax.persistence.Access;
  5. import javax.persistence.AccessType;
  6. import javax.persistence.Entity;
  7. import javax.persistence.OneToOne;
  8. import javax.validation.Valid;
  9. import javax.validation.constraints.Pattern;
  10.  
  11. import org.hibernate.validator.constraints.NotBlank;
  12. import org.hibernate.validator.constraints.URL;
  13.  
  14. import security.UserAccount;
  15.  
  16. @Entity
  17. @Access(AccessType.PROPERTY)
  18. public abstract class Actor extends DomainEntity {
  19.  
  20. private String name;
  21. private String middleName;
  22. private String surname;
  23. private String photo;
  24. private String email;
  25. private String phone;
  26. private String address;
  27. private UserAccount userAccount;
  28.  
  29.  
  30. @NotBlank
  31. public String getName() {
  32. return this.name;
  33. }
  34.  
  35. public void setName(final String name) {
  36. this.name = name;
  37. }
  38.  
  39. public String getMiddleName() {
  40. return this.middleName;
  41. }
  42.  
  43. public void setMiddleName(final String middleName) {
  44. this.middleName = middleName;
  45. }
  46.  
  47. @NotBlank
  48. public String getSurname() {
  49. return this.surname;
  50. }
  51.  
  52. public void setSurname(final String surname) {
  53. this.surname = surname;
  54. }
  55.  
  56. @URL
  57. public String getPhoto() {
  58. return this.photo;
  59. }
  60.  
  61. public void setPhoto(final String photo) {
  62. this.photo = photo;
  63. }
  64.  
  65. @NotBlank
  66. @Pattern(regexp = "^[A-Za-z0-9._%-+<]{1,}\\@[A-Za-z0-9.]{1,}\\.[A-Za-z0-9]{2,4}$|^[A-Za-z0-9._%-+<]{1,}\\<[A-Za-z0-9._%-+<]{1,}\\@[A-Za-z0-9.]{1,}\\.[A-Za-z0-9]{2,4}\\>$|[A-Za-z0-9._%-+<]{1,}\\@|^[A-Za-z0-9._%-+<]{1,}\\<[A-Za-z0-9._%-+<]{1,}\\@\\>")
  67. public String getEmail() {
  68. return this.email;
  69. }
  70.  
  71. public void setEmail(final String email) {
  72. this.email = email;
  73. }
  74.  
  75. public String getPhone() {
  76. return this.phone;
  77. }
  78.  
  79. public void setPhone(final String phone) {
  80. this.phone = phone;
  81. }
  82.  
  83. public String getAddress() {
  84. return this.address;
  85. }
  86.  
  87. public void setAddress(final String address) {
  88. this.address = address;
  89. }
  90.  
  91. @Valid
  92. @OneToOne(optional = false)
  93. public UserAccount getUserAccount() {
  94. return this.userAccount;
  95. }
  96.  
  97. public void setUserAccount(final UserAccount userAccount) {
  98. this.userAccount = userAccount;
  99. }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement