• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Annotation dilema

 
camelia codarcea
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

I am reading about annotations, and I can't figure out the difference between EJB3 annotations, Hibernate annotations and JDK5 annotations.
All three have the same tags: @Id, @one-to-many etc
Can anyone explain to me, or is there a good tutorial about annotations ?

thank you
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't recall a JDK 5 Annotation @Id. But that doesn't matter Annotations are actually still class, and classes that can have the same name, but in different packages.

So there could be an @Id that is in a JDK package and one in the JPA package and even a seperate one in Hibernate. But the Hibernate and JPA annotations should be one and the same and in the same package, because Hibernate implements the JPA Specification. Just to claify I am using the JPA name instead of EJB3, because those EJB3 annotations you mentioned are part of the JPA spec which is included under EJB3.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic