/** * Creates a {@link CouchbaseTemplate}. * * This uses {@link #mappingCouchbaseConverter()}, {@link #translationService()} and {@link #getDefaultConsistency()} * for construction. * * Additionally, it will expect injection of a {@link ClusterInfo} and a {@link Bucket} beans from the context (most * probably from another configuration). For a self-sufficient configuration that defines such beans, see * {@link AbstractCouchbaseConfiguration}. * * @throws Exception on Bean construction failure. */ @Bean(name = BeanNames.COUCHBASE_TEMPLATE) public CouchbaseTemplate couchbaseTemplate() throws Exception { CouchbaseTemplate template = new CouchbaseTemplate(couchbaseConfigurer().couchbaseClusterInfo(), couchbaseConfigurer().couchbaseClient(), mappingCouchbaseConverter(), translationService()); template.setDefaultConsistency(getDefaultConsistency()); return template; }
/** * Creates a {@link CouchbaseTemplate}. * * This uses {@link #mappingCouchbaseConverter()}, {@link #translationService()} and {@link #getDefaultConsistency()} * for construction. * * Additionally, it will expect injection of a {@link ClusterInfo} and a {@link Bucket} beans from the context (most * probably from another configuration). For a self-sufficient configuration that defines such beans, see * {@link AbstractCouchbaseConfiguration}. * * @throws Exception on Bean construction failure. */ @Bean(name = BeanNames.COUCHBASE_TEMPLATE) public CouchbaseTemplate couchbaseTemplate() throws Exception { CouchbaseTemplate template = new CouchbaseTemplate(couchbaseConfigurer().couchbaseClusterInfo(), couchbaseConfigurer().couchbaseClient(), mappingCouchbaseConverter(), translationService()); template.setDefaultConsistency(getDefaultConsistency()); return template; }