diff options
Diffstat (limited to 'ResmanagementService/service/src/main/java')
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);
+}
|