@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
*/
@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
* <p>
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;
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;
- }
}
public boolean equals (final Object object) {
if (object == null) {
return false;
- } else if (getClass() != object.getClass()) {
+ } else if (this.getClass() != object.getClass()) {
return false;
}
return true;
}
+ @Override
+ public int hashCode () {
+ int hash = 3;
+ hash = 19 * hash + Objects.hashCode(this.getAddressbookEntryBusinessContact());
+ hash = 19 * hash + Objects.hashCode(this.getAddressbookEntryPrivateContact());
+ hash = 19 * hash + Objects.hashCode(this.getAddressbookId());
+ return hash;
+ }
+
@Override
public BusinessContact getAddressbookEntryBusinessContact () {
return this.addressbookEntryBusinessContact;
this.addressbookId = addressbookId;
}
- @Override
- public int hashCode () {
- int hash = 3;
- hash = 19 * hash + Objects.hashCode(this.getAddressbookEntryBusinessContact());
- hash = 19 * hash + Objects.hashCode(this.getAddressbookEntryPrivateContact());
- hash = 19 * hash + Objects.hashCode(this.getAddressbookId());
- return hash;
- }
-
}
*/
private static final long serialVersionUID = 167_889_678_177_691_690L;
+ /**
+ * Address book this share is for
+ */
+ @JoinColumn (name = "share_addressbook_id", nullable = false, updatable = false)
+ @OneToOne (targetEntity = UserAddressbook.class, cascade = CascadeType.MERGE, optional = false)
+ private Addressbook shareAddressbook;
+
+ /**
+ * When this share has been created
+ */
+ @Basic (optional = false)
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "share_created", nullable = false, updatable = false)
+ private Calendar shareCreated;
+
/**
* Id number
*/
@Column (name = "share_id", length = 20, nullable = false, updatable = false)
private Long shareId;
- /**
- * Address book this share is for
- */
- @JoinColumn (name = "share_addressbook_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = UserAddressbook.class, cascade = CascadeType.MERGE, optional = false)
- private Addressbook shareAddressbook;
-
/**
* User who is owning the share
*/
@OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.MERGE, optional = false)
private User shareUserSharee;
- /**
- * When this share has been created
- */
- @Basic (optional = false)
- @Temporal (TemporalType.TIMESTAMP)
- @Column (name = "share_created", nullable = false, updatable = false)
- private Calendar shareCreated;
-
- /**
- * Default constructor for entity manager
- */
- protected 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
this.shareCreated = new GregorianCalendar();
}
+ /**
+ * Default constructor for entity manager
+ */
+ protected AddressbookShare () {
+ }
+
@Override
public int compareTo (final ShareableAddressbook share) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
public boolean equals (final Object object) {
if (object == null) {
return false;
- } else if (getClass() != object.getClass()) {
+ } else if (this.getClass() != object.getClass()) {
return false;
}
return Objects.equals(this.getShareUserSharee(), other.getShareUserSharee());
}
+ @Override
+ public int hashCode () {
+ int hash = 7;
+ hash = 19 * hash + Objects.hashCode(this.getShareAddressbook());
+ hash = 19 * hash + Objects.hashCode(this.getShareUserOwner());
+ hash = 19 * hash + Objects.hashCode(this.getShareUserSharee());
+ return hash;
+ }
+
@Override
public Addressbook getShareAddressbook () {
return this.shareAddressbook;
this.shareUserSharee = shareUserSharee;
}
- @Override
- public int hashCode () {
- int hash = 7;
- hash = 19 * hash + Objects.hashCode(this.getShareAddressbook());
- hash = 19 * hash + Objects.hashCode(this.getShareUserOwner());
- hash = 19 * hash + Objects.hashCode(this.getShareUserSharee());
- return hash;
- }
}