From dfaa80a79250067391a2fcc5e1d571fcc50460f1 Mon Sep 17 00:00:00 2001 From: luxin Date: Mon, 4 Sep 2017 16:41:36 +0800 Subject: Add ns dao interface Change-Id: If5309042e409404bd563408764b492ec1bfec1da Issue-Id:VFC-216 Signed-off-by: luxin --- .../resmanagement/service/dao/impl/NsDaoImpl.java | 52 ++++++++++++++++++++++ .../nfvo/resmanagement/service/dao/inf/NsDao.java | 35 +++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/dao/impl/NsDaoImpl.java create mode 100644 ResmanagementService/service/src/main/java/org/onap/vfc/nfvo/resmanagement/service/dao/inf/NsDao.java 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 getAllNs(Map 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 getAllNs(Map condition); + + int addNs(NsEntity nsEntity); + + int updateNs(NsEntity nsEntity); + + int deleteNsById(String id); +} -- cgit 1.2.3-korg