]> git.mxchange.org Git - addressbook-lib.git/commitdiff
added named query for searching user's shares
authorRoland Haeder <roland@mxchange.org>
Wed, 14 Oct 2015 08:21:52 +0000 (10:21 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 14 Oct 2015 08:21:52 +0000 (10:21 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/addressbook/model/addressbook/shared/AddressbookShare.java

index 8777d9135b58fd9012122998cfab858a94385e03..4e4f3fffade0dba318d01349dd4f4d8008bff441 100644 (file)
@@ -24,6 +24,8 @@ import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
 import org.mxchange.addressbook.model.addressbook.Addressbook;
@@ -38,6 +40,9 @@ import org.mxchange.jusercore.model.user.User;
  */
 @Entity (name = "addressbook_shares")
 @Table (name = "addressbook_shares")
+@NamedQueries (
+               @NamedQuery (name = "SearchUserSharedAddressbooks", query = "SELECT s FROM addressbook_shares AS s WHERE s.shareUserOwner = :user ORDER BY s.shareId ASC")
+)
 public class AddressbookShare implements ShareableAddressbook, Comparable<ShareableAddressbook> {
 
        /**