Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Annotation

 
S Subbu
Ranch Hand
Posts: 87
jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am new to Hibernate and using annotation for mapping.

My Problem is what is relation between javax.persistence and org.hibernate.annotations

I am using @Table annotation by importing org.hibernate.annotations it was not working well. If i import javax.presistence.Table my program working well.

What is the different between these two packages. When i go to presistence package and when i move to hibernate package.

Please Explain Basic Standard Using hibernate with annotations.

 
S Subbu
Ranch Hand
Posts: 87
jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Any Body there please clarrify my doubt.
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to admit that it is confusing.

for the short answer, the hibernate FAQ (https://community.jboss.org/wiki/HibernateFAQ-HibernateAnnotationsFAQ#I_use_orghibernateannotationsEntity_and_get_an_Unknown_entity_exception)

says:
Always import @javax.persistence.Entity

@org.hibernate.annotations.Entity completes @javax.persistence.Entity but is not a replacement


Hibernate conforms to the JPA specificiations and then adds a bit. So basic standard hibernate will use javax.persistence.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic