14294 fixed admin event expiration sql error

This commit is contained in:
Sebastian Schuster 2022-09-09 12:24:09 +02:00 committed by Hynek Mlnařík
parent 7e5b45f999
commit cc8567e9f4

View file

@ -276,7 +276,7 @@ public class JpaEventStoreProvider implements EventStoreProvider {
CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<RealmAttributeEntity> cr = cb.createQuery(RealmAttributeEntity.class); CriteriaQuery<RealmAttributeEntity> cr = cb.createQuery(RealmAttributeEntity.class);
Root<RealmAttributeEntity> root = cr.from(RealmAttributeEntity.class); Root<RealmAttributeEntity> root = cr.from(RealmAttributeEntity.class);
cr.select(root).where(cb.and(cb.equal(root.get("name"),RealmAttributes.ADMIN_EVENTS_EXPIRATION),cb.greaterThan(root.get("value"),Long.valueOf(0)))); cr.select(root).where(cb.and(cb.equal(root.get("name"),RealmAttributes.ADMIN_EVENTS_EXPIRATION),cb.greaterThan(root.get("value").as(Long.class),Long.valueOf(0))));
Map<Long, List<RealmAttributeEntity>> realms = em.createQuery(cr).getResultStream().collect(Collectors.groupingBy(attribute -> Long.valueOf(attribute.getValue()))); Map<Long, List<RealmAttributeEntity>> realms = em.createQuery(cr).getResultStream().collect(Collectors.groupingBy(attribute -> Long.valueOf(attribute.getValue())));
long current = Time.currentTimeMillis(); long current = Time.currentTimeMillis();