- compareTo()/Comparable<T> was used back in the TDGP times and is no longer needed
- updated jar(s)
@NamedQuery (name = "SearchAddressbookById", query = "SELECT a FROM addressbooks AS a WHERE a.addressbookId = :id")
}
)
-public class UserAddressbook implements Addressbook, Comparable<Addressbook> {
+public class UserAddressbook implements Addressbook {
/**
* Serial number
/**
* Public constructor with address book name
* <p>
- * @param addressbookName Address book name
- * @param addressbookUser User instance
+ * @param addressbookName Address book name
+ * @param addressbookUser User instance
* @param addressbookCreated When this entry has been created
*/
public UserAddressbook (final String addressbookName, final User addressbookUser, final Calendar addressbookCreated) {
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) {
+ if (this == object) {
+ return true;
+ } else if (null == object) {
return false;
} else if (this.getClass() != object.getClass()) {
return false;
name = "SearchUsersAddressbookEntries",
query = "SELECT e FROM addressbook_entries AS e INNER JOIN addressbooks AS a ON e.addressbookId = a WHERE e.addressbookId = :addressbook AND a.addressbookUser = :owner ORDER BY e.addressbookEntryId ASC")
)
-public class UserAddressbookEntry implements AddressbookEntry, Comparable<AddressbookEntry> {
+public class UserAddressbookEntry implements AddressbookEntry {
/**
* Serial number
@OneToOne (targetEntity = UserAddressbook.class, optional = false, cascade = CascadeType.REFRESH)
private Addressbook addressbookId;
- @Override
- public int compareTo (final AddressbookEntry addressbookEntry) {
- 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) {
+ if (null == object) {
return false;
} else if (this.getClass() != object.getClass()) {
return false;
)
}
)
-public class AddressbookShare implements ShareableAddressbook, Comparable<ShareableAddressbook> {
+public class AddressbookShare implements ShareableAddressbook {
/**
* Serial number
public AddressbookShare () {
}
- @Override
- public int compareTo (final ShareableAddressbook share) {
- 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) {
+ if (null == object) {
return false;
} else if (this.getClass() != object.getClass()) {
return false;
addressbook = this.addressbookBean.getAddressbookById(addressbookId);
// Is it set?
- if (addressbook == null) {
+ if (null == addressbook) {
// Is null?!
throw new NullPointerException(MessageFormat.format("addressbook for id={0} is null", addressbookId)); //NOI18N
}