]> git.mxchange.org Git - jaddressbook-lib.git/commitdiff
added named query for data retrieval by id number
authorRoland Haeder <roland@mxchange.org>
Tue, 13 Oct 2015 10:30:41 +0000 (12:30 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 13 Oct 2015 10:30:41 +0000 (12:30 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/addressbook/model/addressbook/UserAddressbook.java

index 819d83fc64e022b7169aab5730d13a81a47a39bb..95496f104b0b7703657ea7d0b62f135e9a9ea019 100644 (file)
@@ -47,7 +47,8 @@ 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)"),
+                       @NamedQuery (name = "FindAddressbookById", query = "SELECT a FROM addressbooks AS a WHERE a.addressbookId = :id")
                }
 )
 public class UserAddressbook implements Addressbook, Comparable<Addressbook> {