Examples of EntityDao


Examples of org.beangle.model.persist.EntityDao

  /**
   * Test Hql with parameters array;
   */
  public void testQueryHqlWithParamArray() {
    EntityDao entityDao = (EntityDao) applicationContext.getBean("entityDao");
    //List<?> tables=entityDao.search(new SqlQuery("SELECT table_name FROM INFORMATION_SCHEMA.TABLES"));
    entityDao.searchHQLQuery("from "+Employer.class.getName()+" where name.firstName=? and contractInfo.add1=?",
        new Object[] { "john", "najing street" });
  }
View Full Code Here

Examples of org.beangle.model.persist.EntityDao

  /**
   * Test bulk update
   */
  public void testUpdate() {
    EntityDao entityDao = (EntityDao) applicationContext.getBean("entityDao");
    entityDao.update(Employer.class, "id", new Long[] { 1L }, new String[] { "name.firstName" },
        new Object[] { "me" });
  }
View Full Code Here

Examples of org.beangle.model.persist.EntityDao

    super();
    this.registry = registry;
  }

  public void run() {
    EntityDao entityDao = registry.getEntityDao();
    long updatedAt = registry.updatedAt;
    List<Object[]> arguments = CollectUtils.newArrayList();
    for (Map.Entry<String, AccessEntry> entry : registry.entries.entrySet()) {
      AccessEntry accessEntry = entry.getValue();
      if (accessEntry.accessAt > updatedAt) {
        arguments.add(new Object[] { new Date(entry.getValue().accessAt), entry.getKey() });
      }
    }
    if (!arguments.isEmpty()) {
      entityDao.executeUpdateHqlRepeatly("update "
          + registry.getSessioninfoBuilder().getSessioninfoClass().getName()
          + " info set info.lastAccessAt=? where info.id=?", arguments);
    }
    registry.updatedAt = System.currentTimeMillis();
  }
View Full Code Here

Examples of org.beangle.model.persist.EntityDao

    super();
    this.registry = registry;
  }

  public void run() {
    EntityDao entityDao = registry.getEntityDao();
    long updatedAt = registry.updatedAt;
    List<Object[]> arguments = CollectUtils.newArrayList();
    for (Map.Entry<String, AccessEntry> entry : registry.entries.entrySet()) {
      AccessEntry accessEntry = entry.getValue();
      if (accessEntry.accessAt > updatedAt) {
        arguments.add(new Object[] { new Date(entry.getValue().accessAt), entry.getKey() });
      }
    }
    if (!arguments.isEmpty()) {
      entityDao.executeUpdateHqlRepeatly("update "
          + registry.getSessioninfoBuilder().getSessioninfoClass().getName()
          + " info set info.lastAccessAt=? where info.id=?", arguments);
    }
    registry.updatedAt = System.currentTimeMillis();
  }
View Full Code Here

Examples of org.beangle.model.persist.EntityDao

  /**
   * Test Hql with parameters array;
   */
  public void testQueryHqlWithParamArray() {
    EntityDao entityDao = (EntityDao) applicationContext.getBean("entityDao");
    entityDao.searchHQLQuery("from Employer where name.firstName=? and contractInfo.add1=?",
        new Object[] { "john", "najing street" });
  }
View Full Code Here

Examples of org.beangle.model.persist.EntityDao

  /**
   * Test bulk update
   */
  public void testUpdate() {
    EntityDao entityDao = (EntityDao) applicationContext.getBean("entityDao");
    entityDao.update(Employer.class, "id", new Long[] { 1L },
        new String[] { "name.firstName" }, new Object[] { "me" });
  }
View Full Code Here

Examples of org.openstreetmap.osmosis.plugin.elasticsearch.dao.EntityDao

    // Build ElasticSearch client
    Client client = buildElasticsearchClient(params);
    // Build indexAdminService
    IndexAdminService indexAdminService = new IndexAdminService(client);
    // Build EntityDao
    EntityDao entityDao = buildEntityDao(client, params);
    // Create bundle
    Endpoint endpoint = new Endpoint(client, indexAdminService, entityDao);

    // Create Index
    createIndex(indexAdminService, params);
View Full Code Here

Examples of org.openstreetmap.osmosis.plugin.elasticsearch.dao.EntityDao

    }
  }

  protected EntityDao buildEntityDao(Client client, Parameters params) {
    String indexName = params.getProperty(Parameters.INDEX_NAME);
    return new EntityDao(indexName, client);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.