-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJobs.java
More file actions
124 lines (106 loc) · 3.15 KB
/
Jobs.java
File metadata and controls
124 lines (106 loc) · 3.15 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
package org.javaee7.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
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.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author Juneau
*/
@Entity
@Table(name = "JOBS")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Jobs.findAll", query = "SELECT j FROM Jobs j"),
@NamedQuery(name = "Jobs.findByJobId", query = "SELECT j FROM Jobs j WHERE j.jobId = :jobId"),
@NamedQuery(name = "Jobs.findByTitle", query = "SELECT j FROM Jobs j WHERE j.title = :title"),
@NamedQuery(name = "Jobs.findByDivision", query = "SELECT j FROM Jobs j WHERE j.division = :division"),
@NamedQuery(name = "Jobs.findBySalary", query = "SELECT j FROM Jobs j WHERE j.salary = :salary")})
public class Jobs implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Column(name = "JOB_ID")
private Integer jobId;
@Size(max = 50)
@Column(name = "TITLE")
private String title;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 50)
@Column(name = "DIVISION")
private String division;
@Basic(optional = false)
@NotNull
@Column(name = "SALARY")
private BigDecimal salary;
@OneToMany(mappedBy="job")
private List<Employee> employees;
public Jobs() {
}
public Jobs(Integer jobId) {
this.jobId = jobId;
}
public Jobs(Integer jobId, String division, BigDecimal salary) {
this.jobId = jobId;
this.division = division;
this.salary = salary;
}
public Integer getJobId() {
return jobId;
}
public void setJobId(Integer jobId) {
this.jobId = jobId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDivision() {
return division;
}
public void setDivision(String division) {
this.division = division;
}
public BigDecimal getSalary() {
return salary;
}
public void setSalary(BigDecimal salary) {
this.salary = salary;
}
@Override
public int hashCode() {
int hash = 0;
hash += (jobId != null ? jobId.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 Jobs)) {
return false;
}
Jobs other = (Jobs) object;
if ((this.jobId == null && other.jobId != null) || (this.jobId != null && !this.jobId.equals(other.jobId))) {
return false;
}
return true;
}
@Override
public String toString() {
return "org.javaee7.entity.Jobs[ jobId=" + jobId + " ]";
}
}