- PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar, "Caught Exception trying to check if policy exists policyQuery.getResultList()");
- throw new PersistenceException("Query failed trying to check if policy "+policyNameScopeAndVersion[0]+" exists");
- }
- if(policyQueryList.isEmpty()){
- PolicyLogger.error("Policy being added to the group does not exist with policy id "+policyNameScopeAndVersion[0]);
- throw new PersistenceException("Policy being added to the group does not exist with policy id "+policyNameScopeAndVersion[0]);
- } else if(policyQueryList.size() > 1){
- PolicyLogger.error(duplicatePolicyId+policyNameScopeAndVersion[0]+foundInDBNotDeleted);
- throw new PersistenceException(duplicateGroupId+policyNameScopeAndVersion[0]+foundInDBNotDeleted);
+ PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, policyDBDaoVar,
+ "Caught Exception trying to check if policy exists policyQuery.getResultList()");
+ throw new PersistenceException(
+ "Query failed trying to check if policy " + policyNameScopeAndVersion[0] + " exists");
+ }
+ if (policyQueryList.isEmpty()) {
+ PolicyLogger.error("Policy being added to the group does not exist with policy id "
+ + policyNameScopeAndVersion[0]);
+ throw new PersistenceException("Policy being added to the group does not exist with policy id "
+ + policyNameScopeAndVersion[0]);
+ } else if (policyQueryList.size() > 1) {
+ PolicyLogger.error(duplicatePolicyId + policyNameScopeAndVersion[0] + foundInDBNotDeleted);
+ throw new PersistenceException(
+ duplicateGroupId + policyNameScopeAndVersion[0] + foundInDBNotDeleted);