I want to have two EntityManagerFactories (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
in this case), with each of them having their own data source and own set of persistent objects.
So somehow I need to be able to scope entities to a particular entity manager factory. I would prefer not to have to hard code the entity names into persistence.xml
.
Maybe there is some way of putting a filter on the class path scanner when JPA scans for entities? or some way of connecting an entity to a particular persistence unit.