Hi all I was trying to use hibernate annotations for the first time. I have created three classes: BaseEntity, Org and Chaine. Both Org and Chaine extends BaseEntity.
public class BaseEntity { @Column(name= "name") private String name; @Id private Integer id; }
@Entity @Table(name="chaine") public class Chaine extends BaseEntity {
}
@Entity @Table(name = "Org") public class Org extends BaseEntity { @Column(name="email") private String email; }
I have getters and setter in all classes. But when I want to persist one of the entities I got the error (Initial SessionFactory creation failed.org.hibernate.AnnotationException: No identifier specified for entity:......)
If I add the attribute id with annotation @Id in Org for example, it worked. How can I make hibernate see the Id in BaseEntity and use it?
Thank you for your help.
|