简体   繁体   中英

Loading selected Hibernate entities with JPA & Spring

Is there a way to load only selected entities with Hibernate?

I would like to only load a selected handful for integration testing.

我以编程方式为此类测试创建了AnnotationConfiguration ,并使用诸如addAnnotatedClass(Class)方法来“注册”实体。

我最终使用了自定义的persistence.xml,并将其提供给spring config中的EntityManagerFactory。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM