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;
|
}
|
}
|