Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to integrate LiquiBase + Spring + Hibernate without using hibernate.xml configuration file
    primarykey
    data
    text
    <p>I already read a lot of posts regarding integration between LiquiBase, Spring and Hibernate, but none of them apply to my situation witch is:</p> <p>I'm starting a new project that uses Spring and Hibernate, so I was looking into a way to manage the database changes during the project lifetime. First I started using hbm2ddl but then realized that people say that this isn't a very good idea in production environments, so I came to the conclusion that LiquiBase was the way to go (so I think).</p> <p>The problem is that I'm not using a hibernate.xml config file (and all the examples I found using LiquiBase use a hibernate.xml), since I'm using java annotations in my POJO/DB classes and my hibernate configuration is made like this</p> <pre><code>@Bean public LocalContainerEntityManagerFactoryBean entityManagerFactoryBean() throws ClassNotFoundException { LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean(); entityManagerFactoryBean.setDataSource(dataSource()); entityManagerFactoryBean.setPackagesToScan(environment.getRequiredProperty(PROPERTY_NAME_ENTITYMANAGER_PACKAGES_TO_SCAN)); entityManagerFactoryBean.setPersistenceProviderClass(HibernatePersistence.class); Properties jpaProterties = new Properties(); jpaProterties.put(PROPERTY_NAME_HIBERNATE_DIALECT, environment.getRequiredProperty(PROPERTY_NAME_HIBERNATE_DIALECT)); jpaProterties.put(PROPERTY_NAME_HIBERNATE_FORMAT_SQL, environment.getRequiredProperty(PROPERTY_NAME_HIBERNATE_FORMAT_SQL)); jpaProterties.put(PROPERTY_NAME_HIBERNATE_NAMING_STRATEGY, environment.getRequiredProperty(PROPERTY_NAME_HIBERNATE_NAMING_STRATEGY)); jpaProterties.put(PROPERTY_NAME_HIBERNATE_SHOW_SQL, environment.getRequiredProperty(PROPERTY_NAME_HIBERNATE_SHOW_SQL)); jpaProterties.put(PROPERTY_NAME_HIBERNATE_HBM2DDL_AUTO, environment.getRequiredProperty(PROPERTY_NAME_HIBERNATE_HBM2DDL_AUTO)); entityManagerFactoryBean.setJpaProperties(jpaProterties); return entityManagerFactoryBean; } </code></pre> <p>I also found posts from 2 years ago saying that this option would only be available in version 2.0 (the current one), and I was wondering if this is already implemented. If so, how do I use it in a ANT script?</p> <p>I need to create the original database DDL and the following database change logs and import them into the production DB.</p> <p><strong>EDIT :</strong> I'm using:</p> <p>Liquibase 2.0.5</p> <p>Liquibase Hibernate 2.0.0</p> <p>Hibernate 4.1.4</p> <p>Spring 3.1.1</p> <p>Spring Data JPA 1.1.1</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload