EntityManagerUtils.java 文件源码

java
阅读 35 收藏 0 点赞 0 评论 0

项目:Jouve-Project 作者:
public static void setUp() {        
    AnnotationConfiguration config = new AnnotationConfiguration();
    config.setProperty("hibernate.current_session_context_class", "managed");
    config.setProperty("hibernate.c3p0.max_size", "20").setProperty(
            "hibernate.c3p0.timeout", "3000").setProperty(
            "hibernate.c3p0.idle_test_period", "300").setProperty("hibernate.hbm2ddl.auto", "update");

    ConstellioAnnotationUtils.addAnnotatedClasses(config);

    sessionFactory = config.buildSessionFactory();

    Application.set(new DataDummyWebApplication());

    org.hibernate.classic.Session hibernateSession = sessionFactory.openSession();
    hibernateSession.beginTransaction();
    ManagedSessionContext.bind(hibernateSession);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号