summaryrefslogtreecommitdiffstats
path: root/vnfmarket-be
diff options
context:
space:
mode:
authorMurali Mohan Murthy Potham <murali.p@huawei.com>2017-09-19 12:59:38 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-19 12:59:38 +0000
commit43148fa4eba15d92623455379e06beba46d9c4e1 (patch)
tree0b9cf3e36c07d7bfd3f99f2b9a64ad29f80b7f2a /vnfmarket-be
parent240814f40a3e9253716b8eca1efb86a1e5392fb9 (diff)
parent2a3612ca1cd59beedb197e77e5d8e5c93aef422e (diff)
Merge "add override annotation in MarketplaceDaoImpl"
Diffstat (limited to 'vnfmarket-be')
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/db/impl/MarketplaceDaoImpl.java62
1 files changed, 30 insertions, 32 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/db/impl/MarketplaceDaoImpl.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/db/impl/MarketplaceDaoImpl.java
index 67cfb355..1e152991 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/db/impl/MarketplaceDaoImpl.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/db/impl/MarketplaceDaoImpl.java
@@ -32,9 +32,9 @@ import org.slf4j.LoggerFactory;
/**
* This class is the implementation for the DAO Layer for Driver Manager.
* <br/>
- *
+ *
* @author
- * @version
+ * @version
*/
public class MarketplaceDaoImpl implements IMarketplaceDao {
@@ -43,12 +43,12 @@ public class MarketplaceDaoImpl implements IMarketplaceDao {
private SqlSessionFactory sqlSessionFactory = null;
/**
- *
+ *
* Constructor<br/>
* <p>
* </p>
- *
- * @since
+ *
+ * @since
*/
public MarketplaceDaoImpl() {
sqlSessionFactory = ConnectionUtil.getSession();
@@ -57,21 +57,20 @@ public class MarketplaceDaoImpl implements IMarketplaceDao {
/**
* get all package data.
* <br/>
- *
+ *
* @return
- * @since
+ * @since
*/
+ @Override
public List<PackageData> getAllPackageData() {
SqlSession session = sqlSessionFactory.openSession();
- List<PackageData> csars = null;
+ List<PackageData> csars = null;
try {
IMarketplaceMapper mapper = session.getMapper(IMarketplaceMapper.class);
csars = mapper.getAllPackageData();
session.commit();
} catch(PersistenceException e) {
LOGGER.error("Exception caught {}", e);
-// throw new DriverManagerException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
-// ErrorCode.INVALID_DB);
} finally {
session.close();
}
@@ -81,59 +80,57 @@ public class MarketplaceDaoImpl implements IMarketplaceDao {
/**
* saving the package data object to the DB using the mybatis.
* <br/>
- *
+ *
* @param dirverInstance
- * @since
+ * @since
*/
- public void savePackageData(PackageData lPackageData) {
- SqlSession session = sqlSessionFactory.openSession();
+ @Override
+ public void savePackageData(PackageData lPackageData) {
+ SqlSession session = sqlSessionFactory.openSession();
try {
IMarketplaceMapper mapper = session.getMapper(IMarketplaceMapper.class);
mapper.savePackageData(lPackageData);
session.commit();
} catch(PersistenceException e) {
LOGGER.error("Exception caught {}", e);
-// throw new DriverManagerException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
-// ErrorCode.INVALID_DB);
} finally {
session.close();
}
-
- }
- public List<PackageData> getPackageData(String csarId) {
+ }
+
+ @Override
+ public List<PackageData> getPackageData(String csarId) {
SqlSession session = sqlSessionFactory.openSession();
- List<PackageData> csars = null;
+ List<PackageData> csars = null;
try {
IMarketplaceMapper mapper = session.getMapper(IMarketplaceMapper.class);
csars = mapper.getPackageData(csarId);
session.commit();
} catch(PersistenceException e) {
LOGGER.error("Exception caught {}", e);
-// throw new DriverManagerException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
-// ErrorCode.INVALID_DB);
} finally {
session.close();
}
return csars;
- }
+ }
- public void deletePackageData(String csarId) {
- SqlSession session = sqlSessionFactory.openSession();
+ @Override
+ public void deletePackageData(String csarId) {
+ SqlSession session = sqlSessionFactory.openSession();
try {
IMarketplaceMapper mapper = session.getMapper(IMarketplaceMapper.class);
mapper.deletePackageData(csarId);
session.commit();
} catch(PersistenceException e) {
- LOGGER.error("Exception caught {}", e);
-// throw new DriverManagerException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
-// ErrorCode.INVALID_DB);
+ LOGGER.error("Exception caught {}", e);;
} finally {
session.close();
}
-
- }
+ }
+
+ @Override
public void updatePackageData(PackageData oPackageData) {
SqlSession session = sqlSessionFactory.openSession();
try {
@@ -145,6 +142,7 @@ public class MarketplaceDaoImpl implements IMarketplaceDao {
} finally {
session.close();
}
-
- }
+
+ }
}
+