Freephone Panwal
Freephone Panwal

Reputation: 1591

Override value of "_class" attribute in Spring Data Couchbase

I'm trying to use Spring Data Couchbase with spring boot v2.0 & came across the post How to use spring data with couchbase without _class attribute, however, I don't see any response.

Spring data by default uses _class to store fully qualified class name as its value. I was able to change the key from _class to _mytype but I'm not able to change the value from fully qualified class name to any custom string.

Has Spring Data Couchbase library stopped supporting this feature? Any sample code snippet would be helpful.

Thanks!

Upvotes: 1

Views: 891

Answers (2)

this is the response I received today from Couchbase after submitting a request issue:

Hi Carlos,

Thank you for your patience while I have been investigating your question.

I have been discussing this with our Development Team here who manage Spring Data for Couchbase to determine if this is possible. At this time, it is currently not possible to change the value of the _class field to be a non-qualified class name. However, with that being said, this is an intended feature due to be added in the future alongside our upcoming SDK 3 release, tentatively due for release in early 2020. This functionality is tracked by DATACOUCH-399 : Allow for using @TypeAlias annotations on Spring Data's public Jira which you can use to follow this development.

As there is nothing further for Couchbase Technical Support to do concerning this issue, we will be marking this support case as solved. If you experience any issues unrelated to this support case, please do raise a new ticket and Couchbase Technical Support will assist you as soon as possible.

Thanks, Thomas.

Upvotes: 1

deniswsrosa
deniswsrosa

Reputation: 2460

Unfortunately, changing the value from fully qualified class name to any custom string is not supported yet. It is however, a feature that will be included in one of the next releases.

Upvotes: 0

Related Questions