I have a User class, which extends Model, and two classes that I want to extend the User class.
User.java:
@Entity
@Table(name = "users")
public class User extends Model implements RoleHolder {
private static final long serialVersionUID = 1L;
@Id
public Long id;
...
Driver.java:
public class Driver extends User {
...
Customer.java:
public class Customer extends User {
...
Edit All three entities need to be directly accessed. To say it another way, I have Users, Customers, and Drivers; Customers and Drivers just happen to share all of the properties of a User. Therefore, I need to have a valid User entity as well as Customer and Driver.
I need to be able to get a list of all Users (including Customers and Drivers).
I haven't been able to figure out how to make this work using ebean
in Play. How can I do this?