use of com.ctrip.platform.dal.daogen.host.DalConfigHost in project dal by ctripcorp.
the class CSharpCodeGenContextCreator method process.
@Override
public void process(CodeGenContext context) throws Exception {
try {
CSharpCodeGenContext ctx = (CSharpCodeGenContext) context;
Project project = BeanGetter.getDaoOfProject().getProjectByID(ctx.getProjectId());
DalConfigHost dalConfigHost = null;
if (project.getDal_config_name() != null && !project.getDal_config_name().isEmpty()) {
dalConfigHost = new DalConfigHost(project.getDal_config_name());
} else if (project.getNamespace() != null && !project.getNamespace().isEmpty()) {
dalConfigHost = new DalConfigHost(project.getNamespace());
} else {
dalConfigHost = new DalConfigHost("");
}
ctx.setDalConfigHost(dalConfigHost);
ctx.setNamespace(project.getNamespace());
} catch (Throwable e) {
LoggerManager.getInstance().error(e);
throw e;
}
}
Aggregations