hibernate exception: org.hibernate.AnnotationException: No identifier specified for entity

Well today at work I faced an error in  Eclipse’s console: hibernate exception: org.hibernate.AnnotationException: No identifier specified for entity which leaded me to google to find info. It happened, because i forgot to identify the @Id annotation on the index of the table. Sample code is:

@Id
@Column(name="PERSONNEL_NUMBER")
@GeneratedValue(generator = "Default_Generator")
@SequenceGenerator(name="Default_Generator", sequenceName="HIBERNATE_SEQUENCE")
private String personnelNumber;

Leave a Reply

Your email address will not be published. Required fields are marked *