- used interface for target entities
- added missing annotations (as these warnings are not being fixed)
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.mxchange.jaddressbookcore.model.addressbook.status.AddressbokStatus;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.mxchange.jaddressbookcore.model.addressbook.status.AddressbokStatus;
-import org.mxchange.jusercore.model.user.LoginUser;
import org.mxchange.jusercore.model.user.User;
/**
import org.mxchange.jusercore.model.user.User;
/**
* Connection to "users" table
*/
@JoinColumn (name = "addressbook_user_id", nullable = false)
* Connection to "users" table
*/
@JoinColumn (name = "addressbook_user_id", nullable = false)
- @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
+ @OneToOne (targetEntity = User.class, cascade = CascadeType.REFRESH, optional = false)
private User addressbookUser;
/**
private User addressbookUser;
/**
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
+import org.mxchange.jaddressbookcore.model.addressbook.Addressbook;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jcontacts.contact.UserContact;
import org.mxchange.jcontactsbusiness.BusinessContact;
import org.mxchange.jcontactsbusiness.BusinessContact;
-import org.mxchange.jcontactsbusiness.CompanyContact;
-import org.mxchange.jaddressbookcore.model.addressbook.Addressbook;
-import org.mxchange.jaddressbookcore.model.addressbook.UserAddressbook;
/**
* A POJO for address book entries
/**
* A POJO for address book entries
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")
)
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")
)
+@SuppressWarnings ("PersistenceUnitPresent")
public class UserAddressbookEntry implements AddressbookEntry {
/**
public class UserAddressbookEntry implements AddressbookEntry {
/**
* Connection to table "business_contacts" (commercial contacts)
*/
@JoinColumn (name = "entry_business_contact_id", updatable = false)
* Connection to table "business_contacts" (commercial contacts)
*/
@JoinColumn (name = "entry_business_contact_id", updatable = false)
- @OneToOne (targetEntity = CompanyContact.class, cascade = CascadeType.REFRESH)
+ @OneToOne (targetEntity = BusinessContact.class, cascade = CascadeType.REFRESH)
private BusinessContact addressbookEntryBusinessContact;
/**
private BusinessContact addressbookEntryBusinessContact;
/**
* Connection to table "contacts" (private contacts)
*/
@JoinColumn (name = "entry_private_contact_id", updatable = false)
* Connection to table "contacts" (private contacts)
*/
@JoinColumn (name = "entry_private_contact_id", updatable = false)
- @OneToOne (targetEntity = UserContact.class, cascade = CascadeType.REFRESH)
+ @OneToOne (targetEntity = Contact.class, cascade = CascadeType.REFRESH)
private Contact addressbookEntryPrivateContact;
/**
* Connection to table "addressbooks"
*/
@JoinColumn (name = "entry_addressbook_id", nullable = false, updatable = false)
private Contact addressbookEntryPrivateContact;
/**
* Connection to table "addressbooks"
*/
@JoinColumn (name = "entry_addressbook_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = UserAddressbook.class, cascade = CascadeType.REFRESH, optional = false)
+ @OneToOne (targetEntity = Addressbook.class, cascade = CascadeType.REFRESH, optional = false)
private Addressbook addressbookId;
@Override
private Addressbook addressbookId;
@Override
@Override
public int hashCode () {
int hash = 3;
@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());
hash = 19 * hash + Objects.hashCode(this.getAddressbookEntryBusinessContact());
hash = 19 * hash + Objects.hashCode(this.getAddressbookEntryPrivateContact());
hash = 19 * hash + Objects.hashCode(this.getAddressbookId());
+ @SuppressWarnings ("ReturnOfDateField")
public Calendar getAddressbookEntryCreated () {
return this.addressbookEntryCreated;
}
@Override
public Calendar getAddressbookEntryCreated () {
return this.addressbookEntryCreated;
}
@Override
+ @SuppressWarnings ("AssignmentToDateFieldFromParameter")
public void setAddressbookEntryCreated (final Calendar addressbookEntryCreated) {
this.addressbookEntryCreated = addressbookEntryCreated;
}
public void setAddressbookEntryCreated (final Calendar addressbookEntryCreated) {
this.addressbookEntryCreated = addressbookEntryCreated;
}
import javax.persistence.TemporalType;
import org.mxchange.jaddressbookcore.model.addressbook.Addressbook;
import org.mxchange.jaddressbookcore.model.addressbook.UserAddressbook;
import javax.persistence.TemporalType;
import org.mxchange.jaddressbookcore.model.addressbook.Addressbook;
import org.mxchange.jaddressbookcore.model.addressbook.UserAddressbook;
-import org.mxchange.jusercore.model.user.LoginUser;
import org.mxchange.jusercore.model.user.User;
/**
import org.mxchange.jusercore.model.user.User;
/**
* User who is owning the share
*/
@JoinColumn (name = "share_owner_id", nullable = false, updatable = false)
* User who is owning the share
*/
@JoinColumn (name = "share_owner_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
+ @OneToOne (targetEntity = User.class, cascade = CascadeType.REFRESH, optional = false)
private User shareUserOwner;
/**
* User the address book is shared with
*/
@JoinColumn (name = "share_sharee_id", nullable = false, updatable = false)
private User shareUserOwner;
/**
* User the address book is shared with
*/
@JoinColumn (name = "share_sharee_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
+ @OneToOne (targetEntity = User.class, cascade = CascadeType.REFRESH, optional = false)
private User shareUserSharee;
/**
private User shareUserSharee;
/**