title: Spring application.yaml doesn't work
body: <p>I'm trying to config some JPA and Hibernate properties in yaml file, but the problem arises when I use @Value("${$hibernate.show_sql}") in my JpaConfig.</p>
  
  <p>The error message:</p>
  
  <blockquote>
    <p>org.springframework.beans.factory.BeanCreationException: Could not<br>
    autowire field: private java.lang.Boolean
    com.movieGo.JpaConfig.showSql; nested exception is
    org.springframework.beans.TypeMismatchException: Failed to convert
    value of type [java.lang.String] to required type [java.lang.Boolean];
    nested exception is java.lang.IllegalArgumentException: Invalid
    boolean value [${spring.hibernate.show_sql}]</p>
  </blockquote>
  
  <p>I write my application.yml like this:</p>
  
  <pre><code>spring:
    datasource:
      driverClassName: com.mysql.jdbc.Driver
      url: jdbc:mysql://127.0.0.1/hello
      username: root
      password:
  
    hibernate:
      dialect: org.hibernate.dialect.MySQLDialect
      hbm2ddl.auto: update
      show_sql: false
  </code></pre>
  
  <p>I use @Value like this:</p>
  
  <pre><code>@Configuration
  @EnableTransactionManagement
  @EnableJpaRepositories(basePackageClasses = HelloApplication.class)
  
  class JpaConfig implements TransactionManagementConfigurer {
  
  @Value("${spring.dataSource.driverClassName}")
  private String driver;
  @Value("${spring.dataSource.url}")
  private String url;
  @Value("${spring.dataSource.username}")
  private String username;
  @Value("${spring.dataSource.password}")
  private String password;
  @Value("${spring.hibernate.dialect}")
  private String dialect;
  @Value("${spring.hibernate.hbm2ddl.auto}")
  private String hbm2ddlAuto;
  @Value("${spring.hibernate.show_sql}")
  private Boolean showSql;
  ...
  }
  </code></pre>
  
  <p>It seems Spring regards <code>show_sql</code> as a String type, but
  How can I specify a Boolean type in .yml ?
  New to Spring mvc, eager seeking help.</p>