]> git.mxchange.org Git - jjobs-lib.git/commitdiff
Some cascade/fetch cleanups:
authorRoland Haeder <roland@mxchange.org>
Fri, 11 Mar 2016 21:02:57 +0000 (22:02 +0100)
committerRoland Haeder <roland@mxchange.org>
Fri, 11 Mar 2016 22:11:42 +0000 (23:11 +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/jjobs/events/sharing/type/SharingType.java
src/org/mxchange/jjobs/model/addressbook/UserAddressbook.java
src/org/mxchange/jjobs/model/addressbook/entry/UserAddressbookEntry.java
src/org/mxchange/jjobs/model/addressbook/shared/AddressbookShare.java
src/org/mxchange/jjobs/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 3231505f7ec42e22256d5b99e322e79742ca96e2..40d4db38eca8cabf219c7eb731d8f95cdcee47dc 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jjobs.events.sharing.type;
 
 /**
- * An enum for sharing types
+ * An enumeration for sharing types
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
index 44c6aaa3b4db6caf9cb7f2810a13fb61457e0435..274cb9a13fdc7ffe71193b81f903318787f35a73 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 945eed4646afdfbe6c13578d2a767c31fa1eb210..576846229affeb537863251d8c94bb7368c869e6 100644 (file)
@@ -32,12 +32,12 @@ import javax.persistence.OneToOne;
 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
@@ -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 76eb8385d51a676d4a99f2d46ecc0c5338b418f7..e9ca3096cc2fc48de3d0319da65734a94d0fd219 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 5ac19034996e10f3f19ec597f08f6e4f20050dec..4fa2c362d1bdface56ce59cf299182d5b200850a 100644 (file)
@@ -19,7 +19,7 @@ package org.mxchange.jjobs.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>
  */