From 6ab1b9f68f77ff5144eac197c98115654c7c2b33 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 14 Oct 2015 10:21:52 +0200 Subject: [PATCH] =?utf8?q?added=20named=20query=20for=20searching=20user's?= =?utf8?q?=20shares=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../model/addressbook/shared/AddressbookShare.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/org/mxchange/addressbook/model/addressbook/shared/AddressbookShare.java b/src/org/mxchange/addressbook/model/addressbook/shared/AddressbookShare.java index 8777d913..4e4f3fff 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 { /** -- 2.39.5