]> git.mxchange.org Git - jcontacts-business-core.git/blobdiff - src/org/mxchange/jcontactsbusiness/CompanyContact.java
Sorted members
[jcontacts-business-core.git] / src / org / mxchange / jcontactsbusiness / CompanyContact.java
index ba30b08caa308a445efa756b612bff7e0680ecfa..2319949cf9f19a6eddbecbcee6744c8fa81e0b0d 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
@@ -27,7 +27,6 @@ import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
-import javax.persistence.OneToMany;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
 import javax.persistence.Temporal;
@@ -93,18 +92,12 @@ public class CompanyContact implements BusinessContact, Comparable<BusinessConta
        private Employee companyFounder;
 
        /**
-        * Reference to employee list
-        */
-       @JoinColumn (name = "company_employees_id", nullable = false, updatable = false)
-       @OneToMany (targetEntity = CompanyEmployee.class, cascade = CascadeType.ALL)
-       private List<Employee> employees;
-
-       /**
-        * Reference to headquarters data
+        * Timestamp when this entry has been created
         */
-       @JoinColumn (name = "company_headquarters_data_id", nullable = false, updatable = false)
-       @OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL, optional = false)
-       private HeadQuartersData headQuartersData;
+       @Basic (optional = false)
+       @Temporal (TemporalType.TIMESTAMP)
+       @Column (name = "company_entry_created", nullable = false, updatable = false)
+       private Calendar contactCreated;
 
        /**
         * User owner instance
@@ -114,12 +107,29 @@ public class CompanyContact implements BusinessContact, Comparable<BusinessConta
        private User contactUserOwner;
 
        /**
-        * Timestamp when this entry has been created
+        * Reference to headquarters data
         */
-       @Basic (optional = false)
-       @Temporal (TemporalType.TIMESTAMP)
-       @Column (name = "company_entry_created", nullable = false, updatable = false)
-       private Calendar contactCreated;
+       @JoinColumn (name = "company_headquarters_data_id", nullable = false, updatable = false)
+       @OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL, optional = false)
+       private HeadQuartersData headQuartersData;
+
+       @Override
+       public int compareTo (final BusinessContact businessContact) {
+               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 (getClass() != object.getClass()) {
+                       return false;
+               }
+
+               final BusinessContact other = (BusinessContact) object;
+
+               return Objects.equals(this.getBasicBusinessData(), other.getBasicBusinessData());
+       }
 
        @Override
        public BusinessBasicData getBasicBusinessData () {
@@ -191,16 +201,6 @@ public class CompanyContact implements BusinessContact, Comparable<BusinessConta
                this.contactUserOwner = contactUserOwner;
        }
 
-       @Override
-       public List<Employee> getEmployees () {
-               return this.employees;
-       }
-
-       @Override
-       public void setEmployees (final List<Employee> employees) {
-               this.employees = employees;
-       }
-
        @Override
        public HeadQuartersData getHeadQuartersData () {
                return this.headQuartersData;
@@ -211,24 +211,6 @@ public class CompanyContact implements BusinessContact, Comparable<BusinessConta
                this.headQuartersData = headQuartersData;
        }
 
-       @Override
-       public int compareTo (final BusinessContact businessContact) {
-               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 (getClass() != object.getClass()) {
-                       return false;
-               }
-
-               final BusinessContact other = (BusinessContact) object;
-
-               return Objects.equals(this.getBasicBusinessData(), other.getBasicBusinessData());
-       }
-
        @Override
        public int hashCode () {
                int hash = 3;