This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Annotation dilema Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Annotation dilema" Watch "Annotation dilema" New topic
Author

Annotation dilema

camelia codarcea
Ranch Hand

Joined: May 08, 2007
Posts: 36
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


SCJP 5.0 .... 97%
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17271
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Annotation dilema
 
jQuery in Action, 3rd edition