]> git.mxchange.org Git - jcontacts-business-core.git/blob - src/org/mxchange/jcontactsbusiness/jobposition/EmployeePosition.java
resorted members + added this.
[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.Table;
28 import javax.persistence.Temporal;
29 import javax.persistence.TemporalType;
30
31 /**
32  * A POJO for job positions
33  * <p>
34  * @author Roland Haeder
35  */
36 @Entity (name = "company_job_positions")
37 @Table (name = "company_job_positions")
38 public class EmployeePosition implements JobPosition, Comparable<JobPosition> {
39
40         /**
41          * Serial number
42          */
43         private static final long serialVersionUID = 18_427_587_187_609L;
44
45         /**
46          * Timestamp when this entry has been created
47          */
48         @Basic (optional = false)
49         @Temporal (TemporalType.TIMESTAMP)
50         @Column (name = "job_position_created", nullable = false, updatable = false)
51         private Calendar jobPositionCreated;
52
53         /**
54          * Id number
55          */
56         @Id
57         @GeneratedValue (strategy = GenerationType.IDENTITY)
58         @Column (name = "job_position_id", length = 20, nullable = false, updatable = false)
59         private Long jobPositionId;
60
61         /**
62          * Name/description of the job position (example: CEO)
63          */
64         @Basic (optional = false)
65         @Column (name = "job_position_name", length = 10, nullable = false, unique = true)
66         private String jobPositionName;
67
68         @Override
69         public int compareTo (final JobPosition jobPosition) {
70                 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
71         }
72
73         @Override
74         public boolean equals (final Object object) {
75                 if (object == null) {
76                         return false;
77                 } else if (this.getClass() != object.getClass()) {
78                         return false;
79                 }
80
81                 final JobPosition other = (JobPosition) object;
82
83                 return Objects.equals(this.getJobPositionName(), other.getJobPositionName());
84         }
85
86         @Override
87         public int hashCode () {
88                 int hash = 7;
89                 hash = 37 * hash + Objects.hashCode(this.getJobPositionName());
90                 return hash;
91         }
92
93         @Override
94         public Calendar getJobPositionCreated () {
95                 return this.jobPositionCreated;
96         }
97
98         @Override
99         public void setJobPositionCreated (final Calendar jobPositionCreated) {
100                 this.jobPositionCreated = jobPositionCreated;
101         }
102
103         @Override
104         public Long getJobPositionId () {
105                 return this.jobPositionId;
106         }
107
108         @Override
109         public void setJobPositionId (final Long jobPositionId) {
110                 this.jobPositionId = jobPositionId;
111         }
112
113         @Override
114         public String getJobPositionName () {
115                 return this.jobPositionName;
116         }
117
118         @Override
119         public void setJobPositionName (final String jobPositionName) {
120                 this.jobPositionName = jobPositionName;
121         }
122
123 }