From 8cd208ebaa33627daf05d8ffff7b28e53a7067d0 Mon Sep 17 00:00:00 2001 From: "Christopher Lott (cl778h)" Date: Thu, 7 Sep 2017 08:52:41 -0400 Subject: Adjust code for Sonar issues Made non-functional updates to address static code analysis issues. Update license header with simple double-quote characters. Issue: PORTAL-72, PORTAL-90 Change-Id: Ic2c330daea07d721f0e6b350ebf03da97073f7ce Signed-off-by: Christopher Lott (cl778h) --- .../portalsdk/core/service/DataAccessService.java | 111 ++++++++++++--------- 1 file changed, 65 insertions(+), 46 deletions(-) (limited to 'ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/DataAccessService.java') diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/DataAccessService.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/DataAccessService.java index 737d6a6f..8eacefa9 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/DataAccessService.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/DataAccessService.java @@ -6,7 +6,7 @@ * =================================================================== * * Unless otherwise specified, all software contained herein is licensed - * under the Apache License, Version 2.0 (the “License”); + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * @@ -19,7 +19,7 @@ * limitations under the License. * * Unless otherwise specified, all documentation contained herein is licensed - * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * @@ -37,9 +37,7 @@ */ package org.onap.portalsdk.core.service; - import java.io.Serializable; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -52,47 +50,68 @@ import org.onap.portalsdk.core.domain.support.DomainVo; @SuppressWarnings("rawtypes") public interface DataAccessService { - // generic view, save, delete methods - DomainVo getDomainObject(Class domainClass, Serializable id, HashMap additionalParams); - void deleteDomainObject(DomainVo domainObject, HashMap additionalParams); - void deleteDomainObjects(Class domainClass, String whereClause, HashMap additionalParams); - void saveDomainObject(DomainVo domainObject, HashMap additionalParams); - - // generic get list method(s) - List getList(Class domainClass, HashMap additionalParams); - List getList(Class domainClass, String filter, String orderBy, HashMap additionalParams); - List getList(Class domainClass, String filter, int fromIndex, int toIndex, String orderBy, HashMap additionalParams); - List getList(Class domainClass, ProjectionList projectionsList , List restrictionsList , List orderByList); - public List getList(Class domainClass, ProjectionList projectionsList, List restrictionsList, List orderByList,HashMap fetchModeMap); - - List getLookupList(String dbTable, String dbValueCol, String dbLabelCol, String dbFilter, String dbOrderBy, HashMap additionalParams); - - // generic native-SQL execution methods - List executeSQLQuery(String sql, Class domainClass, HashMap additionalParams); - List executeSQLQuery(String sql, Class domainClass, Integer fromIndex, Integer toIndex,HashMap additionalParams); - - // generic HQL execution methods - List executeQuery(String hql, HashMap additionalParams); - List executeQuery(String hql, Integer fromIndex, Integer toIndex, HashMap additionalParams); - - // generic named query execution methods - List executeNamedQuery(String queryName, Integer fromIndex, Integer toIndex, HashMap additionalParams); - List executeNamedQuery(String queryName, Map params, HashMap additionalParams); - List executeNamedQuery(String queryName, Map params, Integer fromIndex, Integer toIndex, HashMap additionalParams); - - //with Where Clause for RAPTOR ZK - List executeNamedQueryWithOrderBy(Class entity, String queryName, Map params, String _orderBy, boolean asc, Integer fromIndex, Integer toIndex, HashMap additionalParams); - List executeNamedCountQuery(Class entity, String queryName, String whereClause, Map params); - List executeNamedQuery(Class entity, String queryName, String whereClause, Map params, Integer fromIndex, Integer toIndex, HashMap additionalParams); - List executeNamedQueryWithOrderBy(Class entity, String queryName, String whereClause, Map params, String _orderBy, boolean asc, Integer fromIndex, Integer toIndex, HashMap additionalParams); - - // generic update query execution method - int executeUpdateQuery(String sql, HashMap additionalParams) throws RuntimeException; - - // generic named update query execution method - int executeNamedUpdateQuery(String queryName, Map params, HashMap additionalParams) throws RuntimeException; - - // synchronizes the local updates with the database (and vice versa) - void synchronize(HashMap additionalParams); + // generic view, save, delete methods + DomainVo getDomainObject(Class domainClass, Serializable id, Map additionalParams); + + void deleteDomainObject(DomainVo domainObject, Map additionalParams); + + void deleteDomainObjects(Class domainClass, String whereClause, Map additionalParams); + + void saveDomainObject(DomainVo domainObject, Map additionalParams); + + // generic get list method(s) + List getList(Class domainClass, Map additionalParams); + + List getList(Class domainClass, String filter, String orderBy, Map additionalParams); + + List getList(Class domainClass, String filter, int fromIndex, int toIndex, String orderBy, + Map additionalParams); + + List getList(Class domainClass, ProjectionList projectionsList, List restrictionsList, + List orderByList); + + public List getList(Class domainClass, ProjectionList projectionsList, List restrictionsList, + List orderByList, Map fetchModeMap); + + List getLookupList(String dbTable, String dbValueCol, String dbLabelCol, String dbFilter, String dbOrderBy, + Map additionalParams); + + // generic native-SQL execution methods + List executeSQLQuery(String sql, Class domainClass, Map additionalParams); + + List executeSQLQuery(String sql, Class domainClass, Integer fromIndex, Integer toIndex, Map additionalParams); + + // generic HQL execution methods + List executeQuery(String hql, Map additionalParams); + + List executeQuery(String hql, Integer fromIndex, Integer toIndex, Map additionalParams); + + // generic named query execution methods + List executeNamedQuery(String queryName, Integer fromIndex, Integer toIndex, Map additionalParams); + + List executeNamedQuery(String queryName, Map params, Map additionalParams); + + List executeNamedQuery(String queryName, Map params, Integer fromIndex, Integer toIndex, Map additionalParams); + + // with Where Clause for RAPTOR ZK + List executeNamedQueryWithOrderBy(Class entity, String queryName, Map params, String orderBy, boolean asc, + Integer fromIndex, Integer toIndex, Map additionalParams); + + List executeNamedCountQuery(Class entity, String queryName, String whereClause, Map params); + + List executeNamedQuery(Class entity, String queryName, String whereClause, Map params, Integer fromIndex, + Integer toIndex, Map additionalParams); + + List executeNamedQueryWithOrderBy(Class entity, String queryName, String whereClause, Map params, String orderBy, + boolean asc, Integer fromIndex, Integer toIndex, Map additionalParams); + + // generic update query execution method + int executeUpdateQuery(String sql, Map additionalParams); + + // generic named update query execution method + int executeNamedUpdateQuery(String queryName, Map params, Map additionalParams); + + // synchronizes the local updates with the database (and vice versa) + void synchronize(Map additionalParams); } -- cgit 1.2.3-korg