Whenever I am trying to get suggestions of @Entity annotation in Spring Tool Suit, I am just not finding it , be it suggestion from javax.persistence, or from org.hibernate.annotations,
I even have Hibernate dependency in my pom.xml
image_2024-05-04_231037154.png
What I was expecting
image_2024-05-04_231100289.png
What I am getting instead
Passion and Vision are like Scalar and Vector Quantities, Sir Tesla had Both
javax.persistence has been superseded by jakarta.persistence, and org.hibernate.annotations.Entity has been deprecated in favor of jakarta.persistence.Entity.
In short, what you were expecting is outdated. Use the annotation that your IDE suggests.
I have added dependencies of H2 database and Hibernate in my file
to add Hibernate dependency I went to hibernate's homepage hibernate.org and from there followed this getting started guide of how to Obtain Hibernate using Maven Dependency which showed me the code snippet, I added this snippet inside my dependency tag in my xml file
And to add H2 database dependency I took help of mvnrepository.com
Did I do it right ??
Passion and Vision are like Scalar and Vector Quantities, Sir Tesla had Both
If your goal is to use only JPA features in your application, then it's better to add a compile-time dependency on Jakarta JPA, and a runtime dependency on Hibernate:
Also, I don't see this @Entity annotation from org.hibernate.annotations, does that mean I have not included hibernate dependency in my xml file??, despite adding this code snippet :
Passion and Vision are like Scalar and Vector Quantities, Sir Tesla had Both