Query q = em
.createQuery("select r from ChildProcessPIDDAO r where r.parent = :parent and r.seq = (select max(rr.seq) from ChildProcessPIDDAO rr where rr.parent = :parent)");
q.setParameter("parent", parent.toString());
try {
ChildProcessPIDDAO r = (ChildProcessPIDDAO) q.getSingleResult();
return UUID.fromString(r.child);
} catch (NoResultException nre) {
return null;
}
}