title: how can i load jpa properties to datasource in Spring?
body: <p>I am using Spring boot Data JPA and right now, i have this:</p>
  
  <pre><code>@Configuration
  @PropertySource("classpath:persistence.properties")
  @EnableTransactionManagement
  public class PersistenceConfiguration {
  
      @Autowired
      private Environment env;
  
      @Bean
      public LocalContainerEntityManagerFactoryBean entityManagerFactory(EntityManagerFactoryBuilder builder) {
          LocalContainerEntityManagerFactoryBean entityManager = new LocalContainerEntityManagerFactoryBean();
          entityManager.setDataSource(this.dataSource());
          entityManager.setPackagesToScan(new String[] {"com.example.movies.domain"});
          JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
          entityManager.setJpaVendorAdapter(vendorAdapter);
          entityManager.setJpaProperties(this.properties());
          return entityManager;
      }
  
      @Bean
      @ConfigurationProperties(prefix = "spring.datasource")
      public DataSource dataSource() {
          return DataSourceBuilder.create().build();
      }
  
      @Bean
      public PlatformTransactionManager transactionManager(EntityManagerFactory emf) {
          JpaTransactionManager transactionManager = new JpaTransactionManager();
          transactionManager.setEntityManagerFactory(emf);
          return transactionManager;
      }
  
      @Bean
      public PersistenceExceptionTranslationPostProcessor exceptionTranslation() {
          return new PersistenceExceptionTranslationPostProcessor();
      }
  
      private Properties properties() {
          Properties properties = new Properties();
          properties.setProperty("hibernate.ddl-auto", this.env.getProperty("spring.jpa.hibernate.ddl-auto"));
          properties.setProperty("hibernate.dialect", this.env.getProperty("spring.jpa.hibernate.dialect"));
          properties.setProperty("hibernate.show_sql", this.env.getProperty("spring.jpa.show-sql"));
          return properties;
  
      }
  
  }
  </code></pre>
  
  <p>And my persistence.properties</p>
  
  <pre><code>spring.datasource.driverClassName=com.mysql.jdbc.Driver
  spring.datasource.url=jdbc:mysql://localhost:3306/sarasa_db
  spring.datasource.username=root
  spring.datasource.password=myPassword
  
  spring.jpa.hibernate.ddl-auto=update
  spring.jpa.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
  spring.jpa.show-sql=false
  </code></pre>
  
  <p>What i would to know is if there exists any way to load these JpaProperties automatically. I want that spring build it because right now,  if i add new jpa property in persistence.properties, then it wouldn't be noticed that change until i put that property in Properties object. So, do you know if is that possible? Regards!</p>