I have the following inheritance hierarchy:
Task | SpecificTask | VerySpecificTask
And I would like it to continue to use unidirectional inheritance, so I annotated the classes:
@Entity @Table(name="task") @Inheritance(strategy=InheritanceType.SINGLE_TABLE) public class Task @Entity public class SpecificTask extends Task @Entity public class VerySpecificTask extends SpecificTask
When I try to save an object of the VerySpecificTask class, I get an error message:
Unable to resolve entity name from Class [com.application.task.VerySpecificTask] expected instance/subclass of [com.application.task.Task]
How am I wrong? Can multilevel inheritance be matched with a separate table?
EDIT: There was a lame mistake here, I quickly decided, so I deleted it so as not to spoil this question.
source share