Align Hibernate 5 join table names with those from SpringNamingStrategy

Previously, the name of a join table when using Hibernate 5 would
differ from those when using Hibernate 4 with the default
SpringNamingStrategy.

This commit introduces SpringImplicitNamingStrategy which customises the
name of join tables to match those produced by SpringNamingStrategy.

Closes gh-5880
This commit is contained in:
Andy Wilkinson
2016-05-11 10:11:34 +01:00
parent 1bb2c4fc00
commit 5c0d400c23
5 changed files with 63 additions and 13 deletions

View File

@@ -7,11 +7,11 @@ insert into note(title, body) values ('Spring Framework', 'Core support for depe
insert into note(title, body) values ('Spring Integration', 'Extends the Spring programming model to support the well-known Enterprise Integration Patterns.')
insert into note(title, body) values ('Tomcat', 'Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies.')
insert into note_tag(notes_id, tags_id) values (1, 1)
insert into note_tag(notes_id, tags_id) values (2, 1)
insert into note_tag(notes_id, tags_id) values (3, 1)
insert into note_tag(notes_id, tags_id) values (1, 3)
insert into note_tag(notes_id, tags_id) values (2, 3)
insert into note_tag(notes_id, tags_id) values (3, 3)
insert into note_tag(notes_id, tags_id) values (4, 2)
insert into note_tag(notes_id, tags_id) values (4, 3)
insert into note_tags(notes_id, tags_id) values (1, 1)
insert into note_tags(notes_id, tags_id) values (2, 1)
insert into note_tags(notes_id, tags_id) values (3, 1)
insert into note_tags(notes_id, tags_id) values (1, 3)
insert into note_tags(notes_id, tags_id) values (2, 3)
insert into note_tags(notes_id, tags_id) values (3, 3)
insert into note_tags(notes_id, tags_id) values (4, 2)
insert into note_tags(notes_id, tags_id) values (4, 3)