ConfigDAOJdbcImpl dao = new ConfigDAOJdbcImpl();
Configuration c = dao.getConfigById(id);
if (c != null) {
IConfig result = (IConfig) ConfigAsXmlHelper.fromXml(c.getData());
// result.setName(c.getName());
result.setLoaded(true);
result.setId(id);
result.setTimestamp(c.getTimestamp());
if (c.getDirectoryId() != null) {
IDirectory parent = new DirectoryImpl();
parent.setId(c.getDirectoryId());
result.setDirectory(parent);
}
if (c.getType().equals("Config1DImpl")) {
result.setType(IConfig.ScanType.SCAN_1D);
}
else if (c.getType().equals("Config2DImpl")) {
result.setType(IConfig.ScanType.SCAN_2D);
}
else if (c.getType().equals("ConfigHCS")) {
result.setType(IConfig.ScanType.SCAN_HCS);
}
else if (c.getType().equals("ConfigK")) {
result.setType(IConfig.ScanType.SCAN_K);
}
else if (c.getType().equals("ConfigEnergy")) {
result.setType(IConfig.ScanType.SCAN_ENERGY);
}
return result;
}
return null;