Gateway gatewayModel = em.find(Gateway.class, gateway.getGatewayName());
generator.setParameter("users", users);
generator.setParameter("gateway", gatewayModel);
// generator.setParameter(ProjectConstants.USERNAME, getUser());
// generator.setParameter(ProjectConstants.GATEWAY_NAME, gateway.getGatewayName());
q = generator.selectQuery(em);
for (Object o : q.getResultList()) {
Project project = (Project) o;
ProjectResource projectResource = (ProjectResource)Utils.getResource(ResourceType.PROJECT, project);
result.add(projectResource);
}