title: Is there a way to give persistenceUnitName for Spring's LocalContainerEntityManagerFactoryBean without persistence.xml?
body: <p>I have multiple datasources and multiple EntityManagerFactories to be defined in my spring context. </p>
  
  <p>If there is only on EntityManagerFactory we don't need to give persistenceUnitName. But to associate EntityManager to correct EntityManagerFactory with @PersistenceContext I should give unitName="somePU" attribute. </p>
  
  <p>But if we give name for persistenceUnitName attribute then Spring is expecting these persistenceUnitName declarations in persistence.xml file.</p>
  
  <p>Is there a way to give persistenceUnitName for Spring's LocalContainerEntityManagerFactoryBean without persistence.xml?</p>
  
  <p>Also I found another issue when I used persistence.xml with Spring's LocalContainerEntityManagerFactoryBean. The packagesToScan property is not working. I need to list down all the Entity classes in persistence.xml.</p>
  
  <p>Any idea why it is happening?</p>
  
  <p>-siva</p>