hibernate是JPA的一种标准实现,所以为了符合标准,建议使用JPA注解。特殊情况下可以使用hibernate自身注解,注意JPA包是hibernate的必须jar包,必须导入。
Hibernate JPA依赖的JAR包:
1、Hibernate核心包(8个文件)
hibernate-distribution-3.3.1.GA
hibernate3.jar
lib\bytecode\cglib\hibernate-cglib-repack-2.1_3..jar
lib\required\*.jar
2、Hibernate注解包(3个文件)
hibernate-annotations-3.4.0.GA
hibernate-annotations.jar
lib\ejb3-persistence.jar
hibernate-commons-annotations.jar
3、Hibernate针对JPA的实现包(3个文件)
hibernate-entitymanager-3.4.0.GA
hibernate-entitymanager.jar
lib\test\log4j.jar
slf4j-log4j12.jar