Commit 5acad629 authored by michael.simon's avatar michael.simon
Browse files

New Registry Status DEPROVISIONED

parent 7dd6da5c
......@@ -90,10 +90,10 @@ public class JpaRegistryDao extends JpaBaseDao<RegistryEntity, Long> implements
@SuppressWarnings("unchecked")
@Override
public List<RegistryEntity> findRegistriesForDepro(String serviceShortName) {
return em.createQuery("select r from RegistryEntity r where r.service.shortName = :ssn and r.registryStatus = :status and "
return em.createQuery("select r from RegistryEntity r where r.service.shortName = :ssn and r.registryStatus = :status and r.registryStatus != :statusNot and "
+ "r.agreedTime = (select max(r1.agreedTime) from RegistryEntity r1 where r1.user = r.user) and not exists "
+ "(select r2 from RegistryEntity r2 where r2.user = r.user and r2.agreedTime > r.agreedTime)")
.setParameter("ssn", serviceShortName).setParameter("status", RegistryStatus.DELETED)
.setParameter("ssn", serviceShortName).setParameter("status", RegistryStatus.DELETED).setParameter("statusNot", RegistryStatus.DEPROVISIONED)
.getResultList();
}
......
......@@ -17,6 +17,7 @@ public enum RegistryStatus {
PENDING,
CREATED,
DELETED,
DEPROVISIONED,
INVALID,
ON_HOLD,
LOST_ACCESS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment