]> git.mxchange.org Git - jjobs-core.git/commitdiff
added initial entities for handling job positions, skills ...
authorRoland Häder <roland@mxchange.org>
Sun, 6 Aug 2017 21:12:18 +0000 (23:12 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 6 Aug 2017 21:12:18 +0000 (23:12 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jjobs/model/jobposition/HireableJobPosition.java [new file with mode: 0644]
src/org/mxchange/jjobs/model/jobposition/JobPosition.java [new file with mode: 0644]
src/org/mxchange/jjobs/model/jobposition/status/JobPositionStatus.java [new file with mode: 0644]
src/org/mxchange/jjobs/model/jobskill/JobPositionSkill.java [new file with mode: 0644]
src/org/mxchange/jjobs/model/jobskill/SkillableJobPosition.java [new file with mode: 0644]
src/org/mxchange/jjobs/model/skill/JobSkill.java [new file with mode: 0644]
src/org/mxchange/jjobs/model/skill/Skillable.java [new file with mode: 0644]
src/org/mxchange/jjobs/model/skill/status/SkillStatus.java [new file with mode: 0644]
src/org/mxchange/jjobs/model/user/skills/SkillableUser.java [new file with mode: 0644]
src/org/mxchange/jjobs/model/user/skills/UserSkill.java [new file with mode: 0644]

diff --git a/src/org/mxchange/jjobs/model/jobposition/HireableJobPosition.java b/src/org/mxchange/jjobs/model/jobposition/HireableJobPosition.java
new file mode 100644 (file)
index 0000000..7ad677b
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.model.jobposition;
+
+import java.util.Calendar;
+import org.mxchange.jcontactsbusiness.jobposition.JobPosition;
+import org.mxchange.jjobs.model.jobposition.status.JobPositionStatus;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A  POJI for hireable job positions
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface HireableJobPosition extends JobPosition {
+
+       /**
+        * Getter for job position start
+        * <p>
+        * @return Job position start
+        */
+       Calendar getJobPositionStart ();
+
+       /**
+        * Setter for job position start
+        * <p>
+        * @param jobPositionStart Job position start
+        */
+       void setJobPositionStart (final Calendar jobPositionStart);
+
+       /**
+        * Getter for job position status
+        * <p>
+        * @return Job position status
+        */
+       JobPositionStatus getJobPositionStatus ();
+
+       /**
+        * Setter for job position status
+        * <p>
+        * @param jobPositionStatus Job position status
+        */
+       void setJobPositionStatus (final JobPositionStatus jobPositionStatus);
+
+       /**
+        * Getter for when this job position was deleted by user
+        * <p>
+        * @return When this job position was deleted by user
+        */
+       Calendar getJobPositionDeleted ();
+
+       /**
+        * Setter for when this job position was deleted by user
+        * <p>
+        * @param jobPositionDeleted When this job position was deleted by user
+        */
+       void setJobPositionDeleted (final Calendar jobPositionDeleted);
+
+       /**
+        * Getter for when this job position has expired
+        * <p>
+        * @return When this job position has expired
+        */
+       Calendar getJobPositionExpired ();
+
+       /**
+        * Setter for when this job position has expired
+        * <p>
+        * @param jobPositionExpired When this job position has expired
+        */
+       void setJobPositionExpired (final Calendar jobPositionExpired);
+
+       /**
+        * Getter for when employee was hired for this job position
+        * <p>
+        * @return When employee was hired for this job position
+        */
+       Calendar getJobPositionHired ();
+
+       /**
+        * Setter for when employee was hired for this job position
+        * <p>
+        * @param jobPositionHired When employee was hired for this job position
+        */
+       void setJobPositionHired (final Calendar jobPositionHired);
+
+       /**
+        * Getter for user who added this job position
+        * <p>
+        * @return User who added this job position
+        */
+       User getJobPositionAddedUser ();
+
+       /**
+        * Setter for user who added this job position
+        * <p>
+        * @param jobPositionAddedUser User who added this job position
+        */
+       void setJobPositionAddedUser (final User jobPositionAddedUser);
+
+}
diff --git a/src/org/mxchange/jjobs/model/jobposition/JobPosition.java b/src/org/mxchange/jjobs/model/jobposition/JobPosition.java
new file mode 100644 (file)
index 0000000..5593025
--- /dev/null
@@ -0,0 +1,275 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.model.jobposition;
+
+import java.util.Calendar;
+import java.util.Objects;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import org.mxchange.jjobs.model.jobposition.status.JobPositionStatus;
+import org.mxchange.jusercore.model.user.LoginUser;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A POJO entity for job positions
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Entity (name = "open_job_position")
+@Table (
+               name = "open_job_position"
+)
+@SuppressWarnings ("PersistenceUnitPresent")
+public class JobPosition implements HireableJobPosition {
+
+       /**
+        * Serial number
+        */
+       @Transient
+       private static final long serialVersionUID = 547_102_736_712_809_694L;
+
+       /**
+        * User who has added this job position
+        */
+       @JoinColumn (name = "job_position_added_user_id", referencedColumnName = "user_id", updatable = false)
+       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
+       private User jobPositionAddedUser;
+
+       /**
+        * When this entry has been created
+        */
+       @Basic (optional = false)
+       @Column (name = "job_position_created", nullable = false, updatable = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       private Calendar jobPositionCreated;
+
+       /**
+        * When this job position (offer) was deleted
+        */
+       @Column (name = "job_position_deleted")
+       @Temporal (TemporalType.TIMESTAMP)
+       private Calendar jobPositionDeleted;
+
+       /**
+        * When this job position (offer) has expired
+        */
+       @Column (name = "job_position_expired")
+       @Temporal (TemporalType.TIMESTAMP)
+       private Calendar jobPositionExpired;
+
+       /**
+        * When a new employed was hired for this job position
+        */
+       @Column (name = "job_position_hired")
+       @Temporal (TemporalType.TIMESTAMP)
+       private Calendar jobPositionHired;
+
+       /**
+        * Id number (primary key)
+        */
+       @Id
+       @GeneratedValue (strategy = GenerationType.IDENTITY)
+       @Column (name = "job_position_id", nullable = false, updatable = false)
+       private Long jobPositionId;
+
+       /**
+        * Name of the position (example: Store Worker)
+        */
+       @Basic (optional = false)
+       @Column (name = "job_position_name", nullable = false, unique = true)
+       private String jobPositionName;
+
+       /**
+        * When this job position (offer) starts
+        */
+       @Basic (optional = false)
+       @Column (name = "job_position_start", nullable = false)
+       @Temporal (TemporalType.DATE)
+       private Calendar jobPositionStart;
+
+       /**
+        * Job position status
+        */
+       @Basic (optional = false)
+       @Column (name = "job_position_status", nullable = false)
+       @Enumerated (EnumType.STRING)
+       private JobPositionStatus jobPositionStatus;
+
+       /**
+        * When this entry has been created
+        */
+       @Column (name = "job_position_updated", insertable = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       private Calendar jobPositionUpdated;
+
+       @Override
+       public boolean equals (final Object object) {
+               if (this == object) {
+                       return true;
+               } else if (null == object) {
+                       return false;
+               } else if (this.getClass() != object.getClass()) {
+                       return false;
+               }
+
+               final HireableJobPosition other = (HireableJobPosition) object;
+
+               if (!Objects.equals(this.getJobPositionName(), other.getJobPositionName())) {
+                       return false;
+               } else if (!Objects.equals(this.getJobPositionId(), other.getJobPositionId())) {
+                       return false;
+               }
+
+               return true;
+       }
+
+       @Override
+       public User getJobPositionAddedUser () {
+               return this.jobPositionAddedUser;
+       }
+
+       @Override
+       public void setJobPositionAddedUser (final User jobPositionAddedUser) {
+               this.jobPositionAddedUser = jobPositionAddedUser;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getJobPositionCreated () {
+               return this.jobPositionCreated;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setJobPositionCreated (final Calendar jobPositionCreated) {
+               this.jobPositionCreated = jobPositionCreated;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getJobPositionDeleted () {
+               return this.jobPositionDeleted;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setJobPositionDeleted (final Calendar jobPositionDeleted) {
+               this.jobPositionDeleted = jobPositionDeleted;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getJobPositionExpired () {
+               return this.jobPositionExpired;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setJobPositionExpired (final Calendar jobPositionExpired) {
+               this.jobPositionExpired = jobPositionExpired;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getJobPositionHired () {
+               return this.jobPositionHired;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setJobPositionHired (final Calendar jobPositionHired) {
+               this.jobPositionHired = jobPositionHired;
+       }
+
+       @Override
+       public Long getJobPositionId () {
+               return this.jobPositionId;
+       }
+
+       @Override
+       public void setJobPositionId (final Long jobPositionId) {
+               this.jobPositionId = jobPositionId;
+       }
+
+       @Override
+       public String getJobPositionName () {
+               return this.jobPositionName;
+       }
+
+       @Override
+       public void setJobPositionName (final String jobPositionName) {
+               this.jobPositionName = jobPositionName;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getJobPositionStart () {
+               return this.jobPositionStart;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setJobPositionStart (final Calendar jobPositionStart) {
+               this.jobPositionStart = jobPositionStart;
+       }
+
+       @Override
+       public JobPositionStatus getJobPositionStatus () {
+               return this.jobPositionStatus;
+       }
+
+       @Override
+       public void setJobPositionStatus (final JobPositionStatus jobPositionStatus) {
+               this.jobPositionStatus = jobPositionStatus;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getJobPositionUpdated () {
+               return this.jobPositionUpdated;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setJobPositionUpdated (final Calendar jobPositionUpdated) {
+               this.jobPositionUpdated = jobPositionUpdated;
+       }
+
+       @Override
+       public int hashCode () {
+               int hash = 7;
+
+               hash = 37 * hash + Objects.hashCode(this.getJobPositionId());
+               hash = 37 * hash + Objects.hashCode(this.getJobPositionName());
+
+               return hash;
+       }
+
+}
diff --git a/src/org/mxchange/jjobs/model/jobposition/status/JobPositionStatus.java b/src/org/mxchange/jjobs/model/jobposition/status/JobPositionStatus.java
new file mode 100644 (file)
index 0000000..3c70d85
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.model.jobposition.status;
+
+/**
+ * An enumeration for job position status
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public enum JobPositionStatus {
+
+       /**
+        * Open job position status (open for applications)
+        */
+       OPEN("JOB_POSITION_STATUS_OPEN", "job_position_status_open"), //NOI18N
+
+       /**
+        * Hired job position status (new employee)
+        */
+       HIRED("JOB_POSITION_STATUS_HIRED", "job_position_status_hired"), //NOI18N
+
+       /**
+        * Deleted job position status (by user)
+        */
+       DELETED("JOB_POSITION_STATUS_DELETED", "job_position_status_deleted"), //NOI18N
+
+       /**
+        * Expired job position status (when no one applied for it)
+        */
+       EXPIRED("JOB_POSITION_STATUS_DELETED", "job_position_status_expired"), //NOI18N
+
+       /**
+        * Locked job position status (by administrator)
+        */
+       LOCKED("JOB_POSITION_STATUS_LOCKED", "job_position_status_locked"); //NOI18N
+
+       /**
+        * Message key for bundles
+        */
+       private final String messageKey;
+
+       /**
+        * CSS class
+        */
+       private final String styleClass;
+
+       /**
+        * Constructor with message key and CSS class
+        * <p>
+        * @param messageKey Message key
+        * @param styleClass CSS class
+        */
+       private JobPositionStatus (final String messageKey, final String styleClass) {
+               // Set all
+               this.messageKey = messageKey;
+               this.styleClass = styleClass;
+       }
+
+       /**
+        * Getter for i18n bundle message key
+        * <p>
+        * @return Message key for i18n bundles
+        */
+       public String getMessageKey () {
+               return this.messageKey;
+       }
+
+       /**
+        * Getter for CSS class
+        * <p>
+        * @return CSS class
+        */
+       public String getStyleClass () {
+               return this.styleClass;
+       }
+
+}
diff --git a/src/org/mxchange/jjobs/model/jobskill/JobPositionSkill.java b/src/org/mxchange/jjobs/model/jobskill/JobPositionSkill.java
new file mode 100644 (file)
index 0000000..67c6050
--- /dev/null
@@ -0,0 +1,217 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.model.jobskill;
+
+import java.util.Calendar;
+import java.util.Objects;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import org.mxchange.jjobs.model.jobposition.HireableJobPosition;
+import org.mxchange.jjobs.model.jobposition.JobPosition;
+import org.mxchange.jjobs.model.skill.JobSkill;
+import org.mxchange.jjobs.model.skill.Skillable;
+import org.mxchange.jusercore.model.user.LoginUser;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A POJO entity for job position skills (linking job position and skill
+ * together)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Entity (name = "job_skills")
+@Table (
+               name = "jobs_skills"
+)
+@SuppressWarnings ("PersistenceUnitPresent")
+public class JobPositionSkill implements SkillableJobPosition {
+
+       /**
+        * Serial number
+        */
+       @Transient
+       private static final long serialVersionUID = 186_757_123_896_419L;
+
+       /**
+        * Linked job position
+        */
+       @JoinColumn (name = "skill_job_position_id", referencedColumnName = "job_position_id", updatable = false, nullable = false)
+       @OneToOne (cascade = CascadeType.ALL, targetEntity = JobPosition.class, optional = false)
+       private HireableJobPosition jobPosition;
+
+       /**
+        * When this entry has been created
+        */
+       @Basic (optional = false)
+       @Column (name = "skill_job_created", nullable = false, updatable = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       private Calendar jobPositionSkillCreated;
+
+       /**
+        * Id number (primary key
+        */
+       @Id
+       @GeneratedValue (strategy = GenerationType.IDENTITY)
+       @Column (name = "skill_job_id", nullable = false, updatable = false)
+       private Long jobPositionSkillId;
+
+       /**
+        * When this entry has been updated
+        */
+       @Column (name = "skill_job_updated", insertable = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       private Calendar jobPositionSkillUpdated;
+
+       /**
+        * Link to skill entity
+        */
+       @JoinColumn(name = "skill_job_skill_id", nullable = false,updatable = false, referencedColumnName = "skill_id")
+       @OneToOne (cascade = CascadeType.REFRESH, targetEntity = JobSkill.class)
+       private Skillable jobSkill;
+
+       /**
+        * User added this skill (optional as administrators can add skills,
+        * too)
+        */
+       @JoinColumn (name = "skill_job_user_id", referencedColumnName = "user_id")
+       @OneToOne (cascade = CascadeType.REFRESH, targetEntity = LoginUser.class)
+       private User skillAddedUser;
+
+       /**
+        * Skill importance (0=unimportant, 10=very important)
+        */
+       @Basic (optional = false)
+       @Column (name = "skill_job_importance", nullable = false)
+       private Short skillImportance;
+
+       @Override
+       public boolean equals (final Object object) {
+               if (this == object) {
+                       return true;
+               } else if (null == object) {
+                       return false;
+               } else if (this.getClass() != object.getClass()) {
+                       return false;
+               }
+
+               final SkillableJobPosition other = (SkillableJobPosition) object;
+
+               if (!Objects.equals(this.getJobPositionSkillId(), other.getJobPositionSkillId())) {
+                       return false;
+               } else if (!Objects.equals(this.getSkillImportance(), other.getSkillImportance())) {
+                       return false;
+               }
+
+               return true;
+       }
+
+       @Override
+       public HireableJobPosition getJobPosition () {
+               return this.jobPosition;
+       }
+
+       @Override
+       public void setJobPosition (final HireableJobPosition jobPosition) {
+               this.jobPosition = jobPosition;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getJobPositionSkillCreated () {
+               return this.jobPositionSkillCreated;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setJobPositionSkillCreated (final Calendar jobPositionSkillCreated) {
+               this.jobPositionSkillCreated = jobPositionSkillCreated;
+       }
+
+       @Override
+       public Long getJobPositionSkillId () {
+               return this.jobPositionSkillId;
+       }
+
+       @Override
+       public void setJobPositionSkillId (final Long jobPositionSkillId) {
+               this.jobPositionSkillId = jobPositionSkillId;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getJobPositionSkillUpdated () {
+               return this.jobPositionSkillUpdated;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setJobPositionSkillUpdated (final Calendar jobPositionSkillUpdated) {
+               this.jobPositionSkillUpdated = jobPositionSkillUpdated;
+       }
+
+       @Override
+       public Skillable getJobSkill () {
+               return this.jobSkill;
+       }
+
+       @Override
+       public void setJobSkill (final Skillable jobSkill) {
+               this.jobSkill = jobSkill;
+       }
+
+       @Override
+       public User getSkillAddedUser () {
+               return this.skillAddedUser;
+       }
+
+       @Override
+       public void setSkillAddedUser (final User skillAddedUser) {
+               this.skillAddedUser = skillAddedUser;
+       }
+
+       @Override
+       public Short getSkillImportance () {
+               return this.skillImportance;
+       }
+
+       @Override
+       public void setSkillImportance (final Short skillImportance) {
+               this.skillImportance = skillImportance;
+       }
+
+       @Override
+       public int hashCode () {
+               int hash = 5;
+
+               hash = 41 * hash + Objects.hashCode(this.getJobPositionSkillId());
+               hash = 41 * hash + Objects.hashCode(this.getSkillImportance());
+
+               return hash;
+       }
+
+}
diff --git a/src/org/mxchange/jjobs/model/jobskill/SkillableJobPosition.java b/src/org/mxchange/jjobs/model/jobskill/SkillableJobPosition.java
new file mode 100644 (file)
index 0000000..1595bf2
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.model.jobskill;
+
+import java.io.Serializable;
+import java.util.Calendar;
+import org.mxchange.jjobs.model.jobposition.HireableJobPosition;
+import org.mxchange.jjobs.model.skill.Skillable;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A POJI for jobPosition's skills
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface SkillableJobPosition extends Serializable {
+
+       /**
+        * Getter for job position skill id number
+        * <p>
+        * @return Job position skill id number
+        */
+       Long getJobPositionSkillId ();
+
+       /**
+        * Setter for job position skill id number
+        * <p>
+        * @param jobPositionSkillId Job position skill id number
+        */
+       void setJobPositionSkillId (final Long jobPositionSkillId);
+
+       /**
+        * Getter for job position skill created timestamp
+        * <p>
+        * @return Job position skill created timestamp
+        */
+       Calendar getJobPositionSkillCreated ();
+
+       /**
+        * Setter for job position skill created timestamp
+        * <p>
+        * @param jobPositionSkillCreated Job position skill created timestamp
+        */
+       void setJobPositionSkillCreated (final Calendar jobPositionSkillCreated);
+
+       /**
+        * Getter for job position skill updated timestamp
+        * <p>
+        * @return Job position skill updated timestamp
+        */
+       Calendar getJobPositionSkillUpdated ();
+
+       /**
+        * Setter for job position skill updated timestamp
+        * <p>
+        * @param jobPositionSkillUpdated Job position skill updated timestamp
+        */
+       void setJobPositionSkillUpdated (final Calendar jobPositionSkillUpdated);
+
+       /**
+        * Getter for job skill
+        * <p>
+        * @return Job skill
+        */
+       Skillable getJobSkill ();
+
+       /**
+        * Setter for job skill
+        * <p>
+        * @param jobSkill Job skill
+        */
+       void setJobSkill (final Skillable jobSkill);
+
+       /**
+        * Getter for job position id from this link (to skill)
+        * <p>
+        * @return Job position id
+        */
+       HireableJobPosition getJobPosition ();
+
+       /**
+        * Setter for job position id from this link (to skill)
+        * <p>
+        * @param jobPosition Job position id
+        */
+       void setJobPosition (final HireableJobPosition jobPosition);
+
+       /**
+        * Getter for skill importance (0 = unrelevant, 10 = very relevant)
+        * <p>
+        * @return Skill importance
+        */
+       Short getSkillImportance ();
+
+       /**
+        * Setter for skill importance (0 = unrelevant, 10 = very relevant)
+        * <p>
+        * @param skillImportance Skill importance
+        */
+       void setSkillImportance (final Short skillImportance);
+
+       /**
+        * Getter for user instance who has added this skill
+        * <p>
+        * @return User instance
+        */
+       User getSkillAddedUser ();
+
+       /**
+        * Setter for user instance who has added this skill
+        * <p>
+        * @param skillAddedUser User instance
+        */
+       void setSkillAddedUser (final User skillAddedUser);
+
+       @Override
+       boolean equals (final Object object);
+
+       @Override
+       int hashCode ();
+
+}
diff --git a/src/org/mxchange/jjobs/model/skill/JobSkill.java b/src/org/mxchange/jjobs/model/skill/JobSkill.java
new file mode 100644 (file)
index 0000000..3b72324
--- /dev/null
@@ -0,0 +1,195 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.model.skill;
+
+import org.mxchange.jjobs.model.skill.status.SkillStatus;
+import java.util.Calendar;
+import java.util.Objects;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+
+/**
+ * A POJO entity for skills
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Entity (name = "skills")
+@Table (
+               name = "skills"
+)
+@SuppressWarnings ("PersistenceUnitPresent")
+public class JobSkill implements Skillable {
+
+       /**
+        * Serial number
+        */
+       @Transient
+       private static final long serialVersionUID = 185435718692L;
+
+       /**
+        * When this entry has been created
+        */
+       @Basic (optional = false)
+       @Column (name = "skill_created", nullable = false, updatable = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       private Calendar skillCreated;
+
+       /**
+        * Id number (primary key)
+        */
+       @Id
+       @GeneratedValue (strategy = GenerationType.IDENTITY)
+       @Column (name = "skill_id", nullable = false, updatable = false)
+       private Long skillId;
+
+       /**
+        * When this entry has been last locked
+        */
+       @Column (name = "skill_last_locked", insertable = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       private Calendar skillLastLocked;
+
+       /**
+        * Skill name
+        */
+       @Basic (optional = false)
+       @Column (name = "skill_name", nullable = false, unique = true)
+       private String skillName;
+
+       /**
+        * Skill status
+        */
+       @Basic (optional = false)
+       @Enumerated (EnumType.STRING)
+       @Column (name = "skill_status", nullable = false)
+       private SkillStatus skillStatus;
+
+       /**
+        * When this entry has been updated
+        */
+       @Column (name = "skill_updated", insertable = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       private Calendar skillUpdated;
+
+       @Override
+       public boolean equals (final Object object) {
+               if (this == object) {
+                       return true;
+               } else if (null == object) {
+                       return false;
+               } else if (this.getClass() != object.getClass()) {
+                       return false;
+               }
+
+               final Skillable other = (Skillable) object;
+
+               if (!Objects.equals(this.getSkillName(), other.getSkillName())) {
+                       return false;
+               } else if (!Objects.equals(this.getSkillId(), other.getSkillId())) {
+                       return false;
+               }
+
+               return true;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getSkillCreated () {
+               return this.skillCreated;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setSkillCreated (final Calendar skillCreated) {
+               this.skillCreated = skillCreated;
+       }
+
+       @Override
+       public Long getSkillId () {
+               return this.skillId;
+       }
+
+       @Override
+       public void setSkillId (final Long skillId) {
+               this.skillId = skillId;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getSkillLastLocked () {
+               return this.skillLastLocked;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setSkillLastLocked (final Calendar skillLastLocked) {
+               this.skillLastLocked = skillLastLocked;
+       }
+
+       @Override
+       public String getSkillName () {
+               return this.skillName;
+       }
+
+       @Override
+       public void setSkillName (final String skillName) {
+               this.skillName = skillName;
+       }
+
+       @Override
+       public SkillStatus getSkillStatus () {
+               return this.skillStatus;
+       }
+
+       @Override
+       public void setSkillStatus (final SkillStatus skillStatus) {
+               this.skillStatus = skillStatus;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getSkillUpdated () {
+               return this.skillUpdated;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setSkillUpdated (final Calendar skillUpdated) {
+               this.skillUpdated = skillUpdated;
+       }
+
+       @Override
+       public int hashCode () {
+               int hash = 7;
+
+               hash = 97 * hash + Objects.hashCode(this.getSkillId());
+               hash = 97 * hash + Objects.hashCode(this.getSkillName());
+
+               return hash;
+       }
+
+}
diff --git a/src/org/mxchange/jjobs/model/skill/Skillable.java b/src/org/mxchange/jjobs/model/skill/Skillable.java
new file mode 100644 (file)
index 0000000..6bc3da6
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.model.skill;
+
+import org.mxchange.jjobs.model.skill.status.SkillStatus;
+import java.io.Serializable;
+import java.util.Calendar;
+
+/**
+ * A POJI for skills (hard and soft)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface Skillable extends Serializable {
+
+       /**
+        * Getter for skill id
+        * <p>
+        * @return Skill id
+        */
+       Long getSkillId ();
+
+       /**
+        * Setter for skill id
+        * <p>
+        * @param skillId Skill id
+        */
+       void setSkillId (final Long skillId);
+
+       /**
+        * Getter for skill name
+        * <p>
+        * @return Skill name
+        */
+       String getSkillName ();
+
+       /**
+        * Setter for skill name
+        * <p>
+        * @param skillName Skill name
+        */
+       void setSkillName (final String skillName);
+
+       /**
+        * Getter for skill created timestamp
+        * <p>
+        * @return Skill created timestamp
+        */
+       Calendar getSkillCreated ();
+
+       /**
+        * Setter for skill created timestamp
+        * <p>
+        * @param skillCreated Skill created timestamp
+        */
+       void setSkillCreated (final Calendar skillCreated);
+
+       /**
+        * Getter for skill updated timestamp
+        * <p>
+        * @return Skill updated timestamp
+        */
+       Calendar getSkillUpdated ();
+
+       /**
+        * Setter for skill updated timestamp
+        * <p>
+        * @param skillUpdated Skill updated timestamp
+        */
+       void setSkillUpdated (final Calendar skillUpdated);
+
+       /**
+        * Getter for skill last locked timestamp
+        * <p>
+        * @return Skill last locked timestamp
+        */
+       Calendar getSkillLastLocked ();
+
+       /**
+        * Setter for skill last locked timestamp
+        * <p>
+        * @param skillLastLocked Skill last locked timestamp
+        */
+       void setSkillLastLocked (final Calendar skillLastLocked);
+
+       /**
+        * Getter for skill status
+        * <p>
+        * @return Skill status
+        */
+       SkillStatus getSkillStatus ();
+
+       /**
+        * Getter for skill status
+        * <p>
+        * @param skillStatus Skill status
+        */
+       void setSkillStatus (final SkillStatus skillStatus);
+
+       @Override
+       boolean equals (final Object object);
+
+       @Override
+       int hashCode ();
+
+}
diff --git a/src/org/mxchange/jjobs/model/skill/status/SkillStatus.java b/src/org/mxchange/jjobs/model/skill/status/SkillStatus.java
new file mode 100644 (file)
index 0000000..7a60802
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.model.skill.status;
+
+/**
+ * An enumeration for skills
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public enum SkillStatus {
+
+       /**
+        * Unlocked (added, can be used)
+        */
+       UNLOCKED("SKILL_STATUS_UNLOCKED", "skill_status_unlocked"), //NOI18N
+
+       /**
+        * Locked by administrator
+        */
+       LOCKED("SKILL_STATUS_LOCKED", "skill_status_locked"); //NOI18N
+
+       /**
+        * Message key for i18n bundles
+        */
+       private final String messageKey;
+
+       /**
+        * CSS class
+        */
+       private final String styleClass;
+
+       /**
+        * Constructor with message key for i18n bundles and CSS class
+        * <p>
+        * @param messageKey Message key for i18n bundles
+        * @param styleClass CSS class
+        */
+       private SkillStatus (final String messageKey, final String styleClass) {
+               // Set al
+               this.messageKey = messageKey;
+               this.styleClass = styleClass;
+       }
+
+       /**
+        * Getter for message key
+        * <p>
+        * @return Message key
+        */
+       public String getMessageKey () {
+               return this.messageKey;
+       }
+
+       /**
+        * CSS class
+        * <p>
+        * @return CSS class
+        */
+       public String getStyleClass () {
+               return this.styleClass;
+       }
+
+}
diff --git a/src/org/mxchange/jjobs/model/user/skills/SkillableUser.java b/src/org/mxchange/jjobs/model/user/skills/SkillableUser.java
new file mode 100644 (file)
index 0000000..276de73
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.model.user.skills;
+
+import org.mxchange.jjobs.model.skill.Skillable;
+import java.io.Serializable;
+import java.util.Calendar;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A POJI for user's skills
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface SkillableUser extends Serializable {
+
+       /**
+        * Getter for user skill id number
+        * <p>
+        * @return User skill id number
+        */
+       Long getUserSkillId ();
+
+       /**
+        * Setter for user skill id number
+        * <p>
+        * @param userSkillId User skill id number
+        */
+       void setUserSkillId (final Long userSkillId);
+
+       /**
+        * Getter for user skill created timestamp
+        * <p>
+        * @return Job position skill created timestamp
+        */
+       Calendar getUserSkillCreated ();
+
+       /**
+        * Setter for user skill created timestamp
+        * <p>
+        * @param userSkillCreated Job position skill created timestamp
+        */
+       void setUserSkillCreated (final Calendar userSkillCreated);
+
+       /**
+        * Getter for user skill updated timestamp
+        * <p>
+        * @return Job position skill updated timestamp
+        */
+       Calendar getUserSkillUpdated ();
+
+       /**
+        * Setter for user skill updated timestamp
+        * <p>
+        * @param userSkillUpdated Job position skill updated timestamp
+        */
+       void setUserSkillUpdated (final Calendar userSkillUpdated);
+
+       /**
+        * Getter for job skill
+        * <p>
+        * @return Job skill
+        */
+       Skillable getJobSkill ();
+
+       /**
+        * Setter for job skill
+        * <p>
+        * @param jobSkill Job skill
+        */
+       void setJobSkill (final Skillable jobSkill);
+
+       /**
+        * Getter for user instance
+        * <p>
+        * @return User instance
+        */
+       User getSkillUser ();
+
+       /**
+        * Setter for user instance
+        * <p>
+        * @param skillUser User instance
+        */
+       void setSkillUser (final User skillUser);
+
+       @Override
+       boolean equals (final Object object);
+
+       @Override
+       int hashCode ();
+
+}
diff --git a/src/org/mxchange/jjobs/model/user/skills/UserSkill.java b/src/org/mxchange/jjobs/model/user/skills/UserSkill.java
new file mode 100644 (file)
index 0000000..5380924
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jjobs.model.user.skills;
+
+import org.mxchange.jjobs.model.skill.JobSkill;
+import org.mxchange.jjobs.model.skill.Skillable;
+import java.util.Calendar;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import org.mxchange.jusercore.model.user.LoginUser;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A POJO entity for user skills
+ *
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Entity (name = "user_skills")
+@Table (
+               name = "user_skills"
+)
+@SuppressWarnings ("PersistenceUnitPresent")
+public class UserSkill implements SkillableUser {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 12_837_674_186_902L;
+
+       /**
+        * Link to skills entity
+        */
+       @JoinColumn (name = "user_skill_id", referencedColumnName = "skill_id", nullable = false, updatable = false)
+       @OneToOne (cascade = CascadeType.REFRESH, optional = false, targetEntity = JobSkill.class)
+       private Skillable jobSkill;
+
+       /**
+        * Link to user entity
+        */
+       @JoinColumn (name = "user_skill_user_id", referencedColumnName = "user_id", nullable = false, updatable = false)
+       @OneToOne (cascade = CascadeType.REFRESH, optional = false, targetEntity = LoginUser.class)
+       private User skillUser;
+
+       /**
+        * When this entry has been created
+        */
+       @Basic (optional = false)
+       @Column (name = "user_skill_created", nullable = false, updatable = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       private Calendar userSkillCreated;
+
+       /**
+        * Id number (primary key)
+        */
+       @Id
+       @GeneratedValue (strategy = GenerationType.IDENTITY)
+       @Column (name = "user_skill_entry_id", nullable = false, updatable = false)
+       private Long userSkillId;
+
+       /**
+        * When this entry has been updated
+        */
+       @Column (name = "user_skill_updated", insertable = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       private Calendar userSkillUpdated;
+
+       @Override
+       public Skillable getJobSkill () {
+               return this.jobSkill;
+       }
+
+       @Override
+       public void setJobSkill (final Skillable jobSkill) {
+               this.jobSkill = jobSkill;
+       }
+
+       @Override
+       public User getSkillUser () {
+               return this.skillUser;
+       }
+
+       @Override
+       public void setSkillUser (final User skillUser) {
+               this.skillUser = skillUser;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getUserSkillCreated () {
+               return this.userSkillCreated;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setUserSkillCreated (final Calendar userSkillCreated) {
+               this.userSkillCreated = userSkillCreated;
+       }
+
+       @Override
+       public Long getUserSkillId () {
+               return this.userSkillId;
+       }
+
+       @Override
+       public void setUserSkillId (final Long userSkillId) {
+               this.userSkillId = userSkillId;
+       }
+
+       @Override
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getUserSkillUpdated () {
+               return this.userSkillUpdated;
+       }
+
+       @Override
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setUserSkillUpdated (final Calendar userSkillUpdated) {
+               this.userSkillUpdated = userSkillUpdated;
+       }
+
+}