Questions tagged [spring-data-couchbase]

Spring Data Couchbase project provides Spring Developers a POJO centric model for interacting with documents stored in Couchbase.

Developers use a Repository style data access pattern and Spring Data Couchbase adds query derivation based on N1QL (a superset of SQL), support for Spring configuration of the database client, and the ability to support the @Cacheable annotation building on the Spring Cache project.

Resources

Related tags

380 questions
3
votes
1 answer

Why ORDER BY in Java N1QL not working as intended

When I run SELECT * FROM projects ORDER BY createdAt desc this query in Couchbase Web UI result ordered by as it should be but not in java. Java Code @Override public List getAllProjects(String requestedOrder, Integer page, Integer…
3
votes
0 answers

Spring Data Couchbase use different object mapper for template and CrudRepository

I have a weird behavior using SpringDataCouchbase maybe you can help me to understand. Context I'm using Spring-data-couchbase (v.3.1.9.RELEASE) with SpringBoot 2. My application has an entity with a LocalDate field like @Getter @Setter class…
Hernán Tenjo
  • 179
  • 2
  • 12
3
votes
1 answer

add transaction manager for a Couchbase app. in a SpringBoot 2 app for Junit tests

I have a SpringBoot 2 app that uses using Couchbase as a database with Spring Data Couchbase I wnt to add a transaction manager to add the annotation @Transactional in the test to do the rollback, otherwise I get this…
3
votes
1 answer

Spring Data for Couchbase: use of AND ANY ... SATISFIES

I have a SpringBoot 2 app that uses using Couchbase as a database, Spring-Boot and Spring-Data and Lombok fot the getters and equals method I have created this Repository @ViewIndexed(designDoc = "bendicionesDoc") public interface BenRepository…
3
votes
2 answers

Spring Data for Couchbase - Counting element in the DB

I am new using Spring Data for Couchbase, I defined this object public class Building { @NotNull @Id private String id; @NotNull @Field private String name; @NotNull @Field private String companyId; } I want…
3
votes
0 answers

How to access Couchbase RAW document with spring-boot-couchbase CrudRepository

I am migrating an old application from using the Couchbase java client, 2.2.5 to Spring-boot-couchbase. I would like to use Spring Data's Crud Repository. The problem I am running into is that the document in Couchbase is RAW format, (See more info…
3
votes
1 answer

Nested reference object is persisting as null

I am trying to store below pojo in couchbase with spring-data, but persist json is storing "user field of type User" as null. @JsonInclude(value = Include.NON_EMPTY) @Document public class ProjectXYZ { @Id @GeneratedValue(strategy =…
RTA
  • 31
  • 4
3
votes
2 answers

Couchbase internals

One question regarding data fetching approach, First Approach: Let say I have two document userdoc1 { “status”:“pending” “usertype”:“VIP” “userid”:“123” } for above document let say my documentid is status::usertype [just to clarify,this document…
Bifrost
  • 417
  • 5
  • 23
3
votes
1 answer

How can I place a n1ql query with variables in a spring @Query annotation?

I have the following N1QL query: UPDATE `bucket` SET b.terms.min_due.`value` = "12345" FOR b IN balances END WHERE entry_id = "12345" I want to place it in an @Query annotated repository method, but the values for value and entry_id need to be…
Skywarp
  • 989
  • 3
  • 15
  • 32
3
votes
1 answer

Spring Data Couchbase Connecting via SSL

Is it possible to configure spring-data-couchbase to connect via SSL? I have found documentation for how to do this via the SDK, but not in spring-data-couchbase 3.1.4-RELEASE
Lewis Watson
  • 543
  • 1
  • 4
  • 15
3
votes
2 answers

org.springframework.data.mapping.model.MappingInstantiationException: Failed to instantiate object with new boolean field

My Spring-Boot & Couchbase app has a Cat object in the DB. In a new app version, we added new boolean field to out Cat document object: @RequiredArgsConstructor @AllArgsConstructor(onConstructor =…
riorio
  • 6,500
  • 7
  • 47
  • 100
3
votes
1 answer

MappingException for Map type of data

While saving Map type data in couchBase I am getting an exception Caused by: org.springframework.data.mapping.MappingException: Couldn't find PersistentEntity for type java.lang.Object! I've taken a map in DataModel @Data public class test { …
sandy
  • 1,153
  • 7
  • 21
  • 39
3
votes
2 answers

Case insensitive document ID matching in Couchbase

I'm using com.couchbase.client maven dependency in java spring project. I fetch a couchbase document from code in following way: JsonDocument document = bucket.get(id); //matches id case sensitively But i've got a new requirement. I have to fetch…
3
votes
1 answer

Couchbase & Spring query error: "Query returning a primitive type are expected to return exactly 1 result, got X"

In our spring-boot 2.0.4.RELEASE application, we are using Couchbase version 5.5.1 build 3511 with Spring. We added a new delete method to the Repository interface: public interface CatRepository extends CouchbaseRepository { long…
riorio
  • 6,500
  • 7
  • 47
  • 100
3
votes
0 answers

Spring Data CouchbaseTemplate and setWriteResultChecking

There is a feature on the CouchbaseTemplate class in Spring Data Couchbase to set how exceptions are handled on writes, using the setWriteResultChecking method. There doesn't seem to be any information on this in the documentation. If you dig into…
A_M
  • 7,693
  • 6
  • 33
  • 37
1 2
3
25 26