Package org.ektorp

Examples of org.ektorp.ViewQuery


        _databaseName = databaseName;
        _closed = new AtomicBoolean(false);

        final CouchDbConnector tableConnector = _couchDbInstance.createConnector(databaseName, false);
        if (maxRows > -1) {
            _view = tableConnector.queryForStreamingView(new ViewQuery().allDocs().includeDocs(true).limit(maxRows));
        } else {
            _view = tableConnector.queryForStreamingView(new ViewQuery().allDocs().includeDocs(true));
        }
        _rowIterator = _view.iterator();
    }
View Full Code Here


    protected DataSet materializeMainSchemaTable(Table table, Column[] columns, int firstRow, int maxRows) {
        // the connector represents a handle to the the couchdb "database".
        final String databaseName = table.getName();
        final CouchDbConnector connector = _couchDbInstance.createConnector(databaseName, false);

        ViewQuery query = new ViewQuery().allDocs().includeDocs(true);

        if (maxRows > 0) {
            query = query.limit(maxRows);
        }
        if (firstRow > 1) {
            final int skip = firstRow - 1;
            query = query.skip(skip);
        }

        final StreamingViewResult streamingView = connector.queryForStreamingView(query);

        final SelectItem[] selectItems = MetaModelHelper.createSelectItems(columns);
View Full Code Here

    }

    public static SimpleTableDef detectTable(CouchDbConnector connector) {
        final SortedMap<String, Set<ColumnType>> columnsAndTypes = new TreeMap<String, Set<ColumnType>>();

        final StreamingViewResult streamingView = connector.queryForStreamingView(new ViewQuery().allDocs().includeDocs(true)
                .limit(1000));
        try {
            final Iterator<Row> rowIterator = streamingView.iterator();
            while (safeHasNext(rowIterator)) {
                Row row = rowIterator.next();
View Full Code Here

    protected DataSet materializeMainSchemaTable(Table table, Column[] columns, int firstRow, int maxRows) {
        // the connector represents a handle to the the couchdb "database".
        final String databaseName = table.getName();
        final CouchDbConnector connector = _couchDbInstance.createConnector(databaseName, false);

        ViewQuery query = new ViewQuery().allDocs().includeDocs(true);

        if (maxRows > 0) {
            query = query.limit(maxRows);
        }
        if (firstRow > 1) {
            final int skip = firstRow - 1;
            query = query.skip(skip);
        }

        final StreamingViewResult streamingView = connector.queryForStreamingView(query);

        final SelectItem[] selectItems = MetaModelHelper.createSelectItems(columns);
View Full Code Here

    super(Order.class,db);
    initStandardDesignDocument();
  }
 
  public ViewResult productsWithQuantity() {
    ViewQuery query = new ViewQuery()
      .viewName("productsWithQuantity")
      .designDocId("_design/Order")
      .group(true);
      return db.queryView(query);
  }
View Full Code Here

      .group(true);
      return db.queryView(query);
  }
 
  public List<Order> getAllOrders() {
    ViewQuery query = new ViewQuery()
      .viewName("allOrders")
      .designDocId("_design/Order");
      return db.queryView(query,Order.class);
  }
View Full Code Here

      .designDocId("_design/Order");
      return db.queryView(query,Order.class);
  }
 
  public List<Product> getAllProducts() {
    ViewQuery query = new ViewQuery()
      .viewName("allProducts")
      .designDocId("_design/Order");
      return db.queryView(query,Product.class);
  }
View Full Code Here

      .designDocId("_design/Order");
      return db.queryView(query,Product.class);
  }
 
  public ViewResult valueByWeekDay() {
    ViewQuery query = new ViewQuery()
      .viewName("valueByWeekDay")
      .designDocId("_design/Order")
      .group(true);
      return db.queryView(query);
  }
View Full Code Here

      .group(true);
      return db.queryView(query);
  }
 
  public ViewResult valueSumByCountry() {
    ViewQuery query = new ViewQuery()
      .viewName("valueSumByCountry")
      .designDocId("_design/Order")
      .group(true);
      return db.queryView(query);
  }
View Full Code Here

      .group(true);
      return db.queryView(query);
  }
 
  public ViewResult getAvgUnitPricePerShipper() {
    ViewQuery query = new ViewQuery()
      .viewName("avgUnitPricePerShipper")
      .designDocId("_design/Order")
      .group(true);
      return db.queryView(query);
  }
View Full Code Here

TOP

Related Classes of org.ektorp.ViewQuery

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.