@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> {
*/
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
*/
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
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
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.