import org.mxchange.addressbook.model.addressbook.Addressbook;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jcontactsbusiness.BusinessContact;
-import org.mxchange.jusercore.model.user.User;
/**
* A POJI for addressbook entries
*/
void setAddressbookEntryPrivateContact (final Contact addressbookEntryPrivateContact);
- /**
- * Getter for user who has added this entry to his/her addressbook
- * <p>
- * @return User who has added this entry
- */
- User getAddressbookEntryUserSharer ();
-
- /**
- * Setter for user who has added this entry to his/her addressbook
- * <p>
- * @param addressbookEntryUserAdded User who has added this entry
- */
- void setAddressbookEntryUserSharer (final User addressbookEntryUserAdded);
-
- /**
- * Getter for user who has initially created the address book entry
- * <p>
- * @return User who has created initially this address book entry
- */
- User getAddressbookEntryUserOwner ();
-
- /**
- * Setter for user who has initially created the address book entry
- * <p>
- * @param addressbookEntryUserOrigin User who has created initially this
- * address book entry
- */
- void setAddressbookEntryUserOwner (final User addressbookEntryUserOrigin);
-
/**
* Getter for address book
* <p>
import org.mxchange.jcontacts.contact.UserContact;
import org.mxchange.jcontactsbusiness.BusinessContact;
import org.mxchange.jcontactsbusiness.CompanyContact;
-import org.mxchange.jusercore.model.user.LoginUser;
-import org.mxchange.jusercore.model.user.User;
/**
* A POJO for address book entries
@OneToOne (targetEntity = UserContact.class, cascade = CascadeType.ALL)
private Contact addressbookEntryPrivateContact;
- /**
- * Connection to table "users" (who has initially created this entry
- */
- @JoinColumn (name = "entry_owner_user_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = LoginUser.class, optional = false, cascade = CascadeType.ALL)
- private User addressbookEntryUserOwner;
-
- /**
- * Connection to table "users" (who has added this entry)
- */
- @JoinColumn (name = "entry_sharer_user_id", updatable = false)
- @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.ALL)
- private User addressbookEntryUserSharer;
-
/**
* Connection to table "addressbooks"
*/
- @JoinColumn (name = "addressbook_id", nullable = false, updatable = false)
+ @JoinColumn (name = "entry_addressbook_id", nullable = false, updatable = false)
@OneToOne (targetEntity = UserAddressbook.class, optional = false, cascade = CascadeType.ALL)
private Addressbook addressbookId;
return false;
} else if (!Objects.equals(this.getAddressbookEntryPrivateContact(), other.getAddressbookEntryPrivateContact())) {
return false;
- } else if (!Objects.equals(this.getAddressbookEntryUserOwner(), other.getAddressbookEntryUserOwner())) {
- return false;
- } else if (!Objects.equals(this.getAddressbookEntryUserSharer(), other.getAddressbookEntryUserSharer())) {
- return false;
} else if (!Objects.equals(this.getAddressbookId(), other.getAddressbookId())) {
return false;
}
this.addressbookEntryPrivateContact = addressbookEntryPrivateContact;
}
- @Override
- public User getAddressbookEntryUserSharer () {
- return this.addressbookEntryUserSharer;
- }
-
- @Override
- public void setAddressbookEntryUserSharer (final User addressbookEntryUserSharer) {
- this.addressbookEntryUserSharer = addressbookEntryUserSharer;
- }
-
- @Override
- public User getAddressbookEntryUserOwner () {
- return this.addressbookEntryUserOwner;
- }
-
- @Override
- public void setAddressbookEntryUserOwner (final User addressbookEntryUserOwner) {
- this.addressbookEntryUserOwner = addressbookEntryUserOwner;
- }
-
@Override
public Addressbook getAddressbookId () {
return this.addressbookId;
int hash = 3;
hash = 19 * hash + Objects.hashCode(this.getAddressbookEntryBusinessContact());
hash = 19 * hash + Objects.hashCode(this.getAddressbookEntryPrivateContact());
- hash = 19 * hash + Objects.hashCode(this.getAddressbookEntryUserOwner());
- hash = 19 * hash + Objects.hashCode(this.getAddressbookEntryUserSharer());
hash = 19 * hash + Objects.hashCode(this.getAddressbookId());
return hash;
}