Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Hibernate 5 brings a breaking change by setting the
`hibernate.id.new_generator_mappings` property to `true` by default. This
does not use a sequence for a `Long` PK and therefore any SQL not
providing a value for the primary key will break.

Also, Hibernate 5 changed its naming strategy API so we'll have to detect
that in `JpaProperties#Hibernate` and set the appropriate value.

See spring-projectsgh-2763
  • Loading branch information
snicoll committed Sep 8, 2015
1 parent c85f4df commit 161c629
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions spring-boot-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,11 @@
<artifactId>hibernate-envers</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-java8</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
Expand Down
9 changes: 9 additions & 0 deletions spring-boot-samples/spring-boot-sample-data-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,13 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>hibernate5</id>
<properties>
<hibernate.version>5.0.1.Final</hibernate.version>
</properties>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
spring.h2.console.enabled=true

logging.level.org.hibernate.SQL=debug
logging.level.org.hibernate.SQL=debug


spring.jpa.properties.hibernate.id.new_generator_mappings=false

0 comments on commit 161c629

Please sign in to comment.