title: Convert .xml configuration to spring boot application.properties
body: <p>i am transferring my spring mvc project to spring boot and i am trying to convert the old school .xml configuration to application properties.I have only figured out the jdbc and jsp properties. Any ideas?</p>
  
  <p>.xml config</p>
  
  <pre><code>&lt;bean id="trans"
          class="org.springframework.orm.hibernate5.HibernateTransactionManager"&gt;
      &lt;property name="sessionFactory" ref="sessionFactory"/&gt;
  &lt;/bean&gt;
  
  &lt;tx:annotation-driven transaction-manager="trans" /&gt;
  
  &lt;mvc:resources location="/resources/" mapping="/resources/**"&gt;&lt;/mvc:resources&gt;
  </code></pre>
  
  <p>application.properties</p>
  
  <pre><code>spring.jpa.hibernate.ddl-auto=update
  spring.datasource.url=jdbc:mysql://localhost:3306/?useSSL=false
  spring.datasource.username=root
  spring.datasource.password=asdf
  spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
  
  spring.mvc.view.prefix:/WEB-INF/views/
  spring.mvc.view.suffix:.jsp
  </code></pre>
  
  <p>found this as an alternative but would if someone know the setting for application.properties</p>
  
  <pre><code>@Configuration
  public class HibernateConf {
  
  @Autowired
  private EntityManagerFactory entityManagerFactory;
  
  @Bean
  public SessionFactory getSessionFactory() {
      return entityManagerFactory.unwrap(SessionFactory.class);
  }
  </code></pre>