From: Roland Haeder Date: Mon, 12 Oct 2015 16:45:23 +0000 (+0200) Subject: re-ordered members + re-formated X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=caedd829e7965bd94cffa93887faf704c088dcd5;p=addressbook-lib.git re-ordered members + re-formated --- diff --git a/src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java b/src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java index b86baf1..819d83f 100644 --- a/src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java +++ b/src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java @@ -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 { @@ -57,6 +57,14 @@ public class UserAddressbook implements Addressbook, Comparable { */ 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 { 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 { 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 { 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.