示例#1
0
  private static DataSourceConfig get(DSConfiguration configuration) {
    DSConfigDaoImpl dao = DB.getDSConfigDao();

    DataSourceConfig model = new DataSourceConfig();

    if (configuration.getId() != null) {
      model = dao.getConfiguration(configuration.getId());
    }

    model.setId(configuration.getId());
    model.setDriver(configuration.getDriver());
    model.setJNDI(configuration.isJNDI());
    model.setJNDIName(configuration.getJNDIName());
    model.setRDBMS(configuration.getRDBMS());
    model.setPassword(configuration.getPassword());
    model.setUser(configuration.getUser());
    model.setURL(configuration.getURL());
    model.setConfigName(configuration.getName());

    return model;
  }
示例#2
0
  private static DSConfiguration get(DataSourceConfig model) {

    DSConfiguration configuration = new DSConfiguration();
    configuration.setDriver(model.getDriver());
    configuration.setId(model.getId());
    configuration.setJNDI(model.isJNDI());
    configuration.setJNDIName(model.getJNDIName());
    configuration.setName(model.getConfigName());
    configuration.setPassword(model.getPassword());
    configuration.setRDBMS(model.getRDBMS());
    configuration.setStatus(Status.INACTIVE);
    configuration.setURL(model.getURL());
    configuration.setUser(model.getUser());
    configuration.setLastModified(model.getLastModified());

    return configuration;
  }