question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MappingCouchbaseConverter.read() is not recursive

See original GitHub issue

Using Cluster.query() I’m parsing the result into classes that have child object. A quick exemple to visualise :

@Data
public class A {
    String someProp;
    SubA nestedObject;

    @Data
    public static SubA() {
        String someNestedProp;
    }
}

Doing converter.read(A.class, document) leads to nestedObject being a HashMap<String, String> instead of a SubA as anyone would expect. Am I doing this wrong or are my expectations correct ?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:22

github_iconTop GitHub Comments

1reaction
mikereichecommented, Feb 10, 2022

I’m going to keep this open as someone else hit this and I need to update the documentation.

0reactions
mikereichecommented, Feb 11, 2022

There are samples in src/test/java/org/springframework/data/couchbase/repository/query/CouchbaseRepositoryQuerydslIntegrationTests.java They run with

  1. changing src/test/resources/integration.properties cluster.type=unmanaged cluster.unmanaged.seed=10.144.220.101:8091
  2. mvn integration-test -Dit.test=CouchbaseRepositoryQuerydslIntegrationTests

Bonus - to only create the bucket once and not delete it at the end of the tests.

src/test/java/org/springframework/data/couchbase/util/UnmanagedTestCluster.java 63 bucketname = “my_bucket”; // UUID.randomUUID().toString();

Read more comments on GitHub >

github_iconTop Results From Across the Web

MappingCouchbaseConverter (Spring Data Couchbase 5.0.0 ...
The converter is responsible for reading from and writing to entities and converting it into a consumable database representation.
Read more >
Non recursive scan for packages in Spring - Stack Overflow
Apparently, AnnotationConfigApplicationContext#scan() scans for packages recursively. I am not sure of it, but one of my @Component classes ...
Read more >
org.springframework.data.couchbase.core.mapping ...
Retruns the size of the attributes in this and recursive documents. verifyValueType. Verifies that only values of a certain and supported type can...
Read more >
Recursion is not hard: a step-by-step walkthrough of this ...
The base case is false, so enter the recursive condition. The execution stack places factorial() a second time with num-1 = 4 as...
Read more >
Java 8 fast non recursive fibonacci - Softhints
The method next() calculate the next element of the sequence. In the main we instantiate new Fibon object and when call method next()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found