From: Roland Haeder Date: Wed, 14 Oct 2015 08:21:52 +0000 (+0200) Subject: added named query for searching user's shares X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6ab1b9f68f77ff5144eac197c98115654c7c2b33;p=jbonuscard-lib.git added named query for searching user's shares Signed-off-by:Roland Häder --- diff --git a/src/org/mxchange/addressbook/model/addressbook/shared/AddressbookShare.java b/src/org/mxchange/addressbook/model/addressbook/shared/AddressbookShare.java index 8777d91..4e4f3ff 100644 --- a/src/org/mxchange/addressbook/model/addressbook/shared/AddressbookShare.java +++ b/src/org/mxchange/addressbook/model/addressbook/shared/AddressbookShare.java @@ -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 { /**