Hibernate @ Embedded in @Embeddable ignore annotation?

I'm trying to use @Embeddable

internally annother @Embeddable

which is supported as per spec, however, it looks like the JPA annotation in the class Code

below is being ignored. Enumeration (de) is converted in ordinal order instead of string representation. I can think of a few workarounds, but that's not a problem. I am trying to figure out what I am doing wrong.

I am using hibernate 4.2.5 with Spring 3.2.4

public class ExampleEntity implements Serializable {

    private Long id;

    @ElementCollection(fetch = EAGER)
    private Set<ExampleEmbeddable> embeddables = new HashSet<>();

    // This enum is (de)serialized as a string just fine
    private AnotherEnum another;

    private String stuff;

public class ExampleEmbeddable implements Serializable {

    private Code code;

    // This enum is (de)serialized as a string just fine
    private StatusEnum status;

public class Code implements Serializable {

    public enum Version {

    private String code;

    //Why is this enum is (de)serialized by ordinal?
    private Version version;



source to share

1 answer

I can confirm that I have the same error in the newest version of SpringBoot (!!!) 2.1.4.RELEASE Can anyone provide a working way or confirm that this is not a bug?



All Articles