]> git.mxchange.org Git - addressbook-lib.git/commitdiff
Only MERGE is okay
authorRoland Haeder <roland@mxchange.org>
Fri, 23 Oct 2015 16:11:07 +0000 (18:11 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 23 Oct 2015 16:11:07 +0000 (18:11 +0200)
src/org/mxchange/addressbook/model/addressbook/entry/UserAddressbookEntry.java

index c858c276bce610b7e034e85270c7efe7dbb3a8a7..d0e849f2fca8a4f0309ea1a364474b1a663ba92c 100644 (file)
@@ -62,7 +62,7 @@ public class UserAddressbookEntry implements AddressbookEntry, Comparable<Addres
         * Connection to table "business_contacts" (commercial contacts)
         */
        @JoinColumn (name = "entry_business_contact_id", updatable = false)
-       @OneToOne (targetEntity = CompanyContact.class, cascade = CascadeType.ALL)
+       @OneToOne (targetEntity = CompanyContact.class, cascade = CascadeType.MERGE)
        private BusinessContact addressbookEntryBusinessContact;
 
        /**
@@ -85,14 +85,14 @@ public class UserAddressbookEntry implements AddressbookEntry, Comparable<Addres
         * Connection to table "contacts" (private contacts)
         */
        @JoinColumn (name = "entry_private_contact_id", updatable = false)
-       @OneToOne (targetEntity = UserContact.class, cascade = CascadeType.ALL)
+       @OneToOne (targetEntity = UserContact.class, cascade = CascadeType.MERGE)
        private Contact addressbookEntryPrivateContact;
 
        /**
         * Connection to table "addressbooks"
         */
        @JoinColumn (name = "entry_addressbook_id", nullable = false, updatable = false)
-       @OneToOne (targetEntity = UserAddressbook.class, optional = false, cascade = CascadeType.ALL)
+       @OneToOne (targetEntity = UserAddressbook.class, optional = false, cascade = CascadeType.MERGE)
        private Addressbook addressbookId;
 
        @Override