The statement is ambiguous.The primary key must be defined on the entity that is the root of the entity hierarchy or on a mapped superclass of the entity hierarchy.
In case when mapped superclass is in the middle of entity hierarchy, the primary key should be at the root of entity hierarchy.