]> git.mxchange.org Git - jbonuscard-lib.git/commitdiff
Some cascade/fetch cleanups:
authorRoland Haeder <roland@mxchange.org>
Fri, 11 Mar 2016 21:02:02 +0000 (22:02 +0100)
committerRoland Haeder <roland@mxchange.org>
Fri, 11 Mar 2016 22:07:45 +0000 (23:07 +0100)
- CascadeType.MERGE is basicly an UPDATE statement, it needs to be REFRESH (from database to local entity object)
- Fetch strategy EAGER is default, no need to specify it
- updated jar(s)

lib/juser-core.jar
lib/juser-lib.jar
src/org/mxchange/addressbook/events/sharing/type/SharingType.java
src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java
src/org/mxchange/addressbook/model/addressbook/entry/UserAddressbookEntry.java
src/org/mxchange/addressbook/model/addressbook/shared/AddressbookShare.java
src/org/mxchange/addressbook/model/addressbook/status/AddressbokStatus.java

index 22b1352719e70921cb178edbaf2f44438454ab4e..7dad4a093ec73a3f597125d3068b39e293fae567 100644 (file)
Binary files a/lib/juser-core.jar and b/lib/juser-core.jar differ
index 985516ffe2939cd31bb9248be244e20ccb985be7..f637271c38803627467b683fb564c07db7c11532 100644 (file)
Binary files a/lib/juser-lib.jar and b/lib/juser-lib.jar differ
index 8ac9c11280e30e6ec60231f8cb3bfa807cf8bdeb..c924ae47920a805ff0756de3904d1fea2d93fd88 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.addressbook.events.sharing.type;
 
 /**
- * An enum for sharing types
+ * An enumeration for sharing types
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
index b6e87dcf9bf29223da34c71d6dc31a8b736820d6..7ff7cba5e1f2cbfd2029a8d71b7645968d5b9171 100644 (file)
@@ -109,7 +109,7 @@ public class UserAddressbook implements Addressbook, Comparable<Addressbook> {
         * 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;
 
        /**
index c65aead39851f477c65e4e74ef486f2667504aa1..d5ad0545d62cc2a5d96d154db7d9769f8399b4b9 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.MERGE)
+       @OneToOne (targetEntity = CompanyContact.class, cascade = CascadeType.REFRESH)
        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.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
index d3f9166a28fe24b622ea4fc055118ff15fa96e99..4373faebb2fc6181ecba775a975ca5f5f5f17487 100644 (file)
@@ -69,7 +69,7 @@ public class AddressbookShare implements ShareableAddressbook, Comparable<Sharea
         * 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;
 
        /**
@@ -92,14 +92,14 @@ public class AddressbookShare implements ShareableAddressbook, Comparable<Sharea
         * 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;
 
        /**
index 5aab34e62020c2d70af105a4331b588831dbff8b..b53491fc138eacb03b5ddc43dd908a4839306cf0 100644 (file)
@@ -19,7 +19,7 @@ package org.mxchange.addressbook.model.addressbook.status;
 import java.io.Serializable;
 
 /**
- * An enum for the addressbook status
+ * An enumeration for the addressbook status
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */