Package de.mhus.lib.config

Examples of de.mhus.lib.config.HashConfig


    setString("name", name);
  }
 
  @Override
  public void inject(DefComponent root) throws MException {
    HashConfig sources = (HashConfig) root.getConfig("sources");
    if (sources == null) {
      sources = (HashConfig) root.createConfig("sources");
    }
    sources.setConfig(tag, this);
  }
View Full Code Here


   
  }
 
  public JpaProperties() {
    super();
    config = new HashConfig();
  }
View Full Code Here

    config = new HashConfig();
  }

  public JpaProperties(Properties arg0) {
    super(arg0);
    config = new HashConfig();
  }
View Full Code Here

    b1.setParent(b.getId());
    b1.create(manager);
   
    // create cao
    DbDriver driver = new DbDriver();
    driver.initialize("db", new HashConfig(), MSingleton.instance().getActivator());
    CaoForm dbconf = driver.createConfiguration();
    dbconf.setConfig(config);
    CaoConnection con = driver.createConnection(dbconf);
    CaoApplication app = con.getApplication("content");
    CaoElement r = app.queryElement("root");
View Full Code Here

    b1.setParent(b.getId());
    b1.create(manager);
   
    // create cao
    DbDriver driver = new DbDriver();
    driver.initialize("db", new HashConfig(), MSingleton.instance().getActivator());
    CaoForm dbconf = driver.createConfiguration();
    dbconf.setConfig(config);
    CaoConnection con = driver.createConnection(dbconf);
    CaoApplication app = con.getApplication("content");
    CaoElement r = app.queryElement("root");
View Full Code Here

    }
   
    if (table != null &&!MString.isEmptyTrim(table.attributes())) {
      attributes = MConfigFactory.getInstance().toConfig(table.attributes());
    } else {
      attributes = new HashConfig();
    }
   
    tableNameOrg = schema.getTableName(name);
    tableName = manager.getPool().getDialect().normalizeTableName(tableNameOrg);
   
View Full Code Here

   * @param con
   * @throws Exception
   */
  public void createTable(DbConnection con) throws Exception {
   
      HashConfig cstr = new HashConfig();
      IConfig ctable = cstr.createConfig("table");
      ctable.setProperty("name", tableNameOrg);
     
      LinkedList<String> pk = new LinkedList<String>();
     
      for (Field f : fList) {
        IConfig cfield = ctable.createConfig("field");
        cfield.setProperty(Dialect.K_NAME, f.createName);
        cfield.setProperty(Dialect.K_TYPE, f.retDbType);
        cfield.setProperty(Dialect.K_SIZE, String.valueOf(f.size));
        cfield.setProperty(Dialect.K_DEFAULT, f.defValue);
          cfield.setProperty(Dialect.K_NOT_NULL, f.nullable ? "no" : "yes");
          LinkedList<String> cat = new LinkedList<String>();
          if (!f.isPersistent()) cat.add(Dialect.C_VIRTUAL);
          if (f.isPrimary) cat.add(Dialect.C_PRIMARY_KEY);
          if (f.ret.isEnum()) cat.add(Dialect.C_ENUMERATION);
          cfield.setProperty(Dialect.K_CATEGORIES, MString.join(cat.iterator(), ",") )// add primary key
        if (f.isPrimary && f.isPersistent()) pk.add(f.createName);
      }
     
      if (pk.size() > 0) {
        String pkNames = MString.join(pk.iterator(), ",");
        ctable.setProperty(Dialect.K_PRIMARY_KEY, pkNames);
      }
     
      // create index entries
      for (Entry<String, LinkedList<Field>> item : iIdx.entrySet()) {
        IConfig cindex = cstr.createConfig("index");
        String n = item.getKey();
        if (n.startsWith(DbIndex.UNIQUE)) {
          cindex.setString(Dialect.I_TYPE, Dialect.I_UNIQUE);
        }
        cindex.setString(Dialect.I_NAME, "idx_" + n);
View Full Code Here

  private Housekeeper housekeeper;

  public MRemoteManager() {
    housekeeper = new Housekeeper(this);
    IConfig config = MSingleton.instance().getConfig(this,new HashConfig());
    MSingleton.instance().getHousekeeper().register(housekeeper, config.getLong("housekeeper_sleep",30000), true);
  }
View Full Code Here

  }
 
  @Override
  public void inject(DefComponent parent) throws MException {
    if (parent != null) {
      HashConfig layout = (HashConfig) parent.getConfig("layout");
      if (layout == null) {
        layout = (HashConfig) parent.createConfig("layout");
      }
      layout.setConfig(tag, this);
    }
    for (IDefDefinition d : definitions) {
      d.inject(this);
    }
View Full Code Here

TOP

Related Classes of de.mhus.lib.config.HashConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.