Skip to Main Content

Java and JavaScript in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Saving enum name in couchbase from oracle

User_XDUAPNov 16 2021

I am working on spring data couchbase application.In oracle its saving the enum with name but in couchbase its value. I want to save enum name in couchbase instead of its value. But i dont want to change this below existing code. Is there any way to do that? And the enum is not a direct field in document. Its a key value in key value of map of other attribute

public enum Foo {
    Moon("Night"),
    Star("Night"),
    Sun("Day");

    private String value;
    Foo(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    @Override
    public String toString() {
        return this.value;
    }
Comments
Post Details
Added on Nov 16 2021
1 comment
147 views