Fixed bug introduced by sql injeciton protection.
[policy/engine.git] / ONAP-PAP-REST / src / main / java / org / onap / policy / pap / xacml / rest / daoimpl / CommonClassDaoImpl.java
index 5d2b7f6..1766cb3 100644 (file)
@@ -242,7 +242,12 @@ public class CommonClassDaoImpl implements CommonClassDao{
                try {
                        Query hbquery = session.createQuery(query);
                        for (Map.Entry<String, Object> paramPair : params.entrySet()) {
-                               hbquery.setParameter(paramPair.getKey(), paramPair.getValue());
+                               if(paramPair.getValue() instanceof java.lang.Long){
+                                       hbquery.setLong(paramPair.getKey(), (long) paramPair.getValue());
+                               }
+                               else{
+                                       hbquery.setParameter(paramPair.getKey(), paramPair.getValue());
+                               }
                        }
                        data = hbquery.list();
                        tx.commit();