| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- package pl.sudra.domain;
- import jakarta.persistence.*;
- import jakarta.validation.constraints.NotNull;
- import jakarta.validation.constraints.Size;
- import java.util.HashSet;
- import java.util.Set;
- @Entity
- @Table(name = "appuser")
- public class AppUser {
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- long id;
- @NotNull
- @Column(name = "firstName", nullable = false)
- @Size(min = 2, max = 30, message = "{error.size.firstName}")
- private String firstName;
- @NotNull
- @Size(min = 2, max = 30)
- private String lastName;
- @NotNull
- private String email;
- @Size(min = 9, max = 9)
- private String telephone;
- @NotNull
- @Column(unique = true)
- private String login;
- @NotNull
- private String password;
- private boolean enabled;
- @ManyToMany(fetch = FetchType.EAGER)
- private Set<AppUserRole> appUserRole = new HashSet<AppUserRole>(0);
- @OneToOne(cascade = CascadeType.ALL)
- private Pesel pesel;
- @ManyToOne
- private Address address;
- public Address getAddress() {
- return address;
- }
- public void setAddress(Address address) {
- this.address = address;
- }
- public long getId() {
- return id;
- }
- public void setId(long id) {
- this.id = id;
- }
- public String getFirstName() {
- return firstName;
- }
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
- public String getLastName() {
- return lastName;
- }
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
- public String getEmail() {
- return email;
- }
- public void setEmail(String email) {
- this.email = email;
- }
- public String getTelephone() {
- return telephone;
- }
- public void setTelephone(String telephone) {
- this.telephone = telephone;
- }
- public String getLogin() {
- return login;
- }
- public void setLogin(String login) {
- this.login = login;
- }
- public String getPassword() {
- return password;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- public boolean isEnabled() {
- return enabled;
- }
- public void setEnabled(boolean enabled) {
- this.enabled = enabled;
- }
- public Set<AppUserRole> getAppUserRole() {
- return appUserRole;
- }
- public void setAppUserRole(Set<AppUserRole> appUserRole) {
- this.appUserRole = appUserRole;
- }
- public Pesel getPesel() {
- return pesel;
- }
- public void setPesel(Pesel pesel) {
- this.pesel = pesel;
- }
- }
|