HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2016-05-13 f934cd3984a995665f289d1465beee55abf44124
limit list of queue jobs to the latest 500 entries
2 files modified
9 ■■■■ changed files
hsarback/src/de/hsadmin/core/model/AbstractModuleImpl.java 7 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/qstat/QTaskModuleImpl.java 2 ●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/model/AbstractModuleImpl.java
@@ -92,6 +92,10 @@
    }
    public List<AbstractEntity> search(Class<? extends AbstractEntity> entityClass, String condition, String orderBy) throws HSAdminException {
        return search(entityClass, condition, orderBy, -1);
    }
    public List<AbstractEntity> search(Class<? extends AbstractEntity> entityClass, String condition, String orderBy, int limit) throws HSAdminException {
        UnixUser loginUser = transaction.getLoginUser();
        condition = restrict(entityClass, loginUser, condition);
        Entity entityAnnot = entityClass.getAnnotation(Entity.class);
@@ -109,6 +113,9 @@
        EntityManager entityManager = transaction.getEntityManager();
        entityManager.clear();
        Query query = entityManager.createQuery(queryString);
        if (limit > 0) {
            query.setMaxResults(limit);
        }
        setQueryParameter(query, queryString, "loginUser", loginUser);
        setQueryParameter(query, queryString, "loginUserName", loginUser.getName());
        setQueryParameter(query, queryString, "loginUserPac", loginUser.getPac());
hsarback/src/de/hsadmin/mods/qstat/QTaskModuleImpl.java
@@ -16,7 +16,7 @@
        if (orderBy == null || orderBy.length() == 0) {
            orderBy = "ORDER BY obj.started DESC";
        }
        return super.search(entityClass, condition, orderBy);
        return super.search(entityClass, condition, orderBy, 500);
    }
}