- //Get PolicyEntity from DB;
- EntityManager em = XACMLPapServlet.getEmf().createEntityManager();
- Query createPolicyQuery =
- em.createQuery("SELECT p FROM PolicyEntity p WHERE p.scope=:scope AND p.policyName=:policyName");
- createPolicyQuery.setParameter("scope", policyScope);
- createPolicyQuery.setParameter(policyNames, policyName.substring(policyScope.length() + 1));
- List<?> createPolicyQueryList = createPolicyQuery.getResultList();
+ // Get PolicyEntity from DB;
+ String createPolicyQuery = "SELECT p FROM PolicyEntity p WHERE p.scope=:scope AND p.policyName=:policyName";
+ SimpleBindings params = new SimpleBindings();
+ params.put("scope", policyScope);
+ params.put(policyNames, policyName.substring(policyScope.length() + 1));
+ List<?> createPolicyQueryList = commonClassDao.getDataByQuery(createPolicyQuery, params);
+ LOGGER.info("addPolicyToGroup:Total execution time to retrieve " + policyNames + " from PolicyEntity");
+