From 878edb992c60a68539dfd6f7daa0ccb6f6c06fd1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 3 Aug 2016 09:30:44 +0200 Subject: [PATCH] added named query for user's history entries, sorted by primary key ("unlimited") --- .../model/user/password_history/UserPasswordHistory.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/org/mxchange/jusercore/model/user/password_history/UserPasswordHistory.java b/src/org/mxchange/jusercore/model/user/password_history/UserPasswordHistory.java index a2e714b..60994af 100644 --- a/src/org/mxchange/jusercore/model/user/password_history/UserPasswordHistory.java +++ b/src/org/mxchange/jusercore/model/user/password_history/UserPasswordHistory.java @@ -26,6 +26,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 javax.persistence.Temporal; @@ -43,6 +45,11 @@ import org.mxchange.jusercore.model.user.User; @Table ( name = "user_password_history" ) +@NamedQueries ( + { + @NamedQuery (name = "AllUsersHistoryEntries", query = "SELECT h FROM user_password_history AS h WHERE h.userPasswordHistoryUser = :user ORDER BY h.userPasswordHistoryId ASC") + } +) @SuppressWarnings ("PersistenceUnitPresent") public class UserPasswordHistory implements PasswordHistory { -- 2.39.5