Code Review
/
policy
/
engine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Refactor to provide Common Policy Validation
[policy/engine.git]
/
POLICY-SDK-APP
/
src
/
main
/
java
/
org
/
onap
/
policy
/
daoImp
/
CommonClassDaoImpl.java
diff --git
a/POLICY-SDK-APP/src/main/java/org/onap/policy/daoImp/CommonClassDaoImpl.java
b/POLICY-SDK-APP/src/main/java/org/onap/policy/daoImp/CommonClassDaoImpl.java
index
946f90a
..
81db14c
100644
(file)
--- a/
POLICY-SDK-APP/src/main/java/org/onap/policy/daoImp/CommonClassDaoImpl.java
+++ b/
POLICY-SDK-APP/src/main/java/org/onap/policy/daoImp/CommonClassDaoImpl.java
@@
-42,9
+42,12
@@
import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.PolicyRoles;
import org.onap.policy.xacml.api.XACMLErrorConstants;
import org.springframework.beans.factory.annotation.Autowired;
import org.onap.policy.rest.jpa.PolicyRoles;
import org.onap.policy.xacml.api.XACMLErrorConstants;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Primary;
+import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@Service("CommonClassDao")
import org.springframework.stereotype.Service;
@Service("CommonClassDao")
+@Primary
public class CommonClassDaoImpl implements CommonClassDao{
private static final Logger LOGGER = FlexLogger.getLogger(CommonClassDaoImpl.class);
public class CommonClassDaoImpl implements CommonClassDao{
private static final Logger LOGGER = FlexLogger.getLogger(CommonClassDaoImpl.class);
@@
-268,7
+271,12
@@
public class CommonClassDaoImpl implements CommonClassDao{
try {
Query hbquery = session.createQuery(query);
for (Map.Entry<String, Object> paramPair : params.entrySet()) {
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();
}
data = hbquery.list();
tx.commit();