I built an java class
for I can use Hibernate
. When I select the NetBeans
option: "clean and build
", the system indicate me the next problem:
Note: /home/.../NewHibernateUtil.java uses or overrides a deprecated API.
This is my class 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;
}
}
How I can correct this problem?
Thank you!