Fixed bug introduced by sql injeciton protection.
[policy/engine.git] / POLICY-SDK-APP / src / main / java / org / onap / policy / daoImp / CommonClassDaoImpl.java
index 946f90a..c8ed3a0 100644 (file)
@@ -268,7 +268,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();