hibernate3.6.7中使用annotation的问题
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
public class HibernateUtil {
private static SessionFactory sf;
static {
sf = new AnnotationConfiguration().configure().buildSessionFactory();
}
public static SessionFactory getSessionFactory() {
return sf;
}
}
上面的AnnotationConfiguration;是划掉的,也就是说AnnotationConfiguration这个类过时了,请问这里使用的是哪个包?
------解决方案--------------------
org.hibernate.cfg
Class AnnotationConfiguration
java.lang.Object
org.hibernate.cfg.
Configuration org.hibernate.cfg.AnnotationConfiguration
All Implemented Interfaces:
Serializable
--------------------------------------------
Deprecated. All functionality has been moved to Configuration
描述是所有的操作都转移至Configuration,所以你直接使用Configuration就可以了。
顺便发一下3.6的JAVADOC:
Hibernate 3.6.0: http://download.csdn.net/detail/fainfy/3605025