Hi,
I have a hierarchy similar to the following:
Code:
abstract class Person {
private String firstname;
private String lastname;
//getters & setters
}
class User extends Person {
private String username;
private String password;
//getters & setters
}
class Visitor extends Person {
private Date visitDate;
//getters & setters
}
As you can see,
I don't want to be possible to make an instance of a Person, but only Users and Visitors.
How can I map this into entites that can perform CRUD actions? And, how the actual tables in the DB would look like?
Thanks in advance,
IP