I have class A with subclasses B and C.
I am using InheritanceType.SINGLE_TABLE and one column, type, is being used as DiscriminatorColumn.
Earlier, class B has DiscriminatorValue("1") and class C has DiscriminatorValue("2"). I have some 100+ entries in the table and all was working fine.
Now, I have created one more subclass of A, D. But I wanted it to have DiscriminatorValue("1"), so I changed DiscriminatorValues of B and C to 2 and 4 respectively.
I also updated the database column type with appropriate values.
But now when I run the application, I am getting following exception:
org.hibernate.WrongClassException: Object with id: 9 was not of the
specified subclass: com.example.D (Discriminator: 1)
What would be the problem?