【问题标题】:Hibernate 4 : SessionFactory v/s ServiceRegistry休眠 4:SessionFactory v/s ServiceRegistry
【发布时间】:2014-06-24 04:23:24
【问题描述】:

这里有一段代码用于创建配置类对象以及关于使用 ServiceRegistry 的 SessionFactory。

Configuration cfg = new Configuration().addResource(
                    "employee.hbm.xml").configure();

            serviceRegistry = new ServiceRegistryBuilder().applySettings(
                    cfg.getProperties()).buildServiceRegistry();

            sessionFactory = cfg.buildSessionFactory(serviceRegistry);

SessionFactory 是什么?

ServiceRegistry 是什么?

Hibernate 中 b/w SessionFactoryServiceRegistry 的基本区别是什么。

【问题讨论】:

    标签: java hibernate session


    【解决方案1】:

    在 hibernate4 中,他们重新设计了 sessionFactory 以将参数作为 Serviceregistry 对象传递。早期方法中存在一些问题,您可以从 check here 中理解

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-23
      • 2016-06-28
      • 2016-03-21
      • 2013-06-11
      • 2015-06-10
      • 2014-01-10
      • 2012-07-25
      • 2019-04-13
      相关资源
      最近更新 更多