Giter VIP home page Giter VIP logo

spring-projects / spring-data-couchbase Goto Github PK

View Code? Open in Web Editor NEW
272.0 51.0 187.0 6.93 MB

Provides support to increase developer productivity in Java when using Couchbase. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.

Home Page: https://spring.io/projects/spring-data-couchbase

License: Apache License 2.0

Java 99.95% Shell 0.05%
couchbase ddd framework java spring spring-data

spring-data-couchbase's Introduction

Spring Data Couchbase icon?job=spring data couchbase%2Fmain&subject=Build Gitter Revved up by Develocity

The primary goal of the Spring Data project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services.

The Spring Data Couchbase project aims to provide a familiar and consistent Spring-based programming model for Couchbase Server as a document database and cache while retaining store-specific features and capabilities. Key functional areas of Spring Data Couchbase are a POJO centric model for interacting with a Couchbase Server Bucket and easily writing a repository style data access layer.

Integration tests require a couchbase server with a bucket name "protected" with "password" as the password set. If the server allows users, then an user with username "protected" with "password" as the password should also be set. The recommended way to run tests is to install docker and use container in server.properties.

This project is lead and maintained by Couchbase, Inc.

Features

  • Spring configuration support using Java based @Configuration classes or an XML namespace for the Couchbase driver (Java SDK version 2.x).

  • CouchbaseTemplate helper class that increases productivity performing common Couchbase operations. Includes integrated object mapping between documents and POJOs.

  • Exception translation into Spring’s portable Data Access Exception hierarchy.

  • Feature Rich Object Mapping integrated with Spring’s Conversion Service.

  • Annotation based mapping metadata but extensible to support other metadata formats.

  • Automatic implementation of Repository interfaces including support for custom finder methods (backed by Couchbase’s query language, N1QL) and PagingAndSortingRepository.

  • For Couchbase server versions < 4.0, repositories can still be backed by Couchbase Views.

  • Support for geospatial and multidimensional querying (backed by Couchbase Spatial Views)

  • JMX administration and monitoring

  • Can serve as the backend for @Cacheable support, to cache any objects you need for high performance access (see sibling Spring Cache project in Couchbase’s github, couchbaselabs/couchbase-spring-cache).

Version compatibility

Spring-Data Couchbase is the Spring Data connector for the Couchbase Java SDK 2.x generation.

Both the SDK and this Spring Data community project are major version changes with lots of differences from their respective previous versions.

Notably, this version is compatible with Couchbase Server 4.0, bringing support for the N1QL query language.

Code of Conduct

This project is governed by the Spring Code of Conduct.By participating, you are expected to uphold this code of conduct.Please report unacceptable behavior to [email protected].

Getting Started

Here is a quick teaser of an application using Spring Data Repositories in Java:

public interface PersonRepository extends CrudRepository<Person, Long> {

  List<Person> findByLastname(String lastname);

  List<Person> findByFirstnameLike(String firstname);
}

@Service
public class MyService {

  private final PersonRepository repository;

  public MyService(PersonRepository repository) {
    this.repository = repository;
  }

  public void doWork() {

    repository.deleteAll();

    Person person = new Person();
    person.setFirstname("Couch");
    person.setLastname("Base");
    repository.save(person);

    List<Person> lastNameResults = repository.findByLastname("Base");
    List<Person> firstNameResults = repository.findByFirstnameLike("Cou*");
 }
}

@Configuration
@EnableCouchbaseRepositories
public class Config extends AbstractCouchbaseConfiguration {

	@Override
	protected List<String> getBootstrapHosts() {
		return Arrays.asList("host1", "host2");
	}

	@Override
	protected String getBucketName() {
		return "default";
	}

	@Override
	protected String getPassword() {
		return "";
	}
}

Maven configuration

Add the Maven dependency:

<dependency>
  <groupId>org.springframework.data</groupId>
  <artifactId>spring-data-couchbase</artifactId>
  <version>${version}</version>
</dependency>

If you’d rather like the latest snapshots of the upcoming major version, use our Maven snapshot repository and declare the appropriate dependency version.

<dependency>
  <groupId>org.springframework.data</groupId>
  <artifactId>spring-data-couchbase</artifactId>
  <version>${version}-SNAPSHOT</version>
</dependency>

<repository>
  <id>spring-snapshot</id>
  <name>Spring Snapshot Repository</name>
  <url>https://repo.spring.io/snapshot</url>
</repository>

Getting Help

Having trouble with Spring Data? We’d love to help!

Reporting Issues

Spring Data uses GitHub as issue tracking system to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below:

  • Before you log a bug, please search the issue tracker to see if someone has already reported the problem.

  • If the issue does not already exist, create a new issue.

  • Please provide as much information as possible with the issue report, we like to know the version of Spring Data that you are using and JVM version.

  • If you need to paste code, or include a stack trace use Markdown ``` escapes before and after your text.

  • If possible try to create a test-case or project that replicates the issue. Attach a link to your code or a compressed file containing your code.

Building from Source

You don’t need to build from source to use Spring Data (binaries in repo.spring.io), but if you want to try out the latest and greatest, Spring Data can be easily built with the maven wrapper. You also need JDK 17 or above.

 $ ./mvnw clean install

If you want to build with the regular mvn command, you will need Maven v3.5.0 or above.

Also see CONTRIBUTING.adoc if you wish to submit pull requests, and in particular please sign the Contributor’s Agreement before your first non-trivial change.

Building reference documentation

Building the documentation builds also the project without running tests.

 $ ./mvnw clean install -Pantora

The generated documentation is available from target/antora/site/index.html.

Building and staging reference documentation for review

  export MY_GIT_USER=<github-user>
  mvn generate-resources
  docs=`pwd`/target/site/reference/html
  pushd /tmp
  mkdir $$
  cd $$
  # see https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site
  # this examples uses a repository named "staged"
  git clone [email protected]:${MY_GIT_USER}/staged.git -b gh-pages
  cd staged
  cp -R $docs/* .
  git add .
  git commit --message "stage for review"
  git push origin gh-pages
  popd

The generated documentation is available from target/site/reference/html/index.html.

Examples

License

Spring Data Couchbase is Open Source software released under the Apache 2.0 license.

spring-data-couchbase's People

Contributors

awislowski avatar babltiga avatar bipoool avatar bsubhashni avatar christophstrobl avatar daschl avatar davidkelly avatar dependabot[bot] avatar dharrigan avatar dnault avatar erichaagdev avatar gregturn avatar haal avatar jorgerod avatar jxblum avatar kdombeck avatar lyngaas avatar mikereiche avatar mp911de avatar msolujic avatar odrotbohm avatar rbleuse avatar runbing avatar runnerway avatar schauder avatar shubham101096 avatar simonbasle avatar simonbland avatar spring-builds avatar sxhinzvc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-data-couchbase's Issues

Spring Data Couchbase build fails when not having bundlor maven plugin [DATACOUCH-22]

Jeroen Reijn opened DATACOUCH-22 and commented

While trying to build Spring Data Couchbase the build failed because it was unable with the following exception:

[INFO] ------------------------------------------------------------------------
[INFO] Building Spring Data Couchbase 1.0.0.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/com/springsource/bundlor/com.springsource.bundlor.maven/1.0.0.RELEASE/com.springsource.bundlor.maven-1.0.0.RELEASE.pom
[WARNING] The POM for com.springsource.bundlor:com.springsource.bundlor.maven:jar:1.0.0.RELEASE is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.166s
[INFO] Finished at: Thu Jul 25 00:00:07 CEST 2013
[INFO] Final Memory: 10M/309M
[INFO] --------------------------------------------------------------------


No further details from DATACOUCH-22

Add Gradle to the Project [DATACOUCH-29]

David Harrigan opened DATACOUCH-29 and commented

Hi,

Since the majority of Spring projects seem to have migrated to using Gradle, or are in the process of moving to Gradle, it would be great if Spring Data Couchbase did the same thing.

I've done a quick implementation from the forked repo. I'll be pushing shortly.

Things to do:

Where to upload archives to?


Affects: 1.0 M1

Can't deserialize Class fields [DATACOUCH-35]

Pavel Bernshtam opened DATACOUCH-35 and commented

If I have a field of type Class in my serializable class, I can save it using couchbase repository, but I can't load it:

Exception in thread "main" org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type java.lang.String to type java.lang.Class
at org.springframework.core.convert.support.GenericConversionService.handleConverterNotFound(GenericConversionService.java:475)
at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:175)
at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:154)
at org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter.readMap(MappingCouchbaseConverter.java:173)
at org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter.read(MappingCouchbaseConverter.java:96)
at org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter.readValue(MappingCouchbaseConverter.java:480)
at org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter.access$200(MappingCouchbaseConverter.java:50)
at org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter$CouchbasePropertyValueProvider.getPropertyValue(MappingCouchbaseConverter.java:472)
at org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter.getValueInternal(MappingCouchbaseConverter.java:146)
at org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter$1.doWithPersistentProperty(MappingCouchbaseConverter.java:125)
at org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter$1.doWithPersistentProperty(MappingCouchbaseConverter.java:119)
at org.springframework.data.mapping.model.BasicPersistentEntity.doWithProperties(BasicPersistentEntity.java:257)
at org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter.read(MappingCouchbaseConverter.java:119)
at org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter.read(MappingCouchbaseConverter.java:106)
at org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter.read(MappingCouchbaseConverter.java:79)
at org.springframework.data.couchbase.core.convert.MappingCouchbaseConverter.read(MappingCouchbaseConverter.java:50)
at org.springframework.data.couchbase.core.CouchbaseTemplate.findById(CouchbaseTemplate.java:163)
at org.springframework.data.couchbase.repository.support.SimpleCouchbaseRepository.findOne(SimpleCouchbaseRepository.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:344)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:329)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy6.findOne(Unknown Source)
at com.salespredict.CouchBaseClient.main(CouchBaseClient.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)


Affects: 1.0 M1

Referenced from: commits 1fc662b

Can't deserialize long/Long/Date fields [DATACOUCH-34]

Pavel Bernshtam opened DATACOUCH-34 and commented

I have a class with long field, which stores timestamp

When I try read it from couchbase using CouchbaseRepository findOne() method I receive

xception in thread "main" java.lang.RuntimeException: Could not decode JSON
at org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService.decode(JacksonTranslationService.java:125)
at org.springframework.data.couchbase.core.CouchbaseTemplate.translateDecode(CouchbaseTemplate.java:83)
at org.springframework.data.couchbase.core.CouchbaseTemplate.findById(CouchbaseTemplate.java:163)
at org.springframework.data.couchbase.repository.support.SimpleCouchbaseRepository.findOne(SimpleCouchbaseRepository.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:344)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:329)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy9.findOne(Unknown Source)
at com.salespredict.CouchBaseClient.main(CouchBaseClient.java:11)
Caused by: com.fasterxml.jackson.core.JsonParseException: Numeric value (1381061520766) out of range of int
at [Source: java.io.StringReader@8e396; line: 1, column: 27]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1369)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:599)
at com.fasterxml.jackson.core.base.ParserBase.convertNumberToInt(ParserBase.java:847)
at com.fasterxml.jackson.core.base.ParserBase.getIntValue(ParserBase.java:643)
at com.fasterxml.jackson.core.base.ParserMinimalBase.getValueAsInt(ParserMinimalBase.java:293)
at com.fasterxml.jackson.core.JsonParser.getValueAsInt(JsonParser.java:1105)
at org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService.decodePrimitive(JacksonTranslationService.java:201)
at org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService.decodeObject(JacksonTranslationService.java:150)
at org.springframework.data.couchbase.core.convert.translation.JacksonTranslationService.decode(JacksonTranslationService.java:116)


Affects: 1.0 M1

Referenced from: commits 6fd4d92, 6896195, af5cfe8, 5ae7c76

Enhance @View "Query" params customization [DATACOUCH-49]

Michael Nitschinger opened DATACOUCH-49 and commented

In some way or another, the @View annotation needs to be extended (at least with a stale param) OR much better add another optional annotation where all properties are supported. Maybe this could be also be done better by passing it along with the findAll(,...). We need to think this through, would like to get inputs!


Affects: 1.0 M1, 1.0 M2

Issue Links:

  • DATACOUCH-64 Add View query methods to repositories
    ("is superseded by")

findAll(Iterable<ID> ids) in CrudRepository throws java.util.concurrent.ExecutionException [DATACOUCH-50]

deepak vohra opened DATACOUCH-50 and commented

The other methods in CrudRepository do not generate an exception , but the findAll(Iterable<ID> ids) method generates the following exception with the example from https://github.com/spring-projects/spring-data-couchbase

Exception in thread "main" java.lang.RuntimeException: Failed to access the view
at com.couchbase.client.CouchbaseClient.query(CouchbaseClient.java:759)
at org.springframework.data.couchbase.core.CouchbaseTemplate$5.doInBucket(CouchbaseTemplate.java:196)
at org.springframework.data.couchbase.core.CouchbaseTemplate$5.doInBucket(CouchbaseTemplate.java:192)
at org.springframework.data.couchbase.core.CouchbaseTemplate.execute(CouchbaseTemplate.java:234)
at org.springframework.data.couchbase.core.CouchbaseTemplate.queryView(CouchbaseTemplate.java:192)
at org.springframework.data.couchbase.core.CouchbaseTemplate.findByView(CouchbaseTemplate.java:179)
at org.springframework.data.couchbase.repository.support.SimpleCouchbaseRepository.findAll(SimpleCouchbaseRepository.java:143)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:344)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:329)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.data.couchbase.repository.support.ViewPostProcessor$ViewInterceptor.invoke(ViewPostProcessor.java:80)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy13.findAll(Unknown Source)
at service.CatalogService.findAllDocumentsByCollection(CatalogService.java:103)
at service.CatalogService.main(CatalogService.java:62)
Caused by: java.util.concurrent.ExecutionException: OperationException: SERVER: bad_request Reason: invalid UTF-8 JSON: error,{2,"lexical error: invalid char in json text.\n",
"[catalog:engineering-as-a-service, catalog:quintessential-and-collaborative]"}
at com.couchbase.client.internal.HttpFuture.waitForAndCheckOperation(HttpFuture.java:98)
at com.couchbase.client.internal.ViewFuture.get(ViewFuture.java:65)
at com.couchbase.client.internal.ViewFuture.get(ViewFuture.java:49)
at com.couchbase.client.internal.HttpFuture.get(HttpFuture.java:72)
at com.couchbase.client.CouchbaseClient.query(CouchbaseClient.java:752)
... 21 more
Caused by: OperationException: SERVER: bad_request Reason: invalid UTF-8 JSON: error,{2,"lexical error: invalid char in json text.\n",
"[catalog:engineering-as-a-service, catalog:quintessential-and-collaborative]"}
at com.couchbase.client.protocol.views.DocsOperationImpl.parseError(DocsOperationImpl.java:105)
at com.couchbase.client.protocol.views.ViewOperationImpl.handleResponse(ViewOperationImpl.java:68)
at com.couchbase.client.ViewNode$MyHttpRequestExecutionHandler.handleResponse(ViewNode.java:225)
at org.apache.http.nio.protocol.AsyncNHttpClientHandler.processResponse(AsyncNHttpClientHandler.java:417)
at org.apache.http.nio.protocol.AsyncNHttpClientHandler.inputReady(AsyncNHttpClientHandler.java:242)
at com.couchbase.client.http.AsyncConnectionManager$ManagedClientHandler.inputReady(AsyncConnectionManager.java:249)
at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:172)
at org.apache.http.impl.nio.DefaultClientIOEventDispatch.inputReady(DefaultClientIOEventDispatch.java:155)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:161)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:335)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:275)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:542)
at java.lang.Thread.run(Thread.java:722)


No further details from DATACOUCH-50

Not consistent unit tests [DATACOUCH-44]

Pavel Bernshtam opened DATACOUCH-44 and commented

Unit tests
SimpleCouchbaseRepositoryTests and CouchbaseRepositoryViewTests
pass only from the second run.

The reason is that they assume that some number of User entities were added to the couchbase.

Each unit test should be self contained and should run on empty or nonempty bucket. It should create required number of entities in @Before method


Referenced from: commits 5414ee5

Can't deserialize enum [DATACOUCH-38]

Pavel Bernshtam opened DATACOUCH-38 and commented

java.lang.String cannot be cast to com.salespredict.crawlers.pipeline.IFetchableCacheable
java.lang.ClassCastException: java.lang.String cannot be cast to com.salespredict.crawlers.pipeline.IFetchableCacheable
at com.salespredict.bl.cache.CachedEntity.getRawObject(CachedEntity.java:72)
at com.salespredict.crawlers.pipeline.EntityContext.getRawObject(EntityContext.java:33)
at com.salespredict.crawlers.pipeline.PerEntityCrawlerBase.getCachedFromContext(PerEntityCrawlerBase.java:67)
at com.salespredict.crawlers.pipeline.PerEntityCrawlerBase.createParameterValues(PerEntityCrawlerBase.java:39)
at com.salespredict.crawlers.pipeline.PerEntityEnricher.processBatch(PerEntityEnricher.java:23)
at com.salespredict.crawlers.pipeline.EnrichersPipeline.processBatch(EnrichersPipeline.java:117)
at com.salespredict.crawlers.pipeline.EnrichersPipeline.processAllEntities(EnrichersPipeline.java:95)
at com.salespredict.integration.EnrichersPipelineTest$$anonfun$5.apply$mcV$sp(EnrichersPipelineTest.scala:99)
at com.salespredict.integration.EnrichersPipelineTest$$anonfun$5.apply(EnrichersPipelineTest.scala:99)
at com.salespredict.integration.EnrichersPipelineTest$$anonfun$5.apply(EnrichersPipelineTest.scala:99)
at org.scalatest.FunSuite$$anon$1.apply(FunSuite.scala:1265)
at org.scalatest.Suite$class.withFixture(Suite.scala:1974)


Affects: 1.0 M1

Referenced from: commits d1779a5

Bad handling of non ASCII Strings [DATACOUCH-43]

Pavel Bernshtam opened DATACOUCH-43 and commented

If I have a non ASCII String (like a String with Russian or just Nestlé), sometimes it is encoded in bad way (it become in couchbase NestlГ©_)
Next time I load and save again it become even longer and after few load/update/save I receive OutOfMemory Exception.

The problem IMHO in the class JacksonTranslationService:

@Override
public final Object encode(final CouchbaseStorable source) {
OutputStream stream = new ByteArrayOutputStream();

try {
  JsonGenerator generator = factory.createGenerator(stream, JsonEncoding.UTF8);
  encodeRecursive(source, generator);
  generator.close();
} catch (IOException ex) {
  throw new RuntimeException("Could not encode JSON", ex);
}

return stream.toString();

}

You should use here Writer, not OutputStream or use ByteArrayOutputStream.toString("UTF-8")

It is very critical for my company, can you please fix it and release a version with the fix in maven repo?

Thank you


Affects: 1.0 M1

Referenced from: commits 5b6e876

Cache TTL (Time To Live) property required. [DATACOUCH-25]

Krishna Suvarna opened DATACOUCH-25 and commented

Ability to set TTL in spring config is required like in Hazelcast.
Currently CouchbaseCache.java uses 0 as TTL (expire time). Need to have it as property to configure the cache expire time.

public final void put(final Object key, final Object value) {
String documentId = key.toString();
client.set(documentId, 0, value);
}


Affects: 1.0 M1

Referenced from: commits ff15112

MappingCouchbaseConverter skips ID field in read operation [DATACOUCH-27]

Maciej Zasada opened DATACOUCH-27 and commented

@Id annotated field is skipped by MappingCouchbaseConverter during convertion from CouchbaseDocument.

i.e. the following test will fail:

  @Test
  public void readsID() {
    // given:
    CouchbaseDocument converted = new CouchbaseDocument("001");

    // when:
    BasicCouchbasePersistentPropertyTests.Beer beer = converter.read(BasicCouchbasePersistentPropertyTests.Beer.class,
        converted);

    // then:
    assertEquals("001", beer.getId());
  }

IMO the problem lays in the following snippet:

 entity.doWithProperties(new PropertyHandler<CouchbasePersistentProperty>() {
      public void doWithPersistentProperty(final CouchbasePersistentProperty prop) {
        if (!source.containsKey(prop.getFieldName()) || entity.isConstructorArgument(prop)) {
          return;
        }

        Object obj = prop.isIdProperty() ? source.getId() : getValueInternal(prop, source, evaluator, result);
        wrapper.setProperty(prop, obj, useFieldAccessOnly);
      }
    });

Codition !source.containsKey(prop.getFieldName()) || entity.isConstructorArgument(prop) will be satisfied while processing @Id field, so it'll be skipped in the process


Affects: 1.0 M1

Referenced from: commits c4aa364, 8ade609, c62ad42, 0fa284e

ObjectMapper configuration must be supported [DATACOUCH-30]

Anton Oparin opened DATACOUCH-30 and commented

I have a configured Jackson ObjectMapper, which I use through out my application for JSON (de)serialization. Currently I am thinking of switching to couchbase for some of my entities (using spring-data-couchbase specifically), and for that I need it to use my ObjectMapper as well, which seems to not to be supported currently


Referenced from: commits 7d79d79

Connecting to multiple buckets fails [DATACOUCH-47]

Pavel Bekkerman opened DATACOUCH-47 and commented

I have some thin like:

<data-couchbase:couchbase id="aDB" bucket="a" password="a" host="localhost" />
<data-couchbase:couchbase id="bDB" bucket="b" password="b" host="localhost" />

<data-couchbase:template id="aTemplate" db-ref="aDB" />
<data-couchbase:template id="bTemplate" db-ref="bDB" />

<data-couchbase:repositories base-package="com.example" couchbase-template-ref="aTemplate">
<data-repository:include-filter type="regex" expression=".*ARepository" />
</data-couchbase:repositories>
<data-couchbase:repositories base-package="com.example" couchbase-template-ref="bTemplate">
<data-repository:include-filter type="regex" expression=".*BRepository" />
</data-couchbase:repositories>

When I run test they fail:
...
Caused by: com.couchbase.client.vbucket.ConfigurationException: Configuration for bucket "b" was not found in server list (http://localhost:8091/pools).
at com.couchbase.client.vbucket.ConfigurationProviderHTTP.readPools(ConfigurationProviderHTTP.java:274)
...

Now, If I remove all the configurations for bucket/template/repo B - all starts to work great for the remaining A!!!


Referenced from: commits 9c3cc52

CouchbaseTemplate#findByView is always including documents in ViewResponse. [DATACOUCH-28]

Maciej Zasada opened DATACOUCH-28 and commented

We have the couchbase view which does JSON transformation (removing unnecessary fields, etc). When using

org.springframework.data.couchbase.core.CouchbaseTemplate#findByView

we can't specify to not include whole documents in the ViewResponse. It seems that problematic code snippet is:

if (!query.willIncludeDocs()) {
  query.setIncludeDocs(true);
}

which will always end up with setting query.setIncludeDocs(true). It would be useful, if one could disable this option on demand, e.g. for performance reasons


Affects: 1.0 M1

Deleted document continues to get listed in Console but [DATACOUCH-48]

deepak vohra opened DATACOUCH-48 and commented

If a document is deleted from repository with the deleteAll() or
delete(Iterable<? extends T> entities) methods of CrudRepository the document continues to get listed in Console. The document IDs also get included in the count() method. But, when the document ID is clicked in the Console the error shown in Console gets generated.
http://i763.photobucket.com/albums/xx277/dvohra10/deleted_document_zpse53cbfb9.jpg


No further details from DATACOUCH-48

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.