From: Roland Haeder Date: Sat, 20 Feb 2016 20:16:43 +0000 (+0100) Subject: resorted members + added this. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=277c663205369cec7c8875d31627c3d38c3a8c67;p=addressbook-lib.git resorted members + added this. --- diff --git a/src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java b/src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java index ff3dbfd..80d7264 100644 --- a/src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java +++ b/src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java @@ -76,6 +76,20 @@ public class UserAddressbook implements Addressbook, Comparable { @Column (name = "addressbook_id", length = 20, nullable = false, updatable = false) private Long addressbookId; + /** + * Last locked timestamp + */ + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "addressbook_last_locked") + private Calendar addressbookLastLocked; + + /** + * Last locked timestamp + */ + @Lob + @Column (name = "addressbook_last_locked_reason") + private String addressbookLastLockedReason; + /** * Name for this address book */ @@ -98,20 +112,6 @@ public class UserAddressbook implements Addressbook, Comparable { @OneToOne (targetEntity = LoginUser.class, optional = false, cascade = CascadeType.MERGE) private User addressbookUser; - /** - * Last locked timestamp - */ - @Temporal (TemporalType.TIMESTAMP) - @Column (name = "addressbook_last_locked") - private Calendar addressbookLastLocked; - - /** - * Last locked timestamp - */ - @Lob - @Column (name = "addressbook_last_locked_reason") - private String addressbookLastLockedReason; - /** * Public constructor with address book name *

@@ -137,6 +137,38 @@ public class UserAddressbook implements Addressbook, Comparable { this.addressbookStatus = AddressbokStatus.UNLOCKED; } + @Override + public int compareTo (final Addressbook addressbook) { + 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 (this.getClass() != object.getClass()) { + return false; + } + + final Addressbook other = (Addressbook) object; + + if (!Objects.equals(this.getAddressbookName(), other.getAddressbookName())) { + return false; + } else if (!Objects.equals(this.getAddressbookUser(), other.getAddressbookUser())) { + return false; + } + + return true; + } + + @Override + public int hashCode () { + int hash = 7; + hash = 59 * hash + Objects.hashCode(this.getAddressbookName()); + hash = 59 * hash + Objects.hashCode(this.getAddressbookUser()); + return hash; + } + @Override public Calendar getAddressbookCreated () { return this.addressbookCreated; @@ -207,35 +239,4 @@ public class UserAddressbook implements Addressbook, Comparable { this.addressbookUser = addressbookUser; } - @Override - public int compareTo (final Addressbook addressbook) { - 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 Addressbook other = (Addressbook) object; - - if (!Objects.equals(this.getAddressbookName(), other.getAddressbookName())) { - return false; - } else if (!Objects.equals(this.getAddressbookUser(), other.getAddressbookUser())) { - return false; - } - - return true; - } - - @Override - public int hashCode () { - int hash = 7; - hash = 59 * hash + Objects.hashCode(this.getAddressbookName()); - hash = 59 * hash + Objects.hashCode(this.getAddressbookUser()); - return hash; - } } diff --git a/src/org/mxchange/addressbook/model/addressbook/entry/UserAddressbookEntry.java b/src/org/mxchange/addressbook/model/addressbook/entry/UserAddressbookEntry.java index e9a8072..b26cb31 100644 --- a/src/org/mxchange/addressbook/model/addressbook/entry/UserAddressbookEntry.java +++ b/src/org/mxchange/addressbook/model/addressbook/entry/UserAddressbookEntry.java @@ -104,7 +104,7 @@ public class UserAddressbookEntry implements AddressbookEntry, Comparable