Step back in refactoring, case sensitive ignored in autocomplite, adding lesson type...
[SkiSchool.git] / SkiSchool-ejb / src / java / org / cvut / skischool / model / Person.java
blob89cf0dcc85e0386673d46190f2975ad1eeaca8a2
1 package org.cvut.skischool.model;
3 import java.io.Serializable;
4 import javax.persistence.Entity;
5 import javax.persistence.GeneratedValue;
6 import javax.persistence.GenerationType;
7 import javax.persistence.Id;
8 import javax.persistence.Inheritance;
9 import javax.persistence.InheritanceType;
10 import javax.persistence.OneToOne;
11 import javax.validation.constraints.NotNull;
12 import javax.validation.constraints.Size;
14 /**
16 * @author matej
18 @Entity
19 @Inheritance(strategy = InheritanceType.JOINED)
20 public class Person implements Serializable {
22 private static final long serialVersionUID = 1L;
23 @Id
24 @GeneratedValue(strategy = GenerationType.AUTO)
25 private Long id;
26 private String firstName;
27 @Size(min = 1, message = "{null}")
28 private String lastName;
29 private String birthNumber;
30 private String email;
31 private String phone;
32 private String address;
33 @NotNull
34 private boolean disabled;
35 @OneToOne(mappedBy = "person")
36 private Account account;
38 public Long getId() {
39 return id;
42 public void setId(Long id) {
43 this.id = id;
46 public String getAddress() {
47 return address;
50 public void setAddress(String address) {
51 this.address = address;
54 public String getBirthNumber() {
55 return birthNumber;
58 public void setBirthNumber(String birthNumber) {
59 this.birthNumber = birthNumber;
62 public boolean isDisabled() {
63 return disabled;
66 public void setDisabled(boolean disabled) {
67 this.disabled = disabled;
70 public String getEmail() {
71 return email;
74 public void setEmail(String email) {
75 this.email = email;
78 public String getFirstName() {
79 return firstName;
82 public void setFirstName(String firstName) {
83 this.firstName = firstName;
86 public String getLastName() {
87 return lastName;
90 public void setLastName(String lastName) {
91 this.lastName = lastName;
94 public String getPhone() {
95 return phone;
98 public void setPhone(String phone) {
99 this.phone = phone;
102 public Account getAccount() {
103 return account;
106 public void setAccount(Account account) {
107 this.account = account;
110 @Override
111 public int hashCode() {
112 int hash = 0;
113 hash += (id != null ? id.hashCode() : 0);
114 return hash;
117 @Override
118 public boolean equals(Object object) {
119 // TODO: Warning - this method won't work in the case the id fields are not set
120 if (!(object instanceof Person)) {
121 return false;
123 Person other = (Person) object;
124 if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
125 return false;
127 return true;
130 @Override
131 public String toString() {
132 return "org.cvut.x33eja.model.Person[id=" + id + "]";