开发者

Loading selected Hibernate entities with JPA & Spring

开发者 https://www.devze.com 2023-01-04 09:27 出处:网络
Is there a way to loa开发者_StackOverflow社区d only selected entities with Hibernate? I would like to only load a selected handful for integration testing.I create an AnnotationConfiguration programa

Is there a way to loa开发者_StackOverflow社区d only selected entities with Hibernate?

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


I create an AnnotationConfiguration programatically for this kind of tests and use methods such as addAnnotatedClass(Class) to "enlist" entities.


I ended up using a custom persistence.xml and gave it to the EntityManagerFactory in the spring config.

0

精彩评论

暂无评论...
验证码 换一张
取 消