标签:
The JPA spec. defines the JPA annotation in the javax.persistence
package. Hibernate not only implements JPA spec , but extends it to adds more features . So , hibernate creates their own annotations which just extend the JPA annotation with the Hibernate features , and put these annotation inside the package org.hibernate.annotations
If there are no Hibernate specified features added for that JPA annotation (eg @OneToMany
and @ManyToOne
) , Hibernate will not make that annotation in their org.hibernate.annotations
package and you have to use these annotation from javax.persistence
according to the JPA specification.
Normally ,people will use JPA annotations until they come across a situation that requires to use hibernate features.
javax.persistence
package.关于注解-Hebernate与JPA(java persistence api)
标签:
原文地址:http://www.cnblogs.com/nickhan/p/4897087.html