Middle — Senior
Displaying the hierarchy of JPA entities in database tables
livecode
Task condition
The example shows an inheritance relationship between the entities User, Customer, Employee, and Admin. It is required to model this hierarchy of JPA entities so that it is correctly implemented at the database level.
@Entity class User { int field1; ... }
@Entity class Customer extends User { int field2; ... }
@Entity class Employee extends User { int field3; ... }
@Entity class Admin extends Employee { int field4; ... }