String having = "having (o.licenseNumber, o.versionNumber) in (select t.licenseNumber, max(t.versionNumber) as versionNumber from GenericTAA t group by t.licenseNumber)";
return (Collections.unmodifiableList(entityManager.createQuery(
"SELECT o FROM " + IModel.DATABASE_PRE + "GenericTAA o " + having + " ORDER BY o.licenseNumber ASC").getResultList()));
} catch (Exception ex) {
throw new CustomException(ex);
}
}