Package repositories

Examples of repositories.OrderRepository


   
    CouchDbConnector db = null;
   
    db = dbInstance.createConnector("orders", false);
   
    OrderRepository or = new OrderRepository(db);
    ViewResult result = null;
   
    System.out.println("getOrdersPerCountry");
    System.out.println("times");
    /*for(int i=0;i<10;++i){
View Full Code Here


   
    CouchDbConnector db = null;
   
    db = dbInstance.createConnector("orders", false);
   
    OrderRepository or = new OrderRepository(db);
    ViewResult result = null;
   
    System.out.println("getAvgUnitPricePerShipper");
    System.out.println("times");
    for(int i=0;i<10;++i){
      long st = System.nanoTime();
      result = or.getAvgUnitPricePerShipper();
      System.out.print(((System.nanoTime()-st)/1000000.0)+";");
    }
    System.out.println();
    for(ViewResult.Row r : result.getRows()){
      JsonNode key = r.getKeyAsNode();
View Full Code Here

   
    CouchDbConnector db = null;
   
    db = dbInstance.createConnector("orders", false);
   
    OrderRepository or = new OrderRepository(db);
    ViewResult result = null;
   
    System.out.println("getValueByWeek");
    System.out.println("times");
    for(int i=0;i<10;++i){
      long st = System.nanoTime();
      result = or.valueByWeekDay();
      System.out.print(((System.nanoTime()-st)/1000000.0)+";");
    }

    System.out.println("\n");
    for(ViewResult.Row r : result.getRows()){
View Full Code Here

   
    CouchDbConnector db = null;
   
    db = dbInstance.createConnector("orders", false);
   
    OrderRepository or = new OrderRepository(db);
    ViewResult result = null;
   
    System.out.println("getValueSumByCountry");
    System.out.println("times");
    for(int i=0;i<10;++i){
      long st = System.nanoTime();
      result = or.valueSumByCountry();
      System.out.print(((System.nanoTime()-st)/1000000.0)+";");
    }
   
    System.out.println("\n");
    for(ViewResult.Row r : result.getRows()){
      JsonNode key = r.getKeyAsNode();
      JsonNode val = r.getValueAsNode();
//      System.out.println("Country="+key.get(0)+", year="+key.get(1)+", sumValue="+val.getDoubleValue());
    }
   
    for(int i=0;i<10;++i){
      long st = System.nanoTime();
      List<Order> allOrders = or.getAllOrders();
      Map<String,Map<String,Double>> data = new HashMap<>();
      for(Order o : allOrders){
        String country = o.getShipCountry();
        String year = o.getShippedDate().substring(0, 4);
        double valueSum = 0.0;
View Full Code Here

    CouchDbInstance dbInstance = new StdCouchDbInstance(couchClient);

    CouchDbConnector db = null;

    db = dbInstance.createConnector("orders", false);
    OrderRepository or = new OrderRepository(db);

    List<Product> allProd = or.getAllProducts();

    Map<String,Integer> supps = new HashMap<>();
    System.out.println("getQuantityBySupplier");
    System.out.println("times");
   
    ViewResult result = null;
    for(int i=0;i<10;++i){
      long st = System.nanoTime();
     
      result = or.productsWithQuantity();
     
      for (ViewResult.Row row : result.getRows()) {
       
        for(Product p : allProd) {
          if(row.getKey().equals(p.getProductID())) {
View Full Code Here

    CouchDbInstance dbInstance = new StdCouchDbInstance(couchClient);
   
    CouchDbConnector db = null;
   
    db = dbInstance.createConnector("orders", false);
    OrderRepository or = new OrderRepository(db)
    ViewResult result = null;
   
   
    System.out.println("getAvgTimePerYear");
    System.out.println("times");
View Full Code Here

TOP

Related Classes of repositories.OrderRepository

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.