1
我有以下的Java代码:弃用春AnnotationConfiguration
package modelo.util;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.SessionFactory;
public class HibernateUtil {
private static final SessionFactory sessionFactory;
static {
try {
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
} catch (Throwable ex) {
// Log the exception.
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
}
请问以下行弃用上面的代码:
import org.hibernate.cfg.AnnotationConfiguration;
...= new AnnotationConfiguration().configure().buildSessionFactory();
我与hibernate 4.3.1
和Netbeans
工作。
感谢
我变了,现在只标注 –
看的这张照片,对不起,我还没有为编辑我的最后评论 https://s24.postimg.org/wzuf43kxx/2222.png –
>大家好, >林privilegies遵循本指南: > https://www.youtube.com/watch?v=Zb2cW25prCQ >我修改了你的建议,但是当我运行这个项目时出现这个: > https://s27.postimg.org/4vo8kthhf /2222.png –