-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployer.java
More file actions
169 lines (143 loc) · 5.25 KB
/
Employer.java
File metadata and controls
169 lines (143 loc) · 5.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package stark.industries;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
*
* @author DarkGamerX100
*/
@Entity
@Table(name = "employer", catalog = "stark_industries", schema = "")
@NamedQueries({
@NamedQuery(name = "Employer.findAll", query = "SELECT e FROM Employer e")
, @NamedQuery(name = "Employer.findById", query = "SELECT e FROM Employer e WHERE e.id = :id")
, @NamedQuery(name = "Employer.findByName", query = "SELECT e FROM Employer e WHERE e.name = :name")
, @NamedQuery(name = "Employer.findByDepartment", query = "SELECT e FROM Employer e WHERE e.department = :department")
, @NamedQuery(name = "Employer.findBySalary", query = "SELECT e FROM Employer e WHERE e.salary = :salary")
, @NamedQuery(name = "Employer.findByAddress", query = "SELECT e FROM Employer e WHERE e.address = :address")
, @NamedQuery(name = "Employer.findByContact", query = "SELECT e FROM Employer e WHERE e.contact = :contact")
, @NamedQuery(name = "Employer.findByGender", query = "SELECT e FROM Employer e WHERE e.gender = :gender")})
public class Employer implements Serializable {
@Transient
private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "ID")
private String id;
@Column(name = "Name")
private String name;
@Column(name = "Department")
private String department;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "Salary")
private Double salary;
@Column(name = "Address")
private String address;
@Column(name = "Contact")
private Integer contact;
@Column(name = "Gender")
private String gender;
public Employer() {
}
public Employer(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setId(String id) {
String oldId = this.id;
this.id = id;
changeSupport.firePropertyChange("id", oldId, id);
}
public String getName() {
return name;
}
public void setName(String name) {
String oldName = this.name;
this.name = name;
changeSupport.firePropertyChange("name", oldName, name);
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
String oldDepartment = this.department;
this.department = department;
changeSupport.firePropertyChange("department", oldDepartment, department);
}
public Double getSalary() {
return salary;
}
public void setSalary(Double salary) {
Double oldSalary = this.salary;
this.salary = salary;
changeSupport.firePropertyChange("salary", oldSalary, salary);
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
String oldAddress = this.address;
this.address = address;
changeSupport.firePropertyChange("address", oldAddress, address);
}
public Integer getContact() {
return contact;
}
public void setContact(Integer contact) {
Integer oldContact = this.contact;
this.contact = contact;
changeSupport.firePropertyChange("contact", oldContact, contact);
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
String oldGender = this.gender;
this.gender = gender;
changeSupport.firePropertyChange("gender", oldGender, gender);
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Employer)) {
return false;
}
Employer other = (Employer) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "stark.industries.Employer[ id=" + id + " ]";
}
public void addPropertyChangeListener(PropertyChangeListener listener) {
changeSupport.addPropertyChangeListener(listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
changeSupport.removePropertyChangeListener(listener);
}
}