Skip to content

Commit 33a80a5

Browse files
authored
Modified GenericDaoJpa.java to sort readAll by id (#2203)
2 parents 02d24bb + 012aa34 commit 33a80a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/ai/elimu/dao/jpa/GenericDaoJpa.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public T read(Long id) throws DataAccessException {
3535
public List<T> readAll() throws DataAccessException {
3636
Class<?> entityClass = getEntityClass();
3737
return (List<T>) em.createQuery("SELECT c " +
38-
"FROM " + entityClass.getSimpleName() + " c",
39-
entityClass)
40-
.getResultList();
38+
"FROM " + entityClass.getSimpleName() + " c ORDER BY c.id",
39+
entityClass)
40+
.getResultList();
4141
}
4242

4343
@Override

0 commit comments

Comments
 (0)