His general understanding of misses, I also had the same doubt once ..
This is what really happens in explicit polymorphism.
Polymorphism explicitly applies only to root objects and prevents queries that name (unmapped) superclasses to return mapped sub entities
In your case, if Entity Class Nodes were not displayed and Persons were with a pronounced polymorphism, then Nodes will not return people Elements .
Take a look at this code.
@Entity @Table(name="Nodes") @Inheritance(strategy = InheritanceType.JOINED) public class Node implements Serializable { ... } @Entity @Polymorphism(type= PolymorphismType.EXPLICIT) @Table(name="Persons") public class Person extends Node { } @Entity @Polymorphism(type= PolymorphismType.EXPLICIT) @Table(name="Networks") public class Network extends Node { }
This is basically the opposite of what everyone has in mind. !!
Dileep
source share