From: Roland Häder Date: Wed, 3 Aug 2016 07:30:44 +0000 (+0200) Subject: added named query for user's history entries, sorted by primary key ("unlimited") X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=878edb992c60a68539dfd6f7daa0ccb6f6c06fd1;p=juser-login-core.git added named query for user's history entries, sorted by primary key ("unlimited") --- 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 {