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