1

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 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;
    }

public class Universe{
Map<Foo, <List<List<Cone>>> bar;
}

Couchbase entity class is using

private List<Universe> universe;
Priya
  • 11
  • 2

0 Answers0