findTotal update
This commit is contained in:
@@ -34,11 +34,7 @@ public class ArticleRepository {
|
||||
}
|
||||
|
||||
public int findTotal() {
|
||||
return em.createNamedQuery("findAll", Article.class)
|
||||
.setFirstResult(0)
|
||||
.setMaxResults(999999999)
|
||||
.getResultList()
|
||||
.size();
|
||||
return em.createNamedQuery("findAll", Article.class).getResultList().size();
|
||||
}
|
||||
|
||||
public Optional<Article> findById(Long id) {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class UserRepository {
|
||||
int page = pageable.getPageNumber();
|
||||
int size = pageable.getPageSize();
|
||||
|
||||
return em.createNamedQuery("", User.class)
|
||||
return em.createNamedQuery("findAllUser", User.class)
|
||||
.setFirstResult(page * size)
|
||||
.setMaxResults(size)
|
||||
.getResultList();
|
||||
|
||||
Reference in New Issue
Block a user