]> git.mxchange.org Git - addressbook-lib.git/commitdiff
fixed query for new design + renamed it
authorRoland Haeder <roland@mxchange.org>
Wed, 21 Oct 2015 10:27:50 +0000 (12:27 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 21 Oct 2015 10:27:50 +0000 (12:27 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/addressbook/model/addressbook/entry/UserAddressbookEntry.java

index 3b73258b057f9e5d4ff32e046c7a6c2fe65038ed..c858c276bce610b7e034e85270c7efe7dbb3a8a7 100644 (file)
@@ -48,8 +48,8 @@ import org.mxchange.jcontactsbusiness.CompanyContact;
 @Table (name = "addressbook_entries")
 @NamedQueries (
                @NamedQuery (
-                               name = "AllAddressbookEntries",
-                               query = "SELECT e FROM addressbook_entries AS e WHERE e.addressbookId = :addressbook AND (e.addressbookEntryUserOwner = :owner OR e.addressbookEntryUserSharer = :sharer) ORDER BY e.addressbookEntryId ASC")
+                               name = "SearchUsersAddressbookEntries",
+                               query = "SELECT e FROM addressbook_entries AS e INNER JOIN addressbooks AS a ON e.addressbookId = a.addressbookId WHERE e.addressbookId = :addressbook AND a.addressbookUser = :owner ORDER BY e.addressbookEntryId ASC")
 )
 public class UserAddressbookEntry implements AddressbookEntry, Comparable<AddressbookEntry> {