title: Migrating from Spring Boot 1.5 to 2, error on multiple data sources
body: <p>I am migrating my application from Spring Boot 1.5 to 2 (and hopefully from Tomcat to Hikari in the process). I've solved all the compilation errors, but now I'm getting this error (I've removed most of the stacktrace as I see no important info on it):</p>
  
  <pre><code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pexEntityManagerFactory' defined in class path resource [com/xisumavoid/gateway/db/PexDbConfig.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
  [...]
  Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
  </code></pre>
  
  <p>I have 2 classes that act as database configuration, as my application has to access 2 databases (Named 'primary' and 'pex'). The <code>PexDbConfig</code> looks like this:</p>
  
  <pre><code>@Configuration
  @EnableTransactionManagement
  @EnableJpaRepositories(
      entityManagerFactoryRef = "pexEntityManagerFactory",
      transactionManagerRef = "pexTransactionManager",
      basePackages = { "com.xisumavoid.gateway.db.pex.repositories" }
  )
  public class PexDbConfig {
  
      @Bean(name = "pexDataSource")
      @ConfigurationProperties(prefix = "pex.datasource")
      public DataSource dataSource() {
          return DataSourceBuilder.create().build();
      }
  
      @Bean(name = "pexEntityManagerFactory")
      public LocalContainerEntityManagerFactoryBean pexEntityManagerFactory(
          EntityManagerFactoryBuilder builder,
          @Qualifier("pexDataSource") DataSource dataSource
      ) {
          return builder
                  .dataSource(dataSource)
                  .packages("com.xisumavoid.gateway.db.pex.models")
                  .persistenceUnit("pex")
                  .build();
      }
  
      @Bean(name = "pexTransactionManager")
      public PlatformTransactionManager pexTransactionManager(
              @Qualifier("pexEntityManagerFactory") EntityManagerFactory
                      pexEntityManagerFactory
      ) {
          return new JpaTransactionManager(pexEntityManagerFactory);
      }
  }
  </code></pre>
  
  <p>Sorry for the messy code, long class names are hard to deal with.
  Also, in case it's needed, here's the relevant config section:</p>
  
  <pre><code>## DB - PRIMARY
  spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  spring.datasource.url=jdbc:mysql://localhost:3306/primary
  spring.datasource.username=user
  spring.datasource.password=password
  
  ## DB - PEX
  pex.datasource.driver-class-name=com.mysql.jdbc.Driver
  pex.datasource.url=jdbc:mysql://localhost:3306/pex
  pex.datasource.username=user
  pex.datasource.password=password
  </code></pre>
  
  <p>How do I fix this, or even better yet, is there a way to do this in a simpler way?</p>
  
  <p>Thanks in advance!</p>