Hibernate: point foreign_key of table to secondary table
问题 I have three classes: PlanItem Task SubTask It has the following hierachy: public abstract class PlanItem {...} public class Task extends PlanItem { ... private Set<SubTask> subTasks; ... } public class SubTask {...} I am using hibernate to generate three tables: "PlanItem", "Task" and "SubTask". @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public abstract class PlanItem { @Id private String id; } @Entity @SecondaryTable( name = "Task" ) public class Task extends PlanItem {