/*
- * Copyright (C) 2016 - 2020 Free Software Foundation
+ * Copyright (C) 2016 - 2022 Free Software Foundation
*
* 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
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.mxchange.jaddressbook.model.addressbook.status.AddressbokStatus;
-import org.mxchange.jcoreutils.Comparables;
+import org.mxchange.jcoreutils.comparable.Comparables;
import org.mxchange.jusercore.model.user.LoginUser;
import org.mxchange.jusercore.model.user.User;
*/
@Basic (optional = false)
@Temporal (value = TemporalType.TIMESTAMP)
- @Column (name = "addressbook_created", nullable = false, updatable = false)
+ @Column (name = "addressbook_created", updatable = false, nullable = false)
private Date addressbookCreated;
/**
@Column (name = "addressbook_status", nullable = false, length = 10)
private AddressbokStatus addressbookStatus;
+ /**
+ * When this address book has been created
+ */
+ @Temporal (value = TemporalType.TIMESTAMP)
+ @Column (name = "addressbook_updated", insertable = false, nullable = false)
+ private Date addressbookUpdated;
+
/**
* Connection to "users" table
*/
return false;
}
- final Addressbook other = (Addressbook) object;
+ final Addressbook addressbook = (Addressbook) object;
- if (!Objects.equals(this.getAddressbookName(), other.getAddressbookName())) {
+ if (!Objects.equals(this.getAddressbookId(), addressbook.getAddressbookId())) {
+ return false;
+ } else if (!Objects.equals(this.getAddressbookLastLocked(), addressbook.getAddressbookLastLocked())) {
+ return false;
+ } else if (!Objects.equals(this.getAddressbookLastLockedReason(), addressbook.getAddressbookLastLockedReason())) {
+ return false;
+ } else if (!Objects.equals(this.getAddressbookName(), addressbook.getAddressbookName())) {
+ return false;
+ } else if (!Objects.equals(this.getAddressbookStatus(), addressbook.getAddressbookStatus())) {
return false;
- } else if (!Objects.equals(this.getAddressbookUser(), other.getAddressbookUser())) {
+ } else if (!Objects.equals(this.getAddressbookUser(), addressbook.getAddressbookUser())) {
return false;
}
this.addressbookStatus = addressbookStatus;
}
+ @Override
+ @SuppressWarnings ("ReturnOfDateField")
+ public Date getAddressbookUpdated () {
+ return this.addressbookUpdated;
+ }
+
+ @Override
+ @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+ public void setAddressbookUpdated (final Date addressbookUpdated) {
+ this.addressbookUpdated = addressbookUpdated;
+ }
+
@Override
public User getAddressbookUser () {
return this.addressbookUser;
public int hashCode () {
int hash = 7;
+ hash = 59 * hash + Objects.hashCode(this.getAddressbookId());
+ hash = 59 * hash + Objects.hashCode(this.getAddressbookLastLocked());
+ hash = 59 * hash + Objects.hashCode(this.getAddressbookLastLockedReason());
hash = 59 * hash + Objects.hashCode(this.getAddressbookName());
+ hash = 59 * hash + Objects.hashCode(this.getAddressbookStatus());
hash = 59 * hash + Objects.hashCode(this.getAddressbookUser());
return hash;