From: Roland Häder Date: Sun, 23 Jul 2017 10:08:46 +0000 (+0200) Subject: user (owner) is now optional and renamed X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=acf24cdd43f10725efc9193e2045f72b70328416;p=jcontacts-business-core.git user (owner) is now optional and renamed Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jcontactsbusiness/BusinessContact.java b/src/org/mxchange/jcontactsbusiness/BusinessContact.java index df21de4..8fba8bb 100644 --- a/src/org/mxchange/jcontactsbusiness/BusinessContact.java +++ b/src/org/mxchange/jcontactsbusiness/BusinessContact.java @@ -121,14 +121,14 @@ public interface BusinessContact extends Serializable { *

* @return User owner instance */ - User getContactUserOwner (); + User getContactCompanyUserOwner (); /** * Setter for user owner instance *

* @param contactUserOwner User owner instance */ - void setContactUserOwner (final User contactUserOwner); + void setContactCompanyUserOwner (final User contactUserOwner); /** * Getter for timestamp when this entry has been created diff --git a/src/org/mxchange/jcontactsbusiness/CompanyContact.java b/src/org/mxchange/jcontactsbusiness/CompanyContact.java index 3d1c9b9..ec4bc12 100644 --- a/src/org/mxchange/jcontactsbusiness/CompanyContact.java +++ b/src/org/mxchange/jcontactsbusiness/CompanyContact.java @@ -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