@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")
+ {
+ @NamedQuery (
+ name = "SearchUserSharedAddressbooks",
+ query = "SELECT s FROM addressbook_shares AS s WHERE s.shareUserOwner = :user ORDER BY s.shareId ASC"
+ ),
+ @NamedQuery (
+ name = "SearchShareeAddressbookShare",
+ query = "SELECT s FROM addressbook_shares AS s WHERE s.shareAddressbook = :addressbook AND s.shareUserSharee = :sharee"
+ )
+ }
)
public class AddressbookShare implements ShareableAddressbook, Comparable<ShareableAddressbook> {