类 LocalSessionFactoryBuilder

  • 所有已实现的接口:
    Serializable

    public class LocalSessionFactoryBuilder
    extends Configuration
    A Spring-provided extension of the standard Hibernate Configuration class, adding SpringSessionContext as a default and providing convenient ways to specify a DataSource and an application class loader.

    This is designed for programmatic use, e.g. in @Bean factory methods. Consider using LocalSessionFactoryBean for XML bean definition files.

    Requires Hibernate 4.0 or higher. As of Spring 4.0, it is compatible with (the quite refactored) Hibernate 4.3 as well. We recommend using the latest Hibernate 4.2.x or 4.3.x version, depending on whether you need to remain JPA 2.0 compatible at runtime (Hibernate 4.2) or can upgrade to JPA 2.1 (Hibernate 4.3).

    NOTE: To set up Hibernate 4 for Spring-driven JTA transactions, make sure to either use the setJtaTransactionManager(java.lang.Object) method or to set the "hibernate.transaction.factory_class" property to CMTTransactionFactory. Otherwise, Hibernate's smart flushing mechanism won't work properly.

    从以下版本开始:
    3.1
    作者:
    Juergen Hoeller
    另请参阅:
    LocalSessionFactoryBean, 序列化表格