diff options
author | liamfallon <liam.fallon@est.tech> | 2019-11-15 13:35:42 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2019-11-15 15:23:42 +0000 |
commit | d4e3a1b394715c6386f963130e4e081d421ecd1b (patch) | |
tree | 1ef224fb04c4d5e93f02f33ef38994b04e52bdf6 /POLICY-SDK-APP/src/main/java/org/onap/policy/daoImp/SystemLogDbDaoImpl.java | |
parent | d79badf67d5c253eb9883ac823626d7efa16c731 (diff) |
Unit/SONAR/Checkstyle in ONAP-REST
Fifth and final batch of JPA pojos (Q-Z), with JUnit added and
SONAR/Checkstyle issues addressed. In cases where a class name change
caused an update in another package, the license header on files for
those knock on changes are not updated.
Issue-ID: POLICY-2131
Change-Id: I1cc536a5b8a0cd3c6beff068dd72381f7ae10d12
Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'POLICY-SDK-APP/src/main/java/org/onap/policy/daoImp/SystemLogDbDaoImpl.java')
-rw-r--r-- | POLICY-SDK-APP/src/main/java/org/onap/policy/daoImp/SystemLogDbDaoImpl.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/daoImp/SystemLogDbDaoImpl.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/daoImp/SystemLogDbDaoImpl.java index 768a7a41c..46aed213f 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/daoImp/SystemLogDbDaoImpl.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/daoImp/SystemLogDbDaoImpl.java @@ -31,7 +31,7 @@ import org.onap.policy.common.logging.flexlogger.Logger; import org.onap.policy.conf.HibernateSession; import org.onap.policy.controller.PolicyController; import org.onap.policy.dao.SystemLogDbDao; -import org.onap.policy.rest.jpa.SystemLogDB; +import org.onap.policy.rest.jpa.SystemLogDb; import org.onap.policy.xacml.api.XACMLErrorConstants; import org.springframework.stereotype.Service; @@ -41,10 +41,10 @@ public class SystemLogDbDaoImpl implements SystemLogDbDao { @SuppressWarnings("unchecked") @Override - public List<SystemLogDB> getLoggingData() { + public List<SystemLogDb> getLoggingData() { Session session = HibernateSession.getSession(); Transaction tx = session.beginTransaction(); - List<SystemLogDB> system = null; + List<SystemLogDb> system = null; try { String sqlWhere = null; if (PolicyController.isjUnit()) { @@ -53,12 +53,12 @@ public class SystemLogDbDaoImpl implements SystemLogDbDao { sqlWhere = "date > DATE_SUB(curdate(), INTERVAL 5 DAY) ORDER BY date DESC limit " + PolicyController.getLogTableLimit() + ""; } - Criteria cr = session.createCriteria(SystemLogDB.class); + Criteria cr = session.createCriteria(SystemLogDb.class); cr.add(Restrictions.sqlRestriction(sqlWhere)); system = cr.list(); tx.commit(); } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDB Table" + e); + logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDb Table" + e); } finally { try { session.close(); @@ -71,10 +71,10 @@ public class SystemLogDbDaoImpl implements SystemLogDbDao { @SuppressWarnings("unchecked") @Override - public List<SystemLogDB> getSystemAlertData() { + public List<SystemLogDb> getSystemAlertData() { Session session = HibernateSession.getSession(); Transaction tx = session.beginTransaction(); - List<SystemLogDB> system = null; + List<SystemLogDb> system = null; try { String sqlWhere = null; if (PolicyController.isjUnit()) { @@ -83,12 +83,12 @@ public class SystemLogDbDaoImpl implements SystemLogDbDao { sqlWhere = "date > DATE_SUB(curdate(), INTERVAL 5 DAY) and logtype = 'error' ORDER BY date DESC limit " + PolicyController.getSystemAlertTableLimit() + ""; } - Criteria cr = session.createCriteria(SystemLogDB.class); + Criteria cr = session.createCriteria(SystemLogDb.class); cr.add(Restrictions.sqlRestriction(sqlWhere)); system = cr.list(); tx.commit(); } catch (Exception e) { - logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDB Table" + e); + logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDb Table" + e); } finally { try { session.close(); |