I have a class A with subclasses B and the C .
I use InheritanceType.SINGLE_TABLE , and a single column type is used as DiscriminatorColumn.
Class B used to have DiscriminatorValue ("1") , and class C had DiscriminatorValue ("2") . I have another 100 entries in the table and everything is working fine.
Now I created another subclass of A , D . But I wanted him to have DisccriminatorValue ( "1") , so I changed DiscriminatorValues Bed and and C 2 and 4, respectively.
I also updated the database column with corresponding values.
But now, when I run the application, I get the following exception:
org.hibernate.WrongClassException: Object with id: 9 was not of the
specified subclass: com.example.D (Discriminator: 1)
What is the problem?
source
share