本文整理汇总了Java中org.ektorp.CouchDbConnector.createDatabaseIfNotExists方法的典型用法代码示例。如果您正苦于以下问题:Java CouchDbConnector.createDatabaseIfNotExists方法的具体用法?Java CouchDbConnector.createDatabaseIfNotExists怎么用?Java CouchDbConnector.createDatabaseIfNotExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ektorp.CouchDbConnector
的用法示例。
在下文中一共展示了CouchDbConnector.createDatabaseIfNotExists方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDatabaseAndUpdateDesignDocuments
import org.ektorp.CouchDbConnector; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
@Bean
@Lazy(false)
public String createDatabaseAndUpdateDesignDocuments(CouchDbConnector db) {
db.createDatabaseIfNotExists();
DocumentLoader loader = new DocumentLoader(new EktorpCrudRepository(Map.class, db));
loader.loadYaml(getClass().getResourceAsStream("../Product.yaml"));
loader.loadJson(getClass().getResourceAsStream("../Manufacturer.json"));
loader.loadJson(getClass().getResourceAsStream("../Exotic.json"));
return "OK"; // anything
}
示例2: couchDbConnector
import org.ektorp.CouchDbConnector; //导入方法依赖的package包/类
@Bean
public CouchDbConnector couchDbConnector(CouchDbInstance couchDbInstance) {
CouchDbConnector connector = new StdCouchDbConnector("status", couchDbInstance);
connector.createDatabaseIfNotExists();
return connector;
}
示例3: dbConnector
import org.ektorp.CouchDbConnector; //导入方法依赖的package包/类
@Bean
public CouchDbConnector dbConnector() throws MalformedURLException {
CouchDbConnector db = new StdCouchDbConnector("midgard", dbInstance());
db.createDatabaseIfNotExists();
return db;
}
示例4: expose
import org.ektorp.CouchDbConnector; //导入方法依赖的package包/类
@Produces
public CouchDbConnector expose() {
CouchDbConnector db = new StdCouchDbConnector("playerdb", dbi);
db.createDatabaseIfNotExists();
return db;
}