POSTED 11 Oct 2013 by Nathan Voxland
After far too long, a new version of the Liquibase-Hibernate extension has been released!
Downloads, documentation, and issue tracking is hosted at github.com/liquibase/liquibase-hibernate. The extension is also available through Maven with group org.liquibase.ext, artifacts liquibase-hibernate3 and liquibase-hibernate4.
If you’ve been stuck on Liquibase 2.0 because of the old hibernate integration, the wait is over. The extension requires Liquibase 3.0.6+, so make sure you are on the newest version of Liquibase.
There are two separate jar files available: liquibase-hibernate3.jar and liquibase-hibernate4.jar. Use the version that corresponds to your Hibernate version
If you are using the EJB3-style persistence.xml file, you can now use a database url of “hibernate:ejb3:yourPersistenceUnit”.
If your Hibernate configuration is specified in Spring, you can now use a database of “hibernate:spring:your/path/spring.xml?bean=sessionFactory” to pull the Hibernate configuration from your spring context.
You can now create your Hibernate configurations dynamically by implementing liquibase.ext.hibernate.customfactory.CustomClassicConfigurationFactory or liquibase.ext.hibernate.customfactory.CustomEjb3ConfigurationFactory and reference the classes in your database url. For example, “hibernate:classic:com.example.YourFactory” or “hibernate:ejb3:com.example.YourFactory”