title: Configure Multiple JPA Repositories in CrudRepository approach
body: <p>I am trying to configure the multiple JPA repositories in my web application. Currently I have one Repository as mentioned below.  I am using Crud Repository </p>
  
  <pre><code>&lt;jpa:repositories base-package="com.mypackage1" factory-class="org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean" transaction-manager-ref="transactionManager" entity-manager-factory-ref="entityManagerFactory"&gt;
      &lt;repository:include-filter type="assignable" expression="com.MyFirstRepository"/&gt;
  &lt;/jpa:repositories&gt;
  
  &lt;bean id="entityManagerFactory"
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
      &lt;property name="packagesToScan" value="com.mypackage1.Model" /&gt;
      &lt;property name="jpaVendorAdapter"&gt;
          &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt;
              &lt;property name="generateDdl" value="true" /&gt;
              &lt;property name="database" value="H2" /&gt;
          &lt;/bean&gt;
      &lt;/property&gt;
  &lt;/bean&gt; 
  
  &lt;bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"&gt;
      &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="dataSource"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
      &lt;property name="driverClassName" value="org.h2.Driver" /&gt;
      &lt;property name="url" value="jdbc:h2:database/~test" /&gt;
      &lt;property name="username" value="sa" /&gt;
      &lt;property name="password" value="" /&gt;
  &lt;/bean&gt;     
  </code></pre>
  
  <p>If I need to configure multiple repositories,</p>
  
  <p>
          
      </p>
  
  <pre><code>&lt;bean id="entityManagerFactory2"
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource2" /&gt;
      &lt;property name="packagesToScan" value="com.mypackage2.Model" /&gt;
      &lt;property name="jpaVendorAdapter"&gt;
          &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt;
              &lt;property name="generateDdl" value="true" /&gt;
              &lt;property name="database" value="H2" /&gt;
          &lt;/bean&gt;
      &lt;/property&gt;
  &lt;/bean&gt; 
  
  &lt;bean id="transactionManager2" class="org.springframework.orm.jpa.JpaTransactionManager"&gt;
      &lt;property name="entityManagerFactory" ref="entityManagerFactory2" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="dataSource2"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
      &lt;property name="driverClassName" value="org.h2.Driver" /&gt;
      &lt;property name="url" value="jdbc:h2:database/~test2" /&gt;
      &lt;property name="username" value="sa" /&gt;
      &lt;property name="password" value="" /&gt;
  &lt;/bean&gt;     
  </code></pre>
  
  <p>I am not able to find any appropriate configuratiuon for this.</p>
  
  <p>Appreciate help on this. </p>