6e8d32b889453bcfb25e2c8666a734d2d635f3fa
[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.openo.nfvo.resmanagement.service.dao.impl;
18
19 import java.util.List;
20 import java.util.Map;
21
22 import org.openo.nfvo.resmanagement.service.dao.inf.VnfInfoDao;
23 import org.openo.nfvo.resmanagement.service.entity.VnfInfoEntity;
24 import org.openo.nfvo.resmanagement.service.mapper.VnfInfoMapper;
25
26 /**
27  * <br>
28  * <p>
29  * </p>
30  * 
31  * @author
32  * @version NFVO 0.5 Oct 28, 2016
33  */
34 public class VnfInfoDaoImpl extends AbstractDao implements VnfInfoDao {
35
36     /**
37      * <br>
38      * 
39      * @param id
40      * @return
41      * @since NFVO 0.5
42      */
43     @Override
44     public VnfInfoEntity getVnfInfo(String id) {
45         return getMapperManager(VnfInfoMapper.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<VnfInfoEntity> getVnfInfos(Map<String, Object> condition) {
57         return getMapperManager(VnfInfoMapper.class).getVnfInfos(condition);
58     }
59
60     /**
61      * <br>
62      * 
63      * @param vmEntity
64      * @return
65      * @since NFVO 0.5
66      */
67     @Override
68     public int addVnfInfo(VnfInfoEntity vnfInfoEntity) {
69         return getMapperManager(VnfInfoMapper.class).insert(vnfInfoEntity);
70     }
71
72     /**
73      * <br>
74      * 
75      * @param id
76      * @return
77      * @since NFVO 0.5
78      */
79     @Override
80     public int deleteVnfInfoById(String id) {
81         return getMapperManager(VnfInfoMapper.class).deleteByPrimaryKey(id);
82     }
83
84     /**
85      * <br>
86      * 
87      * @param vnfInfoEntity
88      * @return
89      * @since NFVO 0.5
90      */
91     @Override
92     public int updateVnfInfo(VnfInfoEntity vnfInfoEntity) {
93         return getMapperManager(VnfInfoMapper.class).updateByPrimaryKeySelective(vnfInfoEntity);
94     }
95
96 }