aspose file tools
The moose likes Object Relational Mapping and the fly likes Hibernate Annotation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


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

Hibernate Annotation

S Subbu
Ranch Hand

Joined: Mar 20, 2012
Posts: 87

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

Joined: Mar 20, 2012
Posts: 87

Hello Any Body there please clarrify my doubt.
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 819

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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Hibernate Annotation
 
Similar Threads
Null Pointer Exception using DAO, Hibernate and Struts
What are the basic difference between javax.persistence and org.ibrenate.annotaton, in hibernate
hibernate search indexing not working
Confusion between PreDestroy and Remove annotation
SQLGrammarException