]> git.mxchange.org Git - juser-activity-core.git/commitdiff
added named query for user's history entries, sorted by primary key ("unlimited")
authorRoland Häder <roland@mxchange.org>
Wed, 3 Aug 2016 07:30:44 +0000 (09:30 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 3 Aug 2016 07:30:44 +0000 (09:30 +0200)
src/org/mxchange/jusercore/model/user/password_history/UserPasswordHistory.java

index a2e714b16e674261a900992badb38317000e61cd..60994afc97bbd6e3209d527cff1377c5a4558465 100644 (file)
@@ -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 {