4026e9e46385e021c432e15667234dd9ea0d8b2d
[vfc/nfvo/resmanagement.git] /
1 /*
2  * Copyright 2016 Huawei Technologies Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.vfc.nfvo.resmanagement.service.dao.impl;
18
19 import java.util.List;
20 import java.util.Map;
21
22 import org.onap.vfc.nfvo.resmanagement.service.dao.inf.VnfStatusDao;
23 import org.onap.vfc.nfvo.resmanagement.service.entity.VnfStatusEntity;
24 import org.onap.vfc.nfvo.resmanagement.service.mapper.VnfStatusMapper;
25
26 /**
27  * <br>
28  * <p>
29  * </p>
30  * 
31  * @author
32  * @version NFVO 0.5 Oct 29, 2016
33  */
34 public class VnfStatusDaoImpl extends AbstractDao implements VnfStatusDao {
35
36     /**
37      * <br>
38      * 
39      * @param id
40      * @return
41      * @since NFVO 0.5
42      */
43     @Override
44     public VnfStatusEntity getVnfStatus(String id) {
45         return getMapperManager(VnfStatusMapper.class).selectByPrimaryKey(id);
46     }
47
48     /**
49      * <br>
50      * 
51      * @param condition
52      * @return
53      * @since NFVO 0.5
54      */
55     @Override
56     public List<VnfStatusEntity> getVnfStatuss(Map<String, Object> condition) {
57         return getMapperManager(VnfStatusMapper.class).getVnfStatuss(condition);
58     }
59
60     /**
61      * <br>
62      * 
63      * @param vnfStatusEntity
64      * @return
65      * @since NFVO 0.5
66      */
67     @Override
68     public int addVnfStatus(VnfStatusEntity vnfStatusEntity) {
69         return getMapperManager(VnfStatusMapper.class).insert(vnfStatusEntity);
70     }
71
72     /**
73      * <br>
74      * 
75      * @param id
76      * @return
77      * @since NFVO 0.5
78      */
79     @Override
80     public int deleteVnfStatusById(String id) {
81         return getMapperManager(VnfStatusMapper.class).deleteByPrimaryKey(id);
82     }
83
84     /**
85      * <br>
86      * 
87      * @param vnfStatusEntity
88      * @return
89      * @since NFVO 0.5
90      */
91     @Override
92     public int updateVnfStatus(VnfStatusEntity vnfStatusEntity) {
93         return getMapperManager(VnfStatusMapper.class).updateByPrimaryKeySelective(vnfStatusEntity);
94     }
95
96 }