编写前需要准备的包。

hibernate-distribution-3.3.2.GA

hibernate-annotations-3.4.0.GA

slf4j

导入相关依赖包

Hibernate HOME

/hibernate3.jar

/lib/bytecode(二进制)

/lib/optional(可选的)

/lib/required(必须的)

导入required下的所有jar

antlr-2.7.6.jar

commons-collections-3.1.jar

dom4j-1.6.1.jar

hibernate3.jar

javassist-3.9.0.GA.jar

jta-1.1.jar

slf4j-api-1.5.10.jar

slf4j-log4j12-1.5.10.jar

log4j-1.2.14.jar

mysql.jar

---Annotation

ejb3-persistence.jar

hibernate-annotations.jar

hibernate-commons-annotations.jar

 

 

最后LIB里面要导入jar

antlr-2.7.6.jar

commons-collections-3.1.jar

dom4j-1.6.1.jar

ejb3-persistence.jar

hibernate-annotations.jar

hibernate-commons-annotations.jar

hibernate3.jar

javassist-3.9.0.GA.jar

jta-1.1.jar

log4j-1.2.14.jar

mysql.jar

slf4j-api-1.5.10.jar

slf4j-log4j12-1.5.10.jar