2 * Copyright (C) 2016, 2017 Roland Häder
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.model.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.Table;
28 import javax.persistence.Temporal;
29 import javax.persistence.TemporalType;
30 import javax.persistence.Transient;
33 * A POJO for job positions
35 * @author Roland Häder<roland@mxchange.org>
37 @Entity (name = "company_job_positions")
39 name = "company_job_positions"
41 @SuppressWarnings ("PersistenceUnitPresent")
42 public class EmployeePosition implements JobPosition {
48 private static final long serialVersionUID = 18_427_587_187_609L;
51 * Timestamp when this entry has been created
53 @Basic (optional = false)
54 @Temporal (TemporalType.TIMESTAMP)
55 @Column (name = "job_position_created", nullable = false, updatable = false)
56 private Calendar jobPositionCreated;
62 @GeneratedValue (strategy = GenerationType.IDENTITY)
63 @Column (name = "job_position_id", nullable = false, updatable = false)
64 private Long jobPositionId;
67 * Name/description of the job position (example: CEO)
69 @Basic (optional = false)
70 @Column (name = "job_position_name", nullable = false, unique = true)
71 private String jobPositionName;
74 * Timestamp when this entry has been created
76 @Temporal (TemporalType.TIMESTAMP)
77 @Column (name = "job_position_updated", insertable = false)
78 private Calendar jobPositionUpdated;
81 public boolean equals (final Object object) {
84 } else if (null == object) {
86 } else if (this.getClass() != object.getClass()) {
90 final JobPosition other = (JobPosition) object;
92 if (!Objects.equals(this.getJobPositionId(), other.getJobPositionId())) {
94 } else if (!Objects.equals(this.getJobPositionName(), other.getJobPositionName())) {
102 @SuppressWarnings ("ReturnOfDateField")
103 public Calendar getJobPositionCreated () {
104 return this.jobPositionCreated;
108 @SuppressWarnings ("AssignmentToDateFieldFromParameter")
109 public void setJobPositionCreated (final Calendar jobPositionCreated) {
110 this.jobPositionCreated = jobPositionCreated;
114 public Long getJobPositionId () {
115 return this.jobPositionId;
119 public void setJobPositionId (final Long jobPositionId) {
120 this.jobPositionId = jobPositionId;
124 public String getJobPositionName () {
125 return this.jobPositionName;
129 public void setJobPositionName (final String jobPositionName) {
130 this.jobPositionName = jobPositionName;
134 @SuppressWarnings ("ReturnOfDateField")
135 public Calendar getJobPositionUpdated () {
136 return this.jobPositionUpdated;
140 @SuppressWarnings ("AssignmentToDateFieldFromParameter")
141 public void setJobPositionUpdated (final Calendar jobPositionUpdated) {
142 this.jobPositionUpdated = jobPositionUpdated;
146 public int hashCode () {
149 hash = 37 * hash + Objects.hashCode(this.getJobPositionId());
150 hash = 37 * hash + Objects.hashCode(this.getJobPositionName());