== SessionFactory vs EntityManagerFactory
SessionFactory: Hibernate interface
EntityManagerFactory: JPA standard interface
Best practice is to use JPA, the EntityManager. In case you missed features provided by Session, you can always get Session from the following statement:
Session session = entityManager.unwrap(Session.class);
本文对比了SessionFactory(Hibernate接口)与EntityManagerFactory(JPA标准接口)的区别,并推荐使用JPA标准接口。对于需要使用Session提供的特性的场景,可以通过EntityManager转换为Session来实现。
1956

被折叠的 条评论
为什么被折叠?



