Git Product home page Git Product logo

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

View Code? Open in Web Editor NEW
272.0 272.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 People

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

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

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

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

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

support getting multiple keys through asyncGetBulk [DATACOUCH-68]

David van Geest opened DATACOUCH-68 and commented

I'm wondering if Spring Data Couchbase could provide a way to get multiple documents using their keys. The CouchbaseClient supports this through the asyncGetBulk and getBulk methods, if I'm not mistaken.

I realize that the same end result (get multiple docs in one query) could be accomplished by using views. But, in my opinion, this is an overly complicated approach. It requires setting up design docs and views on the server, which makes me feel like I'm using a traditional RDBMS which needs to be migrated to modify the schema (views). This is something I want to avoid. I would also like to avoid having to deal with the complexity of stale indexes, etc.

Ideally, the CouchbaseRepository would provide a findMany(java.util.Collection<java.lang.String> keys) method which would return a collection of objects


Affects: 1.0 M2

Issue Links:

  • DATACOUCH-193 Make batch kv operations in repo and template use async
    ("is superseded by")

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

support optimistic locking through CAS methods [DATACOUCH-63]

David van Geest opened DATACOUCH-63 and commented

From looking at https://github.com/spring-projects/spring-data-couchbase/blob/master/src/main/java/org/springframework/data/couchbase/core/CouchbaseTemplate.java, it does not appear that any optimistic locking is implemented.

Personally, I think this is a pretty important feature. People using Couchbase and Java are likely in a high-concurrency environment.

Has supporting optimistic locking been considered at all? Any ideas on how it should be implemented? I may be willing to take a stab at it if it's not huge


Affects: 1.0 M2

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

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

Bundle could not be resolved in non J2SE-1.6 runtime environment [DATACOUCH-70]

Keith Lee opened DATACOUCH-70 and commented

Exception:
An Import-Package could not be resolved. Resolver error data
constraint: Import-Package: org.springframework.data.couchbase.config; version="0.0.0"
A bundle could not be resolved because the required execution enviroment did not match the runtime environment. Resolver error data Bundle-RequiredExecutionEnvironment: J2SE-1.6

Bundle-RequiredExecutionEnvironment is NOT lower boundary:
http://wiki.osgi.org/wiki/Bundle-RequiredExecutionEnvironment

Look also at
http://sourceforge.net/p/joda-time/bugs/110/

(Would suggest removing the line from manifest instead of adding more values)


Referenced from: commits d65f42d

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

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

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

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.