summaryrefslogtreecommitdiffstats
path: root/ResmanagementService/service/src/main/java/org/onap
diff options
context:
space:
mode:
authorluxin <luxin7@huawei.com>2017-09-04 16:41:36 +0800
committerluxin <luxin7@huawei.com>2017-09-04 16:41:36 +0800
commitdfaa80a79250067391a2fcc5e1d571fcc50460f1 (patch)
tree515140a26470a1265d0cd6add91467a2815a5b7b /ResmanagementService/service/src/main/java/org/onap
parent4d7b0ce7d8a10b6587f44a5000f13a40cb201012 (diff)
Add ns dao interface
Change-Id: If5309042e409404bd563408764b492ec1bfec1da Issue-Id:VFC-216 Signed-off-by: luxin <luxin7@huawei.com>
Diffstat (limited to 'ResmanagementService/service/src/main/java/org/onap')
-rw-r--r--ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/dao/impl/NsDaoImpl.java52
-rw-r--r--ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/dao/inf/NsDao.java35
2 files changed, 87 insertions, 0 deletions
diff --git a/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/dao/impl/NsDaoImpl.java b/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/dao/impl/NsDaoImpl.java
new file mode 100644
index 0000000..ee9d532
--- /dev/null
+++ b/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/dao/impl/NsDaoImpl.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2017 Huawei Technologies Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.vfc.nfvo.resmanagement.service.dao.impl;
+
+import java.util.List;
+import java.util.Map;
+
+import org.onap.vfc.nfvo.resmanagement.service.dao.inf.NsDao;
+import org.onap.vfc.nfvo.resmanagement.service.entity.NsEntity;
+import org.onap.vfc.nfvo.resmanagement.service.mapper.NsEntityMapper;
+
+public class NsDaoImpl extends AbstractDao implements NsDao {
+
+ @Override
+ public NsEntity getNs(String id) {
+ return getMapperManager(NsEntityMapper.class).selectByPrimaryKey(id);
+ }
+
+ @Override
+ public List<NsEntity> getAllNs(Map<String, Object> condition) {
+ return getMapperManager(NsEntityMapper.class).getAllNs(condition);
+ }
+
+ @Override
+ public int addNs(NsEntity nsEntity) {
+ return getMapperManager(NsEntityMapper.class).insert(nsEntity);
+ }
+
+ @Override
+ public int updateNs(NsEntity nsEntity) {
+ return getMapperManager(NsEntityMapper.class).updateByPrimaryKey(nsEntity);
+ }
+
+ @Override
+ public int deleteNsById(String id) {
+ return getMapperManager(NsEntityMapper.class).deleteByPrimaryKey(id);
+ }
+}
diff --git a/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/dao/inf/NsDao.java b/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/dao/inf/NsDao.java
new file mode 100644
index 0000000..eb364af
--- /dev/null
+++ b/ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/dao/inf/NsDao.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2017 Huawei Technologies Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.vfc.nfvo.resmanagement.service.dao.inf;
+
+import java.util.List;
+import java.util.Map;
+
+import org.onap.vfc.nfvo.resmanagement.service.entity.NsEntity;
+
+public interface NsDao {
+
+ NsEntity getNs(String id);
+
+ List<NsEntity> getAllNs(Map<String, Object> condition);
+
+ int addNs(NsEntity nsEntity);
+
+ int updateNs(NsEntity nsEntity);
+
+ int deleteNsById(String id);
+}