]> git.mxchange.org Git - jcontacts-business-core.git/commitdiff
user (owner) is now optional and renamed
authorRoland Häder <roland@mxchange.org>
Sun, 23 Jul 2017 10:08:46 +0000 (12:08 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 23 Jul 2017 10:17:07 +0000 (12:17 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcontactsbusiness/BusinessContact.java
src/org/mxchange/jcontactsbusiness/CompanyContact.java

index df21de424bb0d9f3bf0ed34aafe4d260f6acb8b2..8fba8bbaffa032ace8b816d2ce4b715d5c4f6359 100644 (file)
@@ -121,14 +121,14 @@ public interface BusinessContact extends Serializable {
         * <p>
         * @return User owner instance
         */
-       User getContactUserOwner ();
+       User getContactCompanyUserOwner ();
 
        /**
         * Setter for user owner instance
         * <p>
         * @param contactUserOwner User owner instance
         */
-       void setContactUserOwner (final User contactUserOwner);
+       void setContactCompanyUserOwner (final User contactUserOwner);
 
        /**
         * Getter for timestamp when this entry has been created
index 3d1c9b9eda4ada37f8a2cefec2a34abfd9c6d553..ec4bc1291fecabd82ffdd7acb2f4955aad0add79 100644 (file)
@@ -93,6 +93,13 @@ public class CompanyContact implements BusinessContact {
        @OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.ALL)
        private Employee companyFounder;
 
+       /**
+        * User owner instance
+        */
+       @JoinColumn (name = "company_owner_user_id")
+       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH)
+       private User contactCompanyUserOwner;
+
        /**
         * Timestamp when this entry has been created
         */
@@ -101,13 +108,6 @@ public class CompanyContact implements BusinessContact {
        @Column (name = "company_entry_created", nullable = false, updatable = false)
        private Calendar contactCreated;
 
-       /**
-        * User owner instance
-        */
-       @JoinColumn (name = "company_user_id", nullable = false, updatable = false)
-       @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
-       private User contactUserOwner;
-
        /**
         * Reference to headquarters data
         */
@@ -193,25 +193,25 @@ public class CompanyContact implements BusinessContact {
        }
 
        @Override
-       @SuppressWarnings ("ReturnOfDateField")
-       public Calendar getContactCreated () {
-               return this.contactCreated;
+       public User getContactCompanyUserOwner () {
+               return this.contactCompanyUserOwner;
        }
 
        @Override
-       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
-       public void setContactCreated (final Calendar contactCreated) {
-               this.contactCreated = contactCreated;
+       public void setContactCompanyUserOwner (final User contactCompanyUserOwner) {
+               this.contactCompanyUserOwner = contactCompanyUserOwner;
        }
 
        @Override
-       public User getContactUserOwner () {
-               return this.contactUserOwner;
+       @SuppressWarnings ("ReturnOfDateField")
+       public Calendar getContactCreated () {
+               return this.contactCreated;
        }
 
        @Override
-       public void setContactUserOwner (final User contactUserOwner) {
-               this.contactUserOwner = contactUserOwner;
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setContactCreated (final Calendar contactCreated) {
+               this.contactCreated = contactCreated;
        }
 
        @Override