views:

43

answers:

2

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

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

+1  A: 

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

Pascal Thivent
A: 

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

JavaRocky