Reputation: 935
I am trying to understand how to properly annotate a base class and the extending class with Morphia. Given the following example would I @Entity
to the Employee class or just the Developer class?
public abstract class Employee {
@Property
private String firstName;
@Property
private String lastName;
@Property
private Date startDate;
}
@Entity
public class Developer extends Employee{
@Embedded
private List<String> ProjectList;
}
Upvotes: 0
Views: 935
Reputation: 10859
@Property
annotationsEmployee
. Since you don't have a schema, both approaches are perfectly fine and it only dependes on how you want to access your data later on.Upvotes: 1