Root<PermissionSetData> from = query.from(PermissionSetData.class);
query.where(cb.equal(from.get("name"), permissionSet));
query.select(from);
try {
PermissionSetData found = entityManager.createQuery(query).getSingleResult();
return found;
} catch (Exception ex) {
throw new PermissionSetNotFoundException("permissionSet " + permissionSet + " not found");
}
}