I'm creating an utility in Spring Boot to connect and insert/upsert data into the couchbase in the more generic way possible.
I have something like this:
public interface GenericRepository extends CouchbaseRepository<MyClass, String> {
}
Where I have MyClass I would like to accept any kind of document to insert into couchbase.
I have tried some things like using the generic type T but without success because I got the following error:
Caused by: org.springframework.data.mapping.MappingException: Couldn't find PersistentEntity for type class java.lang.Object!
My structure is: service (interface/impl) > DAO (interface/impl) > repository
Extra info: Across the above model I am passing a Generic type T. I am calling the service with my Pojo with the @Document annotation.
The goal is to remove the "dependency" of having one repository class for each type of Document.