我构建了一个java class
,因为我可以使用Hibernate
。当我选择NetBeans
选项:“clean and build
”时,系统会向我显示下一个问题:
Note: /home/.../NewHibernateUtil.java uses or overrides a deprecated API.
这是我的类NewHibernateUtil:
package bean.utilitaria;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.SessionFactory;
public class NewHibernateUtil {
private static final SessionFactory sessionFactory;
static {
try {
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
} catch (Throwable ex) {
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
}
我如何纠正这个问题?
谢谢!