Package org.beangle.model.persist

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


  /**
   * 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

    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

    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

  /**
   * 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

  /**
   * 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

TOP

Related Classes of org.beangle.model.persist.EntityDao

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.