Skip to content

Commit

Permalink
Support hibernate 4
Browse files Browse the repository at this point in the history
  • Loading branch information
nvoxland committed Oct 11, 2013
1 parent d2c442d commit 7eecf93
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<modelVersion>4.0.0</modelVersion>

<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate3</artifactId>
<version>3.1-SNAPSHOT</version>
<artifactId>liquibase-hibernate4</artifactId>
<version>3.0-SNAPSHOT</version>

<name>Liquibase Hibernate Integration</name>
<description>Liquibase extension for hibernate integration including generating changesets based on changed
Expand Down Expand Up @@ -83,7 +83,7 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.6.10.Final</version>
<version>4.2.4.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
Expand All @@ -93,12 +93,12 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.10.Final</version>
<version>4.2.4.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>3.6.10.Final</version>
<version>4.2.4.Final</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand Down Expand Up @@ -132,8 +132,8 @@
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-hibernate3</artifactId>
<version>2.0.8</version>
<artifactId>spring-hibernate</artifactId>
<version>1.2.9</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.hibernate.cfg.NamingStrategy;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.envers.configuration.AuditConfiguration;
import org.hibernate.event.PostInsertEventListener;
import org.hibernate.event.spi.PostInsertEventListener;

/**
* Database implementation for "ejb3" hibernate configurations.
Expand Down Expand Up @@ -44,11 +44,12 @@ protected Configuration buildConfiguration(HibernateConnection connection) throw
}
}

for (PostInsertEventListener postInsertEventListener : configuration.getEventListeners().getPostInsertEventListeners()) {
if (postInsertEventListener instanceof org.hibernate.envers.event.AuditEventListener) {
AuditConfiguration.getFor(configuration);
}
}
//I don't see how this is supported in hibernate 4
// for (PostInsertEventListener postInsertEventListener : configuration.getEventListeners().getPostInsertEventListeners()) {
// if (postInsertEventListener instanceof org.hibernate.envers.event.AuditEventListener) {
// AuditConfiguration.getFor(configuration);
// }
// }

return configuration;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import liquibase.database.DatabaseConnection;
import liquibase.exception.DatabaseException;
import liquibase.ext.hibernate.database.connection.HibernateConnection;
import org.hibernate.annotations.common.util.ReflectHelper;
import org.hibernate.cfg.Configuration;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.util.ReflectHelper;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.PropertyValue;
import org.springframework.beans.factory.config.BeanDefinition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import liquibase.structure.core.Table;
import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.Dialect;
import org.hibernate.engine.Mapping;
import org.hibernate.engine.spi.Mapping;
import org.hibernate.mapping.PrimaryKey;

import java.util.Iterator;
Expand Down

0 comments on commit 7eecf93

Please sign in to comment.