コードを JPA に更新していますが、ディスクリミネーターを使用するとエラーが発生します
@Entity
@DiscriminatorValue("3")
public class WidgetContainer extends Square {
...
}
Square.java
@Entity
@Table(name = "square")
@DiscriminatorColumn(name = "squareType", discriminatorType = DiscriminatorType.INTEGER)
@DiscriminatorValue("0")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public class Square implements Indexable, Serializable{
...
}
このエラーが発生します
org.hibernate.WrongClassException: Object with id: 1 was not of the specified subclass: sym.domain.Square (Discriminator: 3)