田源
2024-03-07 4b4083fd73dc27ece42f4835483565eef0e4f608
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.vci.server.framework.appConfig;
 
import com.vci.corba.framework.data.AppConfigDetailInfo;
 
public final class AppConfigUtils {
    
    /**
     * 对象转换,从 Hibernate 对象转换到 Corba 对象
     * @param object
     * @return
     */
    public static AppConfigDetailInfo convertConfigToConfigInfo(AppConfigDetail object){
        AppConfigDetailInfo info = new AppConfigDetailInfo();
        info.id = object.getId() == null ? "" : object.getId();
        info.name = object.getName() == null ? "" : object.getName();
        info.desc = object.getDesc() == null ? "" : object.getDesc();
        info.key = object.getKey() == null ? "" : object.getKey();
        info.value = object.getValue() == null ? "" : object.getValue();
        info.categoryId = object.getCategoryId() == null ? "" : object.getCategoryId();
        return info;
    }
    
    
    /**
     * 对象转换,从 Corba 对象转换到 Hibernate 对象
     * @param info
     * @return
     */
    public static AppConfigDetail convertConfigInfoToConfig(AppConfigDetailInfo info){
        AppConfigDetail object = new AppConfigDetail();
        object.setId(info.id);
        object.setName(info.name);
        object.setDesc(info.desc);
        object.setKey(info.key);
        object.setValue(info.value);
        object.setCategoryId(info.categoryId);
        return object;
    }
}