JPA @Embeddable inheritance with discriminator column

Viewed 337

I'm trying to use an embeddable hierarcy like:

@Entity
public class MyEntity{
   private MyEmbedded member;
}

@Embeddable
@Inheritance
@DiscriminatorColumn(name ="TYPE")
public abstract class MyEmbedded{
    protected String type;
}

@Embeddable
@DiscriminatorValue('1')
public class MyEmbeddedImpl1{...}

@Embeddable
@DiscriminatorValue('2')
public class MyEmbeddedImpl2{...}

TopLink / EclipseLink : Support inheritance with embeddables. This is set through using a DescriptorCustomizer and the InheritancePolicy

How can I acomplish this with JPA and Hibernate?

0 Answers
Related