* Connection to "users" table
*/
@JoinColumn (name = "addressbook_user_id", nullable = false)
- @OneToOne (targetEntity = LoginUser.class, optional = false, cascade = CascadeType.MERGE)
+ @OneToOne (targetEntity = LoginUser.class, optional = false, cascade = CascadeType.REFRESH)
private User addressbookUser;
/**
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
-import org.mxchange.jjobs.model.addressbook.Addressbook;
-import org.mxchange.jjobs.model.addressbook.UserAddressbook;
import org.mxchange.jcontacts.contact.Contact;
import org.mxchange.jcontacts.contact.UserContact;
import org.mxchange.jcontactsbusiness.BusinessContact;
import org.mxchange.jcontactsbusiness.CompanyContact;
+import org.mxchange.jjobs.model.addressbook.Addressbook;
+import org.mxchange.jjobs.model.addressbook.UserAddressbook;
/**
* A POJO for address book entries
* Connection to table "business_contacts" (commercial contacts)
*/
@JoinColumn (name = "entry_business_contact_id", updatable = false)
- @OneToOne (targetEntity = CompanyContact.class, cascade = CascadeType.MERGE)
+ @OneToOne (targetEntity = CompanyContact.class, cascade = CascadeType.REFRESH)
private BusinessContact addressbookEntryBusinessContact;
/**
* Connection to table "contacts" (private contacts)
*/
@JoinColumn (name = "entry_private_contact_id", updatable = false)
- @OneToOne (targetEntity = UserContact.class, cascade = CascadeType.MERGE)
+ @OneToOne (targetEntity = UserContact.class, cascade = CascadeType.REFRESH)
private Contact addressbookEntryPrivateContact;
/**
* Connection to table "addressbooks"
*/
@JoinColumn (name = "entry_addressbook_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = UserAddressbook.class, optional = false, cascade = CascadeType.MERGE)
+ @OneToOne (targetEntity = UserAddressbook.class, optional = false, cascade = CascadeType.REFRESH)
private Addressbook addressbookId;
@Override
* Address book this share is for
*/
@JoinColumn (name = "share_addressbook_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = UserAddressbook.class, cascade = CascadeType.MERGE, optional = false)
+ @OneToOne (targetEntity = UserAddressbook.class, cascade = CascadeType.REFRESH, optional = false)
private Addressbook shareAddressbook;
/**
* User who is owning the share
*/
@JoinColumn (name = "share_owner_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.MERGE, optional = false)
+ @OneToOne (targetEntity = LoginUser.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)
- @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.MERGE, optional = false)
+ @OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
private User shareUserSharee;
/**