当我使用Configration类构建sessionFactory时,它表示该类是抽象的,无法实现,并希望我实现返回AppConfigurationEntry []的方法getAppConfigurationEntry!
这是我的代码:
public class BookDAOImp implements GeneralDAO<Book, String> {
private static SessionFactory sessionFactory;
private static ServiceRegistry serviceRegistry;
public BookDAOImp() {
}
public static SessionFactory createSessionFactory() {
Configuration configuration = new Configuration();
configuration.configure();
ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings(
configuration.getProperties()).buildServiceRegistry();
sessionFactory = configuration.buildSessionFactory(serviceRegistry);
return sessionFactory;
}
}
你能帮助我解决这个小小的误会吗? 任何正文都可以帮我用这个函数或其他方法构建sessionFactory吗?