Package org.ektorp

Examples of org.ektorp.CouchDbInstance


    _updateCallback = updateCallback;
  }

  @Override
  public void execute() throws MetaModelException {
    CouchDbInstance instance = _updateCallback.getDataContext().getCouchDbInstance();
    Table table = getTable();
    MutableSchema schema = (MutableSchema) table.getSchema();
    schema.removeTable(table);
   
    instance.deleteDatabase(table.getName());
  }
View Full Code Here


  }

  public CouchDbConnector getConnector(String name) {
    CouchDbConnector connector = _connectors.get(name);
    if (connector == null) {
      CouchDbInstance instance = getDataContext().getCouchDbInstance();
      connector = instance.createConnector(name, false);
      _connectors.put(name, connector);
    }
    return connector;
  }
View Full Code Here

    public Table execute() throws MetaModelException {
        MutableTable table = getTable();

        String name = table.getName();

        CouchDbInstance instance = getUpdateCallback().getDataContext().getCouchDbInstance();
        instance.createDatabase(name);

        addMandatoryColumns(table);

        MutableSchema schema = (MutableSchema) table.getSchema();
        schema.addTable(table);
View Full Code Here

    public Table execute() throws MetaModelException {
        MutableTable table = getTable();

        String name = table.getName();

        CouchDbInstance instance = getUpdateCallback().getDataContext().getCouchDbInstance();
        instance.createDatabase(name);

        addMandatoryColumns(table);

        MutableSchema schema = (MutableSchema) table.getSchema();
        schema.addTable(table);
View Full Code Here

    } catch (MalformedURLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
   
    CouchDbInstance dbInstance = new StdCouchDbInstance(couchClient);
    //cleanup
    cleanUp(dbInstance);
   
    CouchDbConnector db = null;
   
//    System.out.println("data loading (1 write per document)");
//    for(int i=0;i<5;++i){
//      System.out.println("test "+(i+1));
//      cleanUp(dbInstance);
//      cleanRevOrders(orders);
//      cleanRevOrders(orders2);
//      db = dbInstance.createConnector("orders", true);     
//      testOrdersLoad(orders, db);
//      testOrdersLoad(orders2, db);     
//    }
   
    db = dbInstance.createConnector("orders", true);
   
    System.out.println("data loading (bulk - 1000 documents in write)");
    for(int i=0;i<5;++i){
      System.out.println("test "+(i+1));
      cleanUp(dbInstance);
      cleanRevOrders(orders);
      cleanRevOrders(orders2);
      db = dbInstance.createConnector("orders", true);     
      testOrdersBulkLoad(orders, db);
      testOrdersBulkLoad(orders2, db)
      System.out.println("\n");
    }
   
View Full Code Here

      .build();
    } catch (MalformedURLException e) {
      e.printStackTrace();
    }
   
    CouchDbInstance dbInstance = new StdCouchDbInstance(couchClient);
   
    CouchDbConnector db = null;
   
    db = dbInstance.createConnector("orders", false);
   
    OrderRepository or = new OrderRepository(db);
    ViewResult result = null;
   
    System.out.println("getOrdersPerCountry");
View Full Code Here

      .build();
    } catch (MalformedURLException e) {
      e.printStackTrace();
    }
   
    CouchDbInstance dbInstance = new StdCouchDbInstance(couchClient);
   
    CouchDbConnector db = null;
   
    db = dbInstance.createConnector("orders", false);
   
    OrderRepository or = new OrderRepository(db);
    ViewResult result = null;
   
    System.out.println("getAvgUnitPricePerShipper");
View Full Code Here

      .build();
    } catch (MalformedURLException e) {
      e.printStackTrace();
    }
   
    CouchDbInstance dbInstance = new StdCouchDbInstance(couchClient);
   
    CouchDbConnector db = null;
   
    db = dbInstance.createConnector("orders", false);
   
    OrderRepository or = new OrderRepository(db);
    ViewResult result = null;
   
    System.out.println("getValueByWeek");
View Full Code Here

      .build();
    } catch (MalformedURLException e) {
      e.printStackTrace();
    }
   
    CouchDbInstance dbInstance = new StdCouchDbInstance(couchClient);
   
    CouchDbConnector db = null;
   
    db = dbInstance.createConnector("orders", false);
   
    OrderRepository or = new OrderRepository(db);
    ViewResult result = null;
   
    System.out.println("getValueSumByCountry");
View Full Code Here

          .password("admin").url("http://localhost:5984").build();
    } catch (MalformedURLException e) {
      e.printStackTrace();
    }

    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<>();
View Full Code Here

TOP

Related Classes of org.ektorp.CouchDbInstance

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.