1

I have come across articles explaining about hibernate annotations like (@Entity,@Id). Are these annotations implemented in hibernate or are they from Java persistence API?

What if we decide to use some other ORM tool. Then do we have to change all the annotations to suit the other ORM tool? or no change needs to be done in source code(including annotations)

DesirePRG
  • 6,122
  • 15
  • 69
  • 114
  • 1
    If an annotation is from `javax.persistence.*` package, it is JPA annotation and will (or at least would) be processed properly in any JPA implementation. Another, Hibernate-specific (like `@NaturalId` for example) won't. – Alex Salauyou Mar 11 '15 at 09:30

1 Answers1

0

Some of these annotations are both in hibernate and JPA..

if we use javax.persistence there is no need to change the code. This is the main difference between org.hibernate.annotations and javax persistence

Difference between JPA Entity and Hibernate Entity

Hibernate annotation or XML configuration

Community
  • 1
  • 1
Paul John
  • 1,626
  • 1
  • 13
  • 15