Przeglądaj źródła

DataBase restruct for skill appending

Михаил 7 lat temu
rodzic
commit
ce8ec2d60e

+ 47 - 0
DBModule/src/main/java/HibernateEntities/MatchSkilEntity.java

@@ -0,0 +1,47 @@
+package HibernateEntities;
+
+import javax.persistence.*;
+
+/**
+ * Created by kinetik on 07.03.17.
+ */
+@Entity
+@Table(name = "skil_match", schema = "anketa")
+public class MatchSkilEntity {
+    private Integer catId;
+    private Integer skilId;
+    private String matchId;
+
+    @Basic
+    @Column(name = "skil_cat_id", nullable = false)
+    public Integer getCatId() {
+        return catId;
+    }
+
+    public void setCatId(Integer catId) {
+        this.catId = catId;
+    }
+
+    @Basic
+    @Column(name = "skil_id", nullable = false)
+    public Integer getSkilId() {
+        return skilId;
+    }
+
+    public void setSkilId(Integer skilId) {
+        this.skilId = skilId;
+    }
+
+    @Id
+    @Column(name = "match_id", nullable = false)
+    public String getMatchId() {
+        return matchId;
+    }
+
+    public void setMatchId(){
+        this.matchId = String.valueOf(this.getSkilId())+"_"+String.valueOf(this.getCatId());
+    }
+    public void setMatchId(String matchId) {
+        this.matchId = matchId;
+    }
+}

+ 47 - 0
DBModule/src/main/java/HibernateEntities/ProjectSkillCatEntity.java

@@ -0,0 +1,47 @@
+package HibernateEntities;
+
+import javax.persistence.*;
+
+/**
+ * Created by kinetik on 07.03.17.
+ */
+@Entity
+@Table(name = "project_skil_cat", schema = "anketa")
+public class ProjectSkillCatEntity {
+    private Integer prId;
+    private Integer skilCatId;
+    private String pcsId;
+    @Id
+    @Column(name = "pcs_id", nullable = false)
+    public String getPcsId() {
+        return pcsId;
+    }
+
+    public void setPcsId(String pcsId) {
+        this.pcsId = pcsId;
+    }
+
+    public void setPcsId(){
+        this.pcsId = String.valueOf(this.getPrId())+" "+String.valueOf(this.getSkilCatId());
+    }
+
+    @Basic
+    @Column(name = "project_id", nullable = false)
+    public Integer getPrId() {
+        return prId;
+    }
+
+    public void setPrId(Integer prId) {
+        this.prId = prId;
+    }
+
+    @Basic
+    @Column(name = "skil_cat_id", nullable = false)
+    public Integer getSkilCatId() {
+        return skilCatId;
+    }
+
+    public void setSkilCatId(Integer skilCatId) {
+        this.skilCatId = skilCatId;
+    }
+}

+ 68 - 0
DBModule/src/main/java/HibernateEntities/ProjectStaffSkillEntity.java

@@ -0,0 +1,68 @@
+package HibernateEntities;
+
+import javax.persistence.*;
+
+/**
+ * Created by kinetik on 07.03.17.
+ */
+@Entity
+@Table(name = "project_mod_skill", schema = "anketa")
+public class ProjectStaffSkillEntity {
+    private Integer projId;
+    private Integer skillId;
+    private Integer slaveId;
+    private Integer slRating;
+    private String pmsId;
+
+    @Id
+    @Column(name = "pms_id", nullable = false)
+    public String getPmsId() {
+        return pmsId;
+    }
+    public void setPmsId(String pmsId) {
+        this.pmsId = pmsId;
+    }
+    public void setPmsId() {
+        this.pmsId = String.valueOf(this.getProjId())+"_"+String.valueOf(this.getSkillId())+"_"+String.valueOf(this.getSlaveId());
+    }
+
+    @Basic
+    @Column(name = "project_id", nullable = false)
+    public Integer getProjId() {
+        return projId;
+    }
+
+    public void setProjId(Integer projId) {
+        this.projId = projId;
+    }
+
+    @Basic
+    @Column(name = "skil_id", nullable = false)
+    public Integer getSkillId() {
+        return skillId;
+    }
+
+    public void setSkillId(Integer skillId) {
+        this.skillId = skillId;
+    }
+
+    @Basic
+    @Column(name = "slave_id", nullable = false)
+    public Integer getSlaveId() {
+        return slaveId;
+    }
+
+    public void setSlaveId(Integer slaveId) {
+        this.slaveId = slaveId;
+    }
+
+    @Basic
+    @Column(name = "rating", nullable = false)
+    public Integer getSlRating() {
+        return slRating;
+    }
+
+    public void setSlRating(Integer slRating) {
+        this.slRating = slRating;
+    }
+}

+ 33 - 0
DBModule/src/main/java/HibernateEntities/SkillCatEntity.java

@@ -0,0 +1,33 @@
+package HibernateEntities;
+
+import javax.persistence.*;
+
+/**
+ * Created by kinetik on 07.03.17.
+ */
+@Entity
+@Table(name = "skil_cat", schema = "anketa")
+public class SkillCatEntity {
+    private Integer catId;
+    private String catName;
+
+    @Id
+    @Column(name = "skil_cat_id", nullable = false)
+    public Integer getCatId() {
+        return catId;
+    }
+
+    public void setCatId(Integer catId) {
+        this.catId = catId;
+    }
+
+    @Basic
+    @Column(name = "skil_cat_name", nullable = false)
+    public String getCatName() {
+        return catName;
+    }
+
+    public void setCatName(String catName) {
+        this.catName = catName;
+    }
+}

+ 33 - 0
DBModule/src/main/java/HibernateEntities/SkillListEntity.java

@@ -0,0 +1,33 @@
+package HibernateEntities;
+
+import javax.persistence.*;
+
+/**
+ * Created by kinetik on 07.03.17.
+ */
+@Entity
+@Table(name = "skil_list", schema = "anketa")
+public class SkillListEntity {
+    private Integer skilId;
+    private String skilName;
+
+    @Id
+    @Column(name = "skil_id", nullable = false)
+    public Integer getSkilId() {
+        return skilId;
+    }
+
+    public void setSkilId(Integer skilId) {
+        this.skilId = skilId;
+    }
+
+    @Basic
+    @Column(name = "skil_name", nullable = false)
+    public String getSkilName() {
+        return skilName;
+    }
+
+    public void setSkilName(String skilName) {
+        this.skilName = skilName;
+    }
+}

+ 24 - 0
DBModule/src/main/resources/Project_mod_skillEntity.hbm.xml

@@ -0,0 +1,24 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC
+        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+    <class name="HibernateEntities.ProjectStaffSkillEntity" table="project_mod_skill" schema="anketa">
+        <id name="pmsId">
+            <column name="pms_id" sql-type="varchar(45)" length="45"not-null="true"/>
+        </id>
+        <property name="projId">
+            <column name="project_id" sql-type="int(11)" length="11" not-null="true"/>
+        </property>
+        <property name="skillId">
+            <column name="skil_id" sql-type="int(11)" length="11" not-null="true"/>
+        </property>
+        <property name="slaveId">
+            <column name="slave_id" sql-type="int(11)" length="11" not-null="true"/>
+        </property>
+        <property name="slRating">
+            <column name="rating" sql-type="int(11)" length="11" not-null="true"/>
+        </property>
+    </class>
+</hibernate-mapping>

+ 18 - 0
DBModule/src/main/resources/Project_skil_catEntity.hbm.xml

@@ -0,0 +1,18 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC
+        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+    <class name="HibernateEntities.ProjectSkillCatEntity" table="project_skil_cat" schema="anketa">
+        <id name="pcsId">
+            <column name="pcs_id" sql-type="varchar(45)" length="45" not-null="true"/>
+        </id>
+        <property name="prId">
+            <column name="project_id" sql-type="int(11)" length="11" not-null="true"/>
+        </property>
+        <property name="skilCatId">
+            <column name="skil_cat_id" sql-type="int(11)" length="11" not-null="true"/>
+        </property>
+    </class>
+</hibernate-mapping>

+ 15 - 0
DBModule/src/main/resources/Skil_catEntity.hbm.xml

@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC
+        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+    <class name="HibernateEntities.SkillCatEntity" table="skil_cat" schema="anketa">
+        <id name="catId">
+            <column name="skil_cat_id" sql-type="int(11)" length="11" not-null="true"/>
+        </id>
+        <property name="catName">
+            <column name="skil_cat_name" sql-type="varchar(100)" length="100" not-null="true"/>
+        </property>
+    </class>
+</hibernate-mapping>

+ 15 - 0
DBModule/src/main/resources/Skil_listEntity.hbm.xml

@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC
+        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+    <class name="HibernateEntities.SkillListEntity" table="skil_list" schema="anketa">
+        <id name="skilId">
+            <column name="skil_id" sql-type="int(11)" length="11" not-null="true"/>
+        </id>
+        <property name="skilName">
+            <column name="skil_name" sql-type="varchar(100)" length="100" not-null="true"/>
+        </property>
+    </class>
+</hibernate-mapping>

+ 18 - 0
DBModule/src/main/resources/Skil_matchEntity.hbm.xml

@@ -0,0 +1,18 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-mapping PUBLIC
+        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+
+    <class name="HibernateEntities.MatchSkilEntity" table="skil_match" schema="anketa">
+        <id name="matchId">
+            <column name="match_id" sql-type="varchar(45)" length="45" not-null="true"/>
+        </id>
+        <property name="catId">
+            <column name="skil_cat_id" sql-type="int(11)" length="11" not-null="true"/>
+        </property>
+        <property name="skilId">
+            <column name="skil_id" sql-type="int(11)" length="11" not-null="true"/>
+        </property>
+    </class>
+</hibernate-mapping>

+ 8 - 0
DBModule/src/main/resources/hibernate.cfg.xml

@@ -25,6 +25,14 @@
       <mapping class="HibernateEntities.StudentsEntity"/>
       <mapping resource="UsersEntity.hbm.xml"/>
       <mapping class="HibernateEntities.UsersEntity"/>
+      <mapping resource="Project_mod_skillEntity.hbm.xml"/>
+      <mapping class="HibernateEntities.ProjectStaffSkillEntity"/>
+      <mapping resource="Project_skil_catEntity.hbm.xml"/>
+      <mapping class="HibernateEntities.ProjectSkillCatEntity"/>
+      <mapping resource="Skil_catEntity.hbm.xml"/>
+      <mapping class="HibernateEntities.SkillCatEntity"/>
+      <mapping resource="Skil_listEntity.hbm.xml"/>
+      <mapping class="HibernateEntities.SkillListEntity"/>
       <!-- <property name="connection.username"/> -->
     <!-- <property name="connection.password"/> -->