我正在使用 Spring-MVC LightCouch 和 CouchDB,并且我有自定义视图需要在部署时插入到数据库中。我发现 LightCouch 有一种“从办公桌上”提取文档的方法,如其网站上所述:
DesignDocument designDoc = dbClient.design().getFromDesk("example");
Response response = dbClient.design().synchronizeWithDb(designDoc);
这在 JAVA 代码中效果很好,但是我需要能够在 Spring ApplicationContext.xml 中做到这一点我有不止一个,所以我想模仿以下调用:
dbClient.dessign().synchronizeAllWithDB()
我将如何在 ApplicationContext 的 bean 定义中执行此操作我已经有了这个:
<bean id="dbClient" class="org.lightcouch.CouchDbClient" lazy-init="false" destroy- method="shutdown">
<constructor-arg value="couchdb.properties" />
</bean>