title: Does Hibernate create tables in the database automatically
body: <p>Upon reading <a href="https://web.archive.org/web/20111022130959/http://www.vaannila.com/spring/spring-hibernate-integration-1.html" rel="nofollow noreferrer">this</a> (archived) tutorial, they have not mentioned anything over creating tables in the DB. Does the Hibernate handle it automatically by creating tables and fields once i specify them.</p>
  <p>Here is my beans configuration.</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
      xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
      xmlns:p=&quot;http://www.springframework.org/schema/p&quot;
      xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd&quot;&gt;
  
      &lt;bean id=&quot;viewResolver&quot; class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot; p:prefix=&quot;/WEB-INF/jsp/&quot; p:suffix=&quot;.jsp&quot; /&gt;
      
      &lt;bean id=&quot;myDataSource&quot; class=&quot;org.apache.commons.dbcp.BasicDataSource&quot; destroy-method=&quot;close&quot;&gt;
          &lt;property name=&quot;driverClassName&quot; value=&quot;com.mysql.jdbc.Driver&quot;/&gt;
          &lt;property name=&quot;url&quot; value=&quot;jdbc:mysql://127.0.0.1:3306/spring&quot;/&gt;
          &lt;property name=&quot;username&quot; value=&quot;monwwty&quot;/&gt;
          &lt;property name=&quot;password&quot; value=&quot;www&quot;/&gt;
      &lt;/bean&gt;
      
      &lt;bean id=&quot;mySessionFactory&quot; class=&quot;org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean&quot;&gt;
          &lt;property name=&quot;dataSource&quot; ref=&quot;myDataSource&quot; /&gt;
          &lt;property name=&quot;annotatedClasses&quot;&gt;
              &lt;list&gt;
                  &lt;value&gt;uk.co.vinoth.spring.domain.User&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name=&quot;hibernateProperties&quot;&gt;
              &lt;props&gt;
                  &lt;prop key=&quot;hibernate.dialect&quot;&gt;org.hibernate.dialect.MySQLDialect&lt;/prop&gt;
                  &lt;prop key=&quot;hibernate.show_sql&quot;&gt;true&lt;/prop&gt;
                  &lt;prop key=&quot;hibernate.hbm2ddl.auto&quot;&gt;create&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
      
      &lt;bean id=&quot;myUserDAO&quot; class=&quot;uk.co.vinoth.spring.dao.UserDAOImpl&quot;&gt;
          &lt;property name=&quot;sessionFactory&quot; ref=&quot;mySessionFactory&quot;/&gt;
      &lt;/bean&gt;
      
      &lt;bean name=&quot;/user/*.htm&quot; class=&quot;uk.co.vinoth.spring.web.UserController&quot; &gt;
          &lt;property name=&quot;userDAO&quot; ref=&quot;myUserDAO&quot; /&gt;
      &lt;/bean&gt;
      
  &lt;/beans&gt;
  </code></pre>