single table inheritance hibernate code example
Example 1: https://www.baeldung.com/hibernate-inheritance
@MappedSuperclass
public class Person {
@Id
private long personId;
private String name;
// constructor, getters, setters
}
Example 2: https://www.baeldung.com/hibernate-inheritance
@Entity
public class MyEmployee extends Person {
private String company;
// constructor, getters, setters
}