Package com.avaje.ebeaninternal.api

Examples of com.avaje.ebeaninternal.api.BeanIdList


    CQueryFetchIds rcQuery = queryBuilder.buildFetchIdsQuery(request);
    try {

     
      BeanIdList list = rcQuery.findIds();

      if (request.isLogSql()) {
        String logSql = rcQuery.getGeneratedSql();
        if (TransactionManager.SQL_LOGGER.isTraceEnabled()) {
          logSql = Str.add(logSql, "; --bind(", rcQuery.getBindLog(), ")");
        }
        request.logSql(logSql);
      }

      if (request.isLogSummary()) {
        request.getTransaction().logSummary(rcQuery.getSummary());
      }

      if (!list.isFetchingInBackground() && request.getQuery().isFutureFetch()) {
        // end the transaction for futureFindIds (it had it's own one)
        logger.debug("Future findIds completed!");
        request.getTransaction().end();
      }
View Full Code Here


        // running in foreground thread (not FutureIds query)
        idList = Collections.synchronizedList(new ArrayList<Object>());
        query.setIdList(idList);
      }
     
      BeanIdList result = new BeanIdList(idList);
     
      SpiTransaction t = request.getTransaction();
      Connection conn = t.getInternalConnection();
      pstmt = conn.prepareStatement(sql);
     
      if (query.getBufferFetchSizeHint() > 0){
        pstmt.setFetchSize(query.getBufferFetchSizeHint());
      }
 
      if (query.getTimeout() > 0){
        pstmt.setQueryTimeout(query.getTimeout());
      }
 
      bindLog = predicates.bind(new DataBind(pstmt));
 
      ResultSet rset = pstmt.executeQuery();
      dataReader = new RsetDataReader(rset);
   
      boolean hitMaxRows = false;
      boolean hasMoreRows = false;
      rowCount = 0;
     
      DbReadContext ctx = new DbContext();
     
      while (rset.next()){
        Object idValue = desc.getIdBinder().read(ctx);
        idList.add(idValue);
        // reset back to 0
        dataReader.resetColumnPosition();
        rowCount++;
       
        if (maxRows > 0 && rowCount == maxRows) {
          hitMaxRows = true;
          hasMoreRows = rset.next();
          break;

        }
      }
     
      if (hitMaxRows){
        result.setHasMore(hasMoreRows);
      }
     
      long exeNano = System.nanoTime() - startNano;
      executionTimeMicros = (int)exeNano/1000;
View Full Code Here

  public int findRowCount() {
    return queryEngine.findRowCount(this);
  }

  public List<Object> findIds() {
    BeanIdList idList = queryEngine.findIds(this);
    return idList.getIdList();
  }
View Full Code Here

TOP

Related Classes of com.avaje.ebeaninternal.api.BeanIdList

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.