]> git.mxchange.org Git - jcontacts-business-core.git/blobdiff - src/org/mxchange/jcontactsbusiness/jobposition/EmployeePosition.java
resorted members + added this.
[jcontacts-business-core.git] / src / org / mxchange / jcontactsbusiness / jobposition / EmployeePosition.java
index 68f2876a079e3a20bad451163fdd84782c7b0c83..2ac54d9b862c40c6fc50964c436c4571e8d91335 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Roland Haeder
+ * Copyright (C) 2016 Roland Haeder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -16,6 +16,8 @@
  */
 package org.mxchange.jcontactsbusiness.jobposition;
 
+import java.util.Calendar;
+import java.util.Objects;
 import javax.persistence.Basic;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -23,14 +25,16 @@ import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
 
 /**
  * A POJO for job positions
  * <p>
  * @author Roland Haeder
  */
-@Entity (name = "job_positions")
-@Table (name = "job_positions")
+@Entity (name = "company_job_positions")
+@Table (name = "company_job_positions")
 public class EmployeePosition implements JobPosition, Comparable<JobPosition> {
 
        /**
@@ -38,6 +42,14 @@ public class EmployeePosition implements JobPosition, Comparable<JobPosition> {
         */
        private static final long serialVersionUID = 18_427_587_187_609L;
 
+       /**
+        * Timestamp when this entry has been created
+        */
+       @Basic (optional = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       @Column (name = "job_position_created", nullable = false, updatable = false)
+       private Calendar jobPositionCreated;
+
        /**
         * Id number
         */
@@ -58,6 +70,36 @@ public class EmployeePosition implements JobPosition, Comparable<JobPosition> {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
 
+       @Override
+       public boolean equals (final Object object) {
+               if (object == null) {
+                       return false;
+               } else if (this.getClass() != object.getClass()) {
+                       return false;
+               }
+
+               final JobPosition other = (JobPosition) object;
+
+               return Objects.equals(this.getJobPositionName(), other.getJobPositionName());
+       }
+
+       @Override
+       public int hashCode () {
+               int hash = 7;
+               hash = 37 * hash + Objects.hashCode(this.getJobPositionName());
+               return hash;
+       }
+
+       @Override
+       public Calendar getJobPositionCreated () {
+               return this.jobPositionCreated;
+       }
+
+       @Override
+       public void setJobPositionCreated (final Calendar jobPositionCreated) {
+               this.jobPositionCreated = jobPositionCreated;
+       }
+
        @Override
        public Long getJobPositionId () {
                return this.jobPositionId;