]> git.mxchange.org Git - jaddressbook-lib.git/commitdiff
re-ordered members + re-formated
authorRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 16:45:23 +0000 (18:45 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 12 Oct 2015 16:45:23 +0000 (18:45 +0200)
src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java

index b86baf1c9977e060c2adb930e89a63a235d24f4d..819d83fc64e022b7169aab5730d13a81a47a39bb 100644 (file)
@@ -47,7 +47,7 @@ import org.mxchange.jusercore.model.user.User;
 @NamedQueries (
                {
                        @NamedQuery (name = "AllUsersAddressbooks", query = "SELECT a FROM addressbooks AS a WHERE a.addressbookUser = :param ORDER BY a.addressbookId ASC"),
-                       @NamedQuery(name = "SearchUserAddressbookName", query = "SELECT a FROM addressbooks AS a WHERE a.addressbookUser = :user AND LOWER(a.addressbookName) LIKE LOWER(:name)")
+                       @NamedQuery (name = "SearchUserAddressbookName", query = "SELECT a FROM addressbooks AS a WHERE a.addressbookUser = :user AND LOWER(a.addressbookName) LIKE LOWER(:name)")
                }
 )
 public class UserAddressbook implements Addressbook, Comparable<Addressbook> {
@@ -57,6 +57,14 @@ public class UserAddressbook implements Addressbook, Comparable<Addressbook> {
         */
        private static final long serialVersionUID = 176_573_148_678_169L;
 
+       /**
+        * When this address book has been created
+        */
+       @Basic (optional = false)
+       @Temporal (value = TemporalType.TIMESTAMP)
+       @Column (name = "addressbook_created", nullable = false, updatable = false)
+       private Calendar addressbookCreated;
+
        /**
         * Id number
         */
@@ -66,19 +74,11 @@ public class UserAddressbook implements Addressbook, Comparable<Addressbook> {
        private Long addressbookId;
 
        /**
-        * Connection to "users" table
-        */
-       @JoinColumn (name = "addressbook_user_id", nullable = false)
-       @OneToOne (targetEntity = LoginUser.class, optional = false, cascade = CascadeType.ALL)
-       private User addressbookUser;
-
-       /**
-        * When this address book has been created
+        * Name for this address book
         */
        @Basic (optional = false)
-       @Temporal (TemporalType.TIMESTAMP)
-       @Column (name = "addressbook_created", nullable = false, updatable = false)
-       private Calendar addressbookCreated;
+       @Column (name = "addressbook_name", length = 50, nullable = false)
+       private String addressbookName;
 
        /**
         * Adress book status
@@ -89,17 +89,11 @@ public class UserAddressbook implements Addressbook, Comparable<Addressbook> {
        private AddressbokStatus addressbookStatus;
 
        /**
-        * Name for this address book
-        */
-       @Basic (optional = false)
-       @Column (name = "addressbook_name", length = 50, nullable = false)
-       private String addressbookName;
-
-       /**
-        * Default protected constructor
+        * Connection to "users" table
         */
-       protected UserAddressbook () {
-       }
+       @JoinColumn (name = "addressbook_user_id", nullable = false)
+       @OneToOne (targetEntity = LoginUser.class, optional = false, cascade = CascadeType.ALL)
+       private User addressbookUser;
 
        /**
         * Public constructor with address book name
@@ -114,6 +108,12 @@ public class UserAddressbook implements Addressbook, Comparable<Addressbook> {
                this.addressbookName = addressbookName;
        }
 
+       /**
+        * Default protected constructor
+        */
+       protected UserAddressbook () {
+       }
+
        @Override
        public int compareTo (final Addressbook addressbook) {
                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.