2 * Copyright (C) 2016 Roland Haeder
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.
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.
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/>.
17 package org.mxchange.jcontactsbusiness.jobposition;
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;
33 * A POJO for job positions
35 * @author Roland Haeder<roland@mxchange.org>
37 @Entity (name = "company_job_positions")
39 name = "company_job_positions",
41 @Index (name = "job_position", columnList = "job_position_name", unique = true)
44 public class EmployeePosition implements JobPosition {
49 private static final long serialVersionUID = 18_427_587_187_609L;
52 * Timestamp when this entry has been created
54 @Basic (optional = false)
55 @Temporal (TemporalType.TIMESTAMP)
56 @Column (name = "job_position_created", nullable = false, updatable = false)
57 private Calendar jobPositionCreated;
63 @GeneratedValue (strategy = GenerationType.IDENTITY)
64 @Column (name = "job_position_id", length = 20, nullable = false, updatable = false)
65 private Long jobPositionId;
68 * Name/description of the job position (example: CEO)
70 @Basic (optional = false)
71 @Column (name = "job_position_name", length = 20, nullable = false, unique = true)
72 private String jobPositionName;
75 public boolean equals (final Object object) {
78 } else if (this.getClass() != object.getClass()) {
82 final JobPosition other = (JobPosition) object;
84 return Objects.equals(this.getJobPositionName(), other.getJobPositionName());
88 public int hashCode () {
90 hash = 37 * hash + Objects.hashCode(this.getJobPositionName());
95 public Calendar getJobPositionCreated () {
96 return this.jobPositionCreated;
100 public void setJobPositionCreated (final Calendar jobPositionCreated) {
101 this.jobPositionCreated = jobPositionCreated;
105 public Long getJobPositionId () {
106 return this.jobPositionId;
110 public void setJobPositionId (final Long jobPositionId) {
111 this.jobPositionId = jobPositionId;
115 public String getJobPositionName () {
116 return this.jobPositionName;
120 public void setJobPositionName (final String jobPositionName) {
121 this.jobPositionName = jobPositionName;