我想知道在休眠状态下指令configuration.configure()是否是必需的?
那么,可以将其删除吗?是否可以说以下代码段是相似的: // snippet1 配置配置= new Configuration(); configuration.configure(); ///此行将在其他代码段中删除 SessionFactory sessionFactory = configuration.buildSessionFactory(new StandardServiceRegistryBuilder()。applySettings(configuration.getProperties())。build());
// snippet2:在此步骤中,删除了configure调用方法 配置配置= new Configuration(); SessionFactory sessionFactory = configuration.buildSessionFactory(new SessionFactory sessionFactory = configuration.buildSessionFactory(new StandardServiceRegistryBuilder()。applySettings(configuration.getProperties())。build());