]> git.mxchange.org Git - jcontacts-business-core.git/blob - src/org/mxchange/jcontactsbusiness/jobposition/EmployeePosition.java
Cleanup:
[jcontacts-business-core.git] / src / org / mxchange / jcontactsbusiness / jobposition / EmployeePosition.java
1 /*
2  * Copyright (C) 2016 Roland Haeder
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 package org.mxchange.jcontactsbusiness.jobposition;
18
19 import java.util.Calendar;
20 import java.util.Objects;
21 import javax.persistence.Basic;
22 import javax.persistence.Column;
23 import javax.persistence.Entity;
24 import javax.persistence.GeneratedValue;
25 import javax.persistence.GenerationType;
26 import javax.persistence.Id;
27 import javax.persistence.Index;
28 import javax.persistence.Table;
29 import javax.persistence.Temporal;
30 import javax.persistence.TemporalType;
31
32 /**
33  * A POJO for job positions
34  * <p>
35  * @author Roland Haeder<roland@mxchange.org>
36  */
37 @Entity (name = "company_job_positions")
38 @Table (
39                 name = "company_job_positions",
40                 indexes = {
41                         @Index (name = "job_position", columnList = "job_position_name", unique = true)
42                 }
43 )
44 public class EmployeePosition implements JobPosition {
45
46         /**
47          * Serial number
48          */
49         private static final long serialVersionUID = 18_427_587_187_609L;
50
51         /**
52          * Timestamp when this entry has been created
53          */
54         @Basic (optional = false)
55         @Temporal (TemporalType.TIMESTAMP)
56         @Column (name = "job_position_created", nullable = false, updatable = false)
57         private Calendar jobPositionCreated;
58
59         /**
60          * Id number
61          */
62         @Id
63         @GeneratedValue (strategy = GenerationType.IDENTITY)
64         @Column (name = "job_position_id", length = 20, nullable = false, updatable = false)
65         private Long jobPositionId;
66
67         /**
68          * Name/description of the job position (example: CEO)
69          */
70         @Basic (optional = false)
71         @Column (name = "job_position_name", length = 20, nullable = false, unique = true)
72         private String jobPositionName;
73
74         @Override
75         public boolean equals (final Object object) {
76                 if (null == object) {
77                         return false;
78                 } else if (this.getClass() != object.getClass()) {
79                         return false;
80                 }
81
82                 final JobPosition other = (JobPosition) object;
83
84                 return Objects.equals(this.getJobPositionName(), other.getJobPositionName());
85         }
86
87         @Override
88         public int hashCode () {
89                 int hash = 7;
90                 hash = 37 * hash + Objects.hashCode(this.getJobPositionName());
91                 return hash;
92         }
93
94         @Override
95         public Calendar getJobPositionCreated () {
96                 return this.jobPositionCreated;
97         }
98
99         @Override
100         public void setJobPositionCreated (final Calendar jobPositionCreated) {
101                 this.jobPositionCreated = jobPositionCreated;
102         }
103
104         @Override
105         public Long getJobPositionId () {
106                 return this.jobPositionId;
107         }
108
109         @Override
110         public void setJobPositionId (final Long jobPositionId) {
111                 this.jobPositionId = jobPositionId;
112         }
113
114         @Override
115         public String getJobPositionName () {
116                 return this.jobPositionName;
117         }
118
119         @Override
120         public void setJobPositionName (final String jobPositionName) {
121                 this.jobPositionName = jobPositionName;
122         }
123
124 }