0

As I am developing my application, I a making constant changes to my model and I want hibernate to keep track of the changes but it doesn't. This is my code snippet

<bean id="sessionFactory"
        class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />

        <property name="packagesToScan">
            <list>
                <value>np.com.xxx.model</value>
            </list>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.hbm2ddl.auto">update</prop>
                <prop key="hibernate.dialect">${hibernate.dialect}</prop>
                <prop key="hibernate.show_sql">false</prop>
            </props>
        </property>
    </bean>

You can take note of this property which is supposed to do the job of the updating process

<prop key="hibernate.hbm2ddl.auto">update</prop>

How can I ensure that hibernate updates my database accordingly based on the current status of my model.

Blaze
  • 2,269
  • 11
  • 40
  • 82
  • Hibernate most certainly keeps track of your changes, be it via caching in the app layer or persisting to your database. Can you be precise about the problem you are having? – Tim Biegeleisen Jun 17 '16 at 14:05
  • 3
    Please refer to this http://stackoverflow.com/questions/4574785/update-database-schema-with-hibernate – Blaze Jun 17 '16 at 14:06

0 Answers0