---
title: "Hibernate hbm2ddl.auto possible values and what they do?"  
description: "Hibernate hbm2ddl.auto possible values and what they do?"  
author: "Anonymous User"  
published: 2015-07-14  
updated: 2015-07-14  
canonical: https://www.mindstick.com/forum/23337/hibernate-hbm2ddl-auto-possible-values-and-what-they-do  
category: "java"  
tags: ["java"]  
reading_time: 2 minutes  

---

# Hibernate hbm2ddl.auto possible values and what they do?

I really want to know more about the [update](https://www.mindstick.com/forum/156353/what-is-hummingbird-update), [export](https://www.mindstick.com/articles/12966/a-guide-to-export-pallets) and the [values](https://www.mindstick.com/forum/327/sum-textbox-values) that could be given to hibernate.hbm2ddl.autoI need to know when to use the update and when not? And what is the [alternative](https://www.mindstick.com/forum/2324/what-is-the-alternative-to-the-mvc)?\
These are changes that could happen over DB:\

1. New [tables](https://www.mindstick.com/articles/336597/introduction-of-html-tables-for-web-development)\
2. new columns in old tables\
3. columns [deleted](https://www.mindstick.com/forum/160487/how-to-remove-the-deleted-git-code-marker-in-scrollbar-in-visual-studio-2022)\
4. [data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science) type of a [column](https://www.mindstick.com/forum/33860/how-to-calculate-column-summary-in-sql-server) changed\
5. a type of a column changed it [attributes](https://www.mindstick.com/articles/13105/2-attributes-that-make-your-odoo-ecommerce-theme-productive-and-engaging)\
6. tables have been dropped\
7. values of a column has changed\
8. In each case what is the best solution?\

## Replies

### Reply by Anonymous User

hibernate.hbm2ddl.auto Automatically validates or exports schema DDL to the database when the SessionFactory is created. With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly.\
e.g. validate | update | create | create-drop\
So the list of possible options are,\
validate: validate the schema, makes no changes to the database.update: update the schema.create: creates the schema, destroying previous data.create-drop: drop the schema at the end of the session.\
The configuration property is called hibernate.hbm2ddl.auto\
In our development environment we set hibernate.hbm2ddl.auto=create-drop to drop and create a clean database each time we deploy, so that our database is in a known state.\
In theory, you can set hibernate.hbm2ddl.auto=update to update your database with changes to your model, but I would not trust that on a production database. An earlier version of the documentation said that this was experimental, at least; I do not know the current status.\
Therefore, for our production database, do not set hibernate.hbm2ddl.auto - the default is to make no database changes. Instead, we manually create an SQL DDL update script that applies changes from one version to the next.


---

Original Source: https://www.mindstick.com/forum/23337/hibernate-hbm2ddl-auto-possible-values-and-what-they-do

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
