Package jodd.db.oom

Examples of jodd.db.oom.DbOomQuery.list()


    DbOomQuery query = query(dbsql);
    query.setMaxRows(pageSize);
    query.setFetchSize(pageSize);
    query.setMap(params);

    List<T> list = query.list(pageSize, target);
    query.close();

    String countSql = buildCountSql(sql);
    dbsql = sql(countSql);
    query = query(dbsql);
View Full Code Here


  private void insertAnswers() {
    DbSession dbSession = AppCore.ref.createDbSession();

    DbOomQuery dbQuery = new DbOomQuery(dbSession, DbSqlBuilder.sql("select $C{q.*} from $T{Question q} order by $q.id"));
    List<Question> questions =  dbQuery.list();
    dbQuery.close();
   
    for(Question q : questions) {

      dbQuery = new DbOomQuery(dbSession, DbSqlBuilder.sql("select $C{a.*} from $T{Answer a} where $a.questionId=:questionId"));
View Full Code Here

   
    for(Question q : questions) {

      dbQuery = new DbOomQuery(dbSession, DbSqlBuilder.sql("select $C{a.*} from $T{Answer a} where $a.questionId=:questionId"));
      dbQuery.setLong("questionId", q.getId());
      List<Answer> answers =  dbQuery.list();
      dbQuery.close();
     
      for (Answer a : answers) {
        dbQuery = new DbOomQuery(dbSession, DbEntitySql.updateColumn(a, "votes", Integer.valueOf(MathUtil.randomInt(10, 50))));
        dbQuery.autoClose().executeUpdate();
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.