From c22815d8af920878de5446297a5278091f7a631d Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 18 Apr 2016 20:11:14 +0200 Subject: [PATCH] Don't let the model set its own properties (to much) as this removes flexibility. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../model/addressbook/UserAddressbook.java | 10 ++++------ .../model/addressbook/shared/AddressbookShare.java | 14 ++++++-------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java b/src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java index 0606f3c..ce02a36 100644 --- a/src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java +++ b/src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java @@ -115,18 +115,16 @@ public class UserAddressbook implements Addressbook { /** * Public constructor with address book name *

- * @param addressbookName Address book name - * @param addressbookUser User instance - * @param addressbookCreated When this entry has been created + * @param addressbookName Address book name + * @param addressbookUser User instance */ - public UserAddressbook (final String addressbookName, final User addressbookUser, final Calendar addressbookCreated) { + public UserAddressbook (final String addressbookName, final User addressbookUser) { // Call default constructor this(); - // Set name, user instance and creation timestamp + // Set name, user instance this.addressbookName = addressbookName; this.addressbookUser = addressbookUser; - this.addressbookCreated = addressbookCreated; } /** diff --git a/src/org/mxchange/addressbook/model/addressbook/shared/AddressbookShare.java b/src/org/mxchange/addressbook/model/addressbook/shared/AddressbookShare.java index ac6c8bb..13dc9e4 100644 --- a/src/org/mxchange/addressbook/model/addressbook/shared/AddressbookShare.java +++ b/src/org/mxchange/addressbook/model/addressbook/shared/AddressbookShare.java @@ -18,7 +18,6 @@ package org.mxchange.addressbook.model.addressbook.shared; import java.text.MessageFormat; import java.util.Calendar; -import java.util.GregorianCalendar; import java.util.Objects; import javax.persistence.Basic; import javax.persistence.CascadeType; @@ -102,6 +101,12 @@ public class AddressbookShare implements ShareableAddressbook { @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false) private User shareUserSharee; + /** + * Default constructor + */ + public AddressbookShare () { + } + /** * Constructor with address book and sharee instance. Both parameters must * not be null, their id numbers must be set and the adress book's user @@ -142,13 +147,6 @@ public class AddressbookShare implements ShareableAddressbook { this.shareAddressbook = addressbook; this.shareUserOwner = addressbook.getAddressbookUser(); this.shareUserSharee = sharee; - this.shareCreated = new GregorianCalendar(); - } - - /** - * Default constructor - */ - public AddressbookShare () { } @Override -- 2.39.5