org hibernate AnnotationException No identifier specified for entity

org hibernate AnnotationException No identifier specified for entity

While working with Hibernate with Java its very common exception “org hibernate AnnotationException No identifier specified for entity” during application startup. This happens if you model class defined as @entity and column mapping has not been done with matching table attribute and you get exception as below:

  • Solution: To fix this problem you will have to map java class attribute with table column mapping as below based on you table definition:

 

Reference:

Leave a Reply

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