]> git.mxchange.org Git - jcontacts-business-core.git/blob - src/org/mxchange/jcontactsbusiness/jobposition/EmployeePosition.java
ignored create-persistence-unit warning as no persistence.xml shall be created here...
[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 @SuppressWarnings ("PersistenceUnitPresent")
45 public class EmployeePosition implements JobPosition {
46
47         /**
48          * Serial number
49          */
50         private static final long serialVersionUID = 18_427_587_187_609L;
51
52         /**
53          * Timestamp when this entry has been created
54          */
55         @Basic (optional = false)
56         @Temporal (TemporalType.TIMESTAMP)
57         @Column (name = "job_position_created", nullable = false, updatable = false)
58         private Calendar jobPositionCreated;
59
60         /**
61          * Id number
62          */
63         @Id
64         @GeneratedValue (strategy = GenerationType.IDENTITY)
65         @Column (name = "job_position_id", nullable = false, updatable = false)
66         private Long jobPositionId;
67
68         /**
69          * Name/description of the job position (example: CEO)
70          */
71         @Basic (optional = false)
72         @Column (name = "job_position_name", nullable = false, unique = true)
73         private String jobPositionName;
74
75         @Override
76         public boolean equals (final Object object) {
77                 if (null == object) {
78                         return false;
79                 } else if (this.getClass() != object.getClass()) {
80                         return false;
81                 }
82
83                 final JobPosition other = (JobPosition) object;
84
85                 return Objects.equals(this.getJobPositionName(), other.getJobPositionName());
86         }
87
88         @Override
89         public int hashCode () {
90                 int hash = 7;
91                 hash = 37 * hash + Objects.hashCode(this.getJobPositionName());
92                 return hash;
93         }
94
95         @Override
96         public Calendar getJobPositionCreated () {
97                 return this.jobPositionCreated;
98         }
99
100         @Override
101         public void setJobPositionCreated (final Calendar jobPositionCreated) {
102                 this.jobPositionCreated = jobPositionCreated;
103         }
104
105         @Override
106         public Long getJobPositionId () {
107                 return this.jobPositionId;
108         }
109
110         @Override
111         public void setJobPositionId (final Long jobPositionId) {
112                 this.jobPositionId = jobPositionId;
113         }
114
115         @Override
116         public String getJobPositionName () {
117                 return this.jobPositionName;
118         }
119
120         @Override
121         public void setJobPositionName (final String jobPositionName) {
122                 this.jobPositionName = jobPositionName;
123         }
124
125 }