diff --git a/src/main/java/org/springframework/data/jdbc/core/mapping/DelimiterNamingStrategy.java b/src/main/java/org/springframework/data/jdbc/core/mapping/DelimiterNamingStrategy.java
deleted file mode 100644
index 11774504..00000000
--- a/src/main/java/org/springframework/data/jdbc/core/mapping/DelimiterNamingStrategy.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2018 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.data.jdbc.core.mapping;
-
-import org.springframework.data.util.ParsingUtils;
-
-/**
- * The delimiter character implementation of {@link NamingStrategy} with no schema, table based on {@link Class} and
- * column name based on {@link JdbcPersistentProperty}. The default delimiter is '_', resulting in snake case.
- *
- * @author Kazuki Shimizu
- * @author Jens Schauder
- * @since 1.0
- */
-public class DelimiterNamingStrategy implements NamingStrategy {
-
- private final String delimiter;
-
- /**
- * Construct a instance with '_' as delimiter. This results in a snake case naming strategy.
- */
- public DelimiterNamingStrategy() {
- this("_");
- }
-
- /**
- * Construct a instance with specified delimiter.
- *
- * @param delimiter a delimiter character
- */
- public DelimiterNamingStrategy(String delimiter) {
- this.delimiter = delimiter;
- }
-
- /**
- * Look up the {@link Class}'s simple name after converting to separated word using with {@code delimiter}.
- */
- @Override
- public String getTableName(Class> type) {
- return ParsingUtils.reconcatenateCamelCase(NamingStrategy.super.getTableName(type), delimiter);
- }
-
- /**
- * Look up the {@link JdbcPersistentProperty}'s name after converting to separated word using with {@code delimiter}.
- */
- @Override
- public String getColumnName(JdbcPersistentProperty property) {
- return ParsingUtils.reconcatenateCamelCase(NamingStrategy.super.getColumnName(property), delimiter);
- }
-
- /**
- * Return the value that adding {@code delimiter} + 'key' for returned value of {@link #getReverseColumnName}.
- */
- @Override
- public String getKeyColumn(JdbcPersistentProperty property) {
- return getReverseColumnName(property) + delimiter + "key";
- }
-}
diff --git a/src/main/java/org/springframework/data/jdbc/core/mapping/NamingStrategy.java b/src/main/java/org/springframework/data/jdbc/core/mapping/NamingStrategy.java
index fc5a5c93..8107de67 100644
--- a/src/main/java/org/springframework/data/jdbc/core/mapping/NamingStrategy.java
+++ b/src/main/java/org/springframework/data/jdbc/core/mapping/NamingStrategy.java
@@ -15,9 +15,12 @@
*/
package org.springframework.data.jdbc.core.mapping;
+import org.springframework.data.util.ParsingUtils;
+import org.springframework.util.Assert;
+
/**
* Interface and default implementation of a naming strategy. Defaults to no schema, table name based on {@link Class}
- * and column name based on {@link JdbcPersistentProperty}.
+ * and column name based on {@link JdbcPersistentProperty} with name parts of both separated by '_'.
*
* NOTE: Can also be used as an adapter. Create a lambda or an anonymous subclass and override any settings to implement
* a different strategy on the fly.
@@ -25,6 +28,7 @@ package org.springframework.data.jdbc.core.mapping;
* @author Greg Turnquist
* @author Michael Simons
* @author Kazuki Shimizu
+ * @author Jens Schauder
* @author Oliver Gierke
* @since 1.0
*/
@@ -47,17 +51,24 @@ public interface NamingStrategy {
}
/**
- * Defaults to returning the given type's simple name.
+ * The name of the table to be used for persisting entities having the type passed as an argument. The default
+ * implementation takes the {@code type.getSimpleName()} and separates camel case parts with '_'.
*/
default String getTableName(Class> type) {
- return type.getSimpleName();
+
+ Assert.notNull(type, "Type must not be null.");
+
+ return ParsingUtils.reconcatenateCamelCase(type.getSimpleName(), "_");
}
/**
- * Defaults to return the given {@link JdbcPersistentProperty}'s name;
+ * Defaults to return the given {@link JdbcPersistentProperty}'s name with the parts of a camel case name separated by '_';
*/
default String getColumnName(JdbcPersistentProperty property) {
- return property.getName();
+
+ Assert.notNull(property, "Property must not be null.");
+
+ return ParsingUtils.reconcatenateCamelCase(property.getName(), "_");
}
default String getQualifiedTableName(Class> type) {
@@ -71,6 +82,9 @@ public interface NamingStrategy {
* @return a column name. Must not be {@code null}.
*/
default String getReverseColumnName(JdbcPersistentProperty property) {
+
+ Assert.notNull(property,"Property must not be null.");
+
return property.getOwner().getTableName();
}
@@ -81,6 +95,9 @@ public interface NamingStrategy {
* @return name of the key column. Must not be {@code null}.
*/
default String getKeyColumn(JdbcPersistentProperty property) {
+
+ Assert.notNull(property, "Property must not be null.");
+
return getReverseColumnName(property) + "_key";
}
}
diff --git a/src/test/java/org/springframework/data/jdbc/core/DefaultDataAccessStrategyUnitTests.java b/src/test/java/org/springframework/data/jdbc/core/DefaultDataAccessStrategyUnitTests.java
index c21a5767..0cf7bd79 100644
--- a/src/test/java/org/springframework/data/jdbc/core/DefaultDataAccessStrategyUnitTests.java
+++ b/src/test/java/org/springframework/data/jdbc/core/DefaultDataAccessStrategyUnitTests.java
@@ -57,7 +57,7 @@ public class DefaultDataAccessStrategyUnitTests {
accessStrategy.insert(new DummyEntity(ORIGINAL_ID), DummyEntity.class, additionalParameters);
- verify(jdbcOperations).update(eq("INSERT INTO DummyEntity (id) VALUES (:id)"), paramSourceCaptor.capture(),
+ verify(jdbcOperations).update(eq("INSERT INTO dummy_entity (id) VALUES (:id)"), paramSourceCaptor.capture(),
any(KeyHolder.class));
}
@@ -73,8 +73,8 @@ public class DefaultDataAccessStrategyUnitTests {
verify(jdbcOperations).update(sqlCaptor.capture(), paramSourceCaptor.capture(), any(KeyHolder.class));
assertThat(sqlCaptor.getValue()) //
- .containsSequence("INSERT INTO DummyEntity (", "id", ") VALUES (", ":id", ")") //
- .containsSequence("INSERT INTO DummyEntity (", "reference", ") VALUES (", ":reference", ")");
+ .containsSequence("INSERT INTO dummy_entity (", "id", ") VALUES (", ":id", ")") //
+ .containsSequence("INSERT INTO dummy_entity (", "reference", ") VALUES (", ":reference", ")");
assertThat(paramSourceCaptor.getValue().getValue("id")).isEqualTo(ORIGINAL_ID);
}
diff --git a/src/test/java/org/springframework/data/jdbc/core/SqlGeneratorContextBasedNamingStrategyUnitTests.java b/src/test/java/org/springframework/data/jdbc/core/SqlGeneratorContextBasedNamingStrategyUnitTests.java
index 3d18a82a..17a1758e 100644
--- a/src/test/java/org/springframework/data/jdbc/core/SqlGeneratorContextBasedNamingStrategyUnitTests.java
+++ b/src/test/java/org/springframework/data/jdbc/core/SqlGeneratorContextBasedNamingStrategyUnitTests.java
@@ -19,6 +19,7 @@ import static org.assertj.core.api.Assertions.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Consumer;
import org.assertj.core.api.SoftAssertions;
@@ -63,11 +64,11 @@ public class SqlGeneratorContextBasedNamingStrategyUnitTests {
SoftAssertions softAssertions = new SoftAssertions();
softAssertions.assertThat(sql) //
.startsWith("SELECT") //
- .contains(user + ".DummyEntity.id AS id,") //
- .contains(user + ".DummyEntity.name AS name,") //
+ .contains(user + ".dummy_entity.id AS id,") //
+ .contains(user + ".dummy_entity.name AS name,") //
.contains("ref.l1id AS ref_l1id") //
.contains("ref.content AS ref_content") //
- .contains("FROM " + user + ".DummyEntity");
+ .contains("FROM " + user + ".dummy_entity");
softAssertions.assertAll();
});
}
@@ -81,7 +82,7 @@ public class SqlGeneratorContextBasedNamingStrategyUnitTests {
String sql = sqlGenerator.createDeleteByPath(PropertyPath.from("ref", DummyEntity.class));
- assertThat(sql).isEqualTo("DELETE FROM " + user + ".ReferencedEntity WHERE " + user + ".DummyEntity = :rootId");
+ assertThat(sql).isEqualTo("DELETE FROM " + user + ".referenced_entity WHERE " + user + ".dummy_entity = :rootId");
});
}
@@ -94,9 +95,11 @@ public class SqlGeneratorContextBasedNamingStrategyUnitTests {
String sql = sqlGenerator.createDeleteByPath(PropertyPath.from("ref.further", DummyEntity.class));
- assertThat(sql)
- .isEqualTo("DELETE FROM " + user + ".SecondLevelReferencedEntity " + "WHERE " + user + ".ReferencedEntity IN "
- + "(SELECT l1id FROM " + user + ".ReferencedEntity " + "WHERE " + user + ".DummyEntity = :rootId)");
+ assertThat(sql).isEqualTo(
+ "DELETE FROM " + user + ".second_level_referenced_entity " +
+ "WHERE " + user + ".referenced_entity IN " +
+ "(SELECT l1id FROM " + user + ".referenced_entity " +
+ "WHERE " + user + ".dummy_entity = :rootId)");
});
}
@@ -109,7 +112,7 @@ public class SqlGeneratorContextBasedNamingStrategyUnitTests {
String sql = sqlGenerator.createDeleteAllSql(null);
- assertThat(sql).isEqualTo("DELETE FROM " + user + ".DummyEntity");
+ assertThat(sql).isEqualTo("DELETE FROM " + user + ".dummy_entity");
});
}
@@ -122,7 +125,8 @@ public class SqlGeneratorContextBasedNamingStrategyUnitTests {
String sql = sqlGenerator.createDeleteAllSql(PropertyPath.from("ref", DummyEntity.class));
- assertThat(sql).isEqualTo("DELETE FROM " + user + ".ReferencedEntity WHERE " + user + ".DummyEntity IS NOT NULL");
+ assertThat(sql).isEqualTo(
+ "DELETE FROM " + user + ".referenced_entity WHERE " + user + ".dummy_entity IS NOT NULL");
});
}
@@ -135,9 +139,11 @@ public class SqlGeneratorContextBasedNamingStrategyUnitTests {
String sql = sqlGenerator.createDeleteAllSql(PropertyPath.from("ref.further", DummyEntity.class));
- assertThat(sql)
- .isEqualTo("DELETE FROM " + user + ".SecondLevelReferencedEntity " + "WHERE " + user + ".ReferencedEntity IN "
- + "(SELECT l1id FROM " + user + ".ReferencedEntity " + "WHERE " + user + ".DummyEntity IS NOT NULL)");
+ assertThat(sql).isEqualTo(
+ "DELETE FROM " + user + ".second_level_referenced_entity " +
+ "WHERE " + user + ".referenced_entity IN " +
+ "(SELECT l1id FROM " + user + ".referenced_entity " +
+ "WHERE " + user + ".dummy_entity IS NOT NULL)");
});
}
@@ -146,30 +152,45 @@ public class SqlGeneratorContextBasedNamingStrategyUnitTests {
*/
private void testAgainstMultipleUsers(Consumer testAssertions) {
+ AtomicReference exception = new AtomicReference<>();
CountDownLatch latch = new CountDownLatch(2);
- threadedTest("User1", latch, testAssertions);
- threadedTest("User2", latch, testAssertions);
+ threadedTest("User1", latch, testAssertions, exception);
+ threadedTest("User2", latch, testAssertions, exception);
try {
- latch.await(10L, TimeUnit.SECONDS);
+ if (!latch.await(10L, TimeUnit.SECONDS)){
+ fail("Test failed due to a time out.");
+ }
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
+
+ Error ex = exception.get();
+ if (ex != null) {
+ throw ex;
+ }
}
/**
* Inside a {@link Runnable}, fetch the {@link ThreadLocal}-based username and execute the provided set of assertions.
* Then signal through the provided {@link CountDownLatch}.
*/
- private void threadedTest(String user, CountDownLatch latch, Consumer testAssertions) {
+ private void threadedTest(String user, CountDownLatch latch, Consumer testAssertions, AtomicReference exception) {
new Thread(() -> {
- userHandler.set(user);
- testAssertions.accept(user);
+ try {
+
+ userHandler.set(user);
+ testAssertions.accept(user);
+
+ } catch (Error ex) {
+ exception.compareAndSet(null, ex);
+ } finally {
+ latch.countDown();
+ }
- latch.countDown();
}).start();
}
diff --git a/src/test/java/org/springframework/data/jdbc/core/SqlGeneratorUnitTests.java b/src/test/java/org/springframework/data/jdbc/core/SqlGeneratorUnitTests.java
index 8a842977..87b57d78 100644
--- a/src/test/java/org/springframework/data/jdbc/core/SqlGeneratorUnitTests.java
+++ b/src/test/java/org/springframework/data/jdbc/core/SqlGeneratorUnitTests.java
@@ -57,10 +57,10 @@ public class SqlGeneratorUnitTests {
SoftAssertions softAssertions = new SoftAssertions();
softAssertions.assertThat(sql) //
.startsWith("SELECT") //
- .contains("DummyEntity.x_id AS x_id,") //
- .contains("DummyEntity.x_name AS x_name,") //
+ .contains("dummy_entity.x_id AS x_id,") //
+ .contains("dummy_entity.x_name AS x_name,") //
.contains("ref.x_l1id AS ref_x_l1id") //
- .contains("ref.x_content AS ref_x_content").contains(" FROM DummyEntity") //
+ .contains("ref.x_content AS ref_x_content").contains(" FROM dummy_entity") //
// 1-N relationships do not get loaded via join
.doesNotContain("Element AS elements");
softAssertions.assertAll();
@@ -71,7 +71,7 @@ public class SqlGeneratorUnitTests {
String sql = sqlGenerator.createDeleteByPath(PropertyPath.from("ref", DummyEntity.class));
- assertThat(sql).isEqualTo("DELETE FROM ReferencedEntity WHERE DummyEntity = :rootId");
+ assertThat(sql).isEqualTo("DELETE FROM referenced_entity WHERE dummy_entity = :rootId");
}
@Test // DATAJDBC-112
@@ -80,7 +80,7 @@ public class SqlGeneratorUnitTests {
String sql = sqlGenerator.createDeleteByPath(PropertyPath.from("ref.further", DummyEntity.class));
assertThat(sql).isEqualTo(
- "DELETE FROM SecondLevelReferencedEntity WHERE ReferencedEntity IN (SELECT x_l1id FROM ReferencedEntity WHERE DummyEntity = :rootId)");
+ "DELETE FROM second_level_referenced_entity WHERE referenced_entity IN (SELECT x_l1id FROM referenced_entity WHERE dummy_entity = :rootId)");
}
@Test // DATAJDBC-112
@@ -88,7 +88,7 @@ public class SqlGeneratorUnitTests {
String sql = sqlGenerator.createDeleteAllSql(null);
- assertThat(sql).isEqualTo("DELETE FROM DummyEntity");
+ assertThat(sql).isEqualTo("DELETE FROM dummy_entity");
}
@Test // DATAJDBC-112
@@ -96,7 +96,7 @@ public class SqlGeneratorUnitTests {
String sql = sqlGenerator.createDeleteAllSql(PropertyPath.from("ref", DummyEntity.class));
- assertThat(sql).isEqualTo("DELETE FROM ReferencedEntity WHERE DummyEntity IS NOT NULL");
+ assertThat(sql).isEqualTo("DELETE FROM referenced_entity WHERE dummy_entity IS NOT NULL");
}
@Test // DATAJDBC-112
@@ -105,7 +105,7 @@ public class SqlGeneratorUnitTests {
String sql = sqlGenerator.createDeleteAllSql(PropertyPath.from("ref.further", DummyEntity.class));
assertThat(sql).isEqualTo(
- "DELETE FROM SecondLevelReferencedEntity WHERE ReferencedEntity IN (SELECT x_l1id FROM ReferencedEntity WHERE DummyEntity IS NOT NULL)");
+ "DELETE FROM second_level_referenced_entity WHERE referenced_entity IN (SELECT x_l1id FROM referenced_entity WHERE dummy_entity IS NOT NULL)");
}
@Test // DATAJDBC-131
@@ -114,9 +114,9 @@ public class SqlGeneratorUnitTests {
// this would get called when DummyEntity is the element type of a Set
String sql = sqlGenerator.getFindAllByProperty("back-ref", null, false);
- assertThat(sql).isEqualTo("SELECT DummyEntity.x_id AS x_id, DummyEntity.x_name AS x_name, "
+ assertThat(sql).isEqualTo("SELECT dummy_entity.x_id AS x_id, dummy_entity.x_name AS x_name, "
+ "ref.x_l1id AS ref_x_l1id, ref.x_content AS ref_x_content, ref.x_further AS ref_x_further "
- + "FROM DummyEntity LEFT OUTER JOIN ReferencedEntity AS ref ON ref.DummyEntity = DummyEntity.x_id "
+ + "FROM dummy_entity LEFT OUTER JOIN referenced_entity AS ref ON ref.dummy_entity = dummy_entity.x_id "
+ "WHERE back-ref = :back-ref");
}
@@ -126,10 +126,10 @@ public class SqlGeneratorUnitTests {
// this would get called when DummyEntity is th element type of a Map
String sql = sqlGenerator.getFindAllByProperty("back-ref", "key-column", false);
- assertThat(sql).isEqualTo("SELECT DummyEntity.x_id AS x_id, DummyEntity.x_name AS x_name, "
+ assertThat(sql).isEqualTo("SELECT dummy_entity.x_id AS x_id, dummy_entity.x_name AS x_name, "
+ "ref.x_l1id AS ref_x_l1id, ref.x_content AS ref_x_content, ref.x_further AS ref_x_further, "
- + "DummyEntity.key-column AS key-column "
- + "FROM DummyEntity LEFT OUTER JOIN ReferencedEntity AS ref ON ref.DummyEntity = DummyEntity.x_id "
+ + "dummy_entity.key-column AS key-column "
+ + "FROM dummy_entity LEFT OUTER JOIN referenced_entity AS ref ON ref.dummy_entity = dummy_entity.x_id "
+ "WHERE back-ref = :back-ref");
}
@@ -144,10 +144,10 @@ public class SqlGeneratorUnitTests {
// this would get called when DummyEntity is th element type of a Map
String sql = sqlGenerator.getFindAllByProperty("back-ref", "key-column", true);
- assertThat(sql).isEqualTo("SELECT DummyEntity.x_id AS x_id, DummyEntity.x_name AS x_name, "
+ assertThat(sql).isEqualTo("SELECT dummy_entity.x_id AS x_id, dummy_entity.x_name AS x_name, "
+ "ref.x_l1id AS ref_x_l1id, ref.x_content AS ref_x_content, ref.x_further AS ref_x_further, "
- + "DummyEntity.key-column AS key-column "
- + "FROM DummyEntity LEFT OUTER JOIN ReferencedEntity AS ref ON ref.DummyEntity = DummyEntity.x_id "
+ + "dummy_entity.key-column AS key-column "
+ + "FROM dummy_entity LEFT OUTER JOIN referenced_entity AS ref ON ref.dummy_entity = dummy_entity.x_id "
+ "WHERE back-ref = :back-ref " + "ORDER BY key-column");
}
diff --git a/src/test/java/org/springframework/data/jdbc/core/conversion/JdbcEntityWriterUnitTests.java b/src/test/java/org/springframework/data/jdbc/core/conversion/JdbcEntityWriterUnitTests.java
index b86e2ae2..9ab9c0f0 100644
--- a/src/test/java/org/springframework/data/jdbc/core/conversion/JdbcEntityWriterUnitTests.java
+++ b/src/test/java/org/springframework/data/jdbc/core/conversion/JdbcEntityWriterUnitTests.java
@@ -359,11 +359,11 @@ public class JdbcEntityWriterUnitTests {
}
private Object getMapKey(DbAction a) {
- return a.getAdditionalValues().get("MapContainer_key");
+ return a.getAdditionalValues().get("map_container_key");
}
private Object getListKey(DbAction a) {
- return a.getAdditionalValues().get("ListContainer_key");
+ return a.getAdditionalValues().get("list_container_key");
}
private String extractPath(DbAction action) {
diff --git a/src/test/java/org/springframework/data/jdbc/core/mapping/NamingStrategyUnitTests.java b/src/test/java/org/springframework/data/jdbc/core/mapping/NamingStrategyUnitTests.java
index ba3dfdb2..78163f75 100644
--- a/src/test/java/org/springframework/data/jdbc/core/mapping/NamingStrategyUnitTests.java
+++ b/src/test/java/org/springframework/data/jdbc/core/mapping/NamingStrategyUnitTests.java
@@ -32,6 +32,7 @@ import org.springframework.data.jdbc.core.mapping.JdbcPersistentEntityImplUnitTe
*
* @author Kazuki Shimizu
* @author Oliver Gierke
+ * @author Jens Schauder
*/
public class NamingStrategyUnitTests {
@@ -42,31 +43,31 @@ public class NamingStrategyUnitTests {
@Test
public void getTableName() {
- assertThat(target.getTableName(persistentEntity.getType())).isEqualTo("DummyEntity");
- assertThat(target.getTableName(DummySubEntity.class)).isEqualTo("DummySubEntity");
+ assertThat(target.getTableName(persistentEntity.getType())).isEqualTo("dummy_entity");
+ assertThat(target.getTableName(DummySubEntity.class)).isEqualTo("dummy_sub_entity");
}
@Test
public void getColumnName() {
assertThat(target.getColumnName(persistentEntity.getPersistentProperty("id"))).isEqualTo("id");
- assertThat(target.getColumnName(persistentEntity.getPersistentProperty("createdAt"))).isEqualTo("createdAt");
+ assertThat(target.getColumnName(persistentEntity.getPersistentProperty("createdAt"))).isEqualTo("created_at");
assertThat(target.getColumnName(persistentEntity.getPersistentProperty("dummySubEntities")))
- .isEqualTo("dummySubEntities");
+ .isEqualTo("dummy_sub_entities");
}
@Test
public void getReverseColumnName() {
assertThat(target.getReverseColumnName(persistentEntity.getPersistentProperty("dummySubEntities")))
- .isEqualTo("DummyEntity");
+ .isEqualTo("dummy_entity");
}
@Test
public void getKeyColumn() {
assertThat(target.getKeyColumn(persistentEntity.getPersistentProperty("dummySubEntities")))
- .isEqualTo("DummyEntity_key");
+ .isEqualTo("dummy_entity_key");
}
@Test
@@ -77,7 +78,7 @@ public class NamingStrategyUnitTests {
@Test
public void getQualifiedTableName() {
- assertThat(target.getQualifiedTableName(persistentEntity.getType())).isEqualTo("DummyEntity");
+ assertThat(target.getQualifiedTableName(persistentEntity.getType())).isEqualTo("dummy_entity");
NamingStrategy strategy = new NamingStrategy() {
@Override
@@ -86,7 +87,7 @@ public class NamingStrategyUnitTests {
}
};
- assertThat(strategy.getQualifiedTableName(persistentEntity.getType())).isEqualTo("schema.DummyEntity");
+ assertThat(strategy.getQualifiedTableName(persistentEntity.getType())).isEqualTo("schema.dummy_entity");
}
static class DummyEntity {
diff --git a/src/test/java/org/springframework/data/jdbc/core/mapping/DelimiterNamingStrategyUnitTests.java b/src/test/java/org/springframework/data/jdbc/mapping/model/NamingStrategyUnitTests.java
similarity index 80%
rename from src/test/java/org/springframework/data/jdbc/core/mapping/DelimiterNamingStrategyUnitTests.java
rename to src/test/java/org/springframework/data/jdbc/mapping/model/NamingStrategyUnitTests.java
index 8a67f011..e0e13ffd 100644
--- a/src/test/java/org/springframework/data/jdbc/core/mapping/DelimiterNamingStrategyUnitTests.java
+++ b/src/test/java/org/springframework/data/jdbc/mapping/model/NamingStrategyUnitTests.java
@@ -13,9 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.data.jdbc.core.mapping;
+package org.springframework.data.jdbc.mapping.model;
import static org.assertj.core.api.Assertions.*;
+import static org.mockito.Mockito.*;
import lombok.Data;
@@ -24,22 +25,23 @@ import java.util.List;
import org.junit.Test;
import org.springframework.data.annotation.Id;
-import org.springframework.data.jdbc.core.mapping.DelimiterNamingStrategy;
+import org.springframework.data.jdbc.core.mapping.ConversionCustomizer;
import org.springframework.data.jdbc.core.mapping.JdbcMappingContext;
import org.springframework.data.jdbc.core.mapping.JdbcPersistentEntity;
+import org.springframework.data.jdbc.core.mapping.NamingStrategy;
/**
- * Unit tests for the {@link DelimiterNamingStrategy}.
+ * Unit tests for the default {@link NamingStrategy}.
*
* @author Kazuki Shimizu
- * @author Oliver Gierke
+ * @author Jens Schauder
*/
-public class DelimiterNamingStrategyUnitTests {
+public class NamingStrategyUnitTests {
- DelimiterNamingStrategy target = new DelimiterNamingStrategy();
+ private final NamingStrategy target = NamingStrategy.INSTANCE;
- JdbcPersistentEntity> persistentEntity = new JdbcMappingContext(target)
- .getRequiredPersistentEntity(DummyEntity.class);
+ private final JdbcPersistentEntity> persistentEntity = //
+ new JdbcMappingContext(target, mock(ConversionCustomizer.class)).getRequiredPersistentEntity(DummyEntity.class);
@Test // DATAJDBC-184
public void getTableName() {
diff --git a/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryIntegrationTests.java
index 75c6edd8..18878a38 100644
--- a/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryIntegrationTests.java
+++ b/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryIntegrationTests.java
@@ -78,8 +78,8 @@ public class JdbcRepositoryIntegrationTests {
DummyEntity entity = repository.save(createDummyEntity());
- assertThat(JdbcTestUtils.countRowsInTableWhere((JdbcTemplate) template.getJdbcOperations(), "dummyentity",
- "idProp = " + entity.getIdProp())).isEqualTo(1);
+ assertThat(JdbcTestUtils.countRowsInTableWhere((JdbcTemplate) template.getJdbcOperations(), "dummy_entity",
+ "id_Prop = " + entity.getIdProp())).isEqualTo(1);
}
@Test // DATAJDBC-95
diff --git a/src/test/java/org/springframework/data/jdbc/repository/query/QueryAnnotationHsqlIntegrationTests.java b/src/test/java/org/springframework/data/jdbc/repository/query/QueryAnnotationHsqlIntegrationTests.java
index 50dabf46..9fc48924 100644
--- a/src/test/java/org/springframework/data/jdbc/repository/query/QueryAnnotationHsqlIntegrationTests.java
+++ b/src/test/java/org/springframework/data/jdbc/repository/query/QueryAnnotationHsqlIntegrationTests.java
@@ -278,30 +278,30 @@ public class QueryAnnotationHsqlIntegrationTests {
private interface DummyEntityRepository extends CrudRepository {
// DATAJDBC-164
- @Query("SELECT * FROM DUMMYENTITY WHERE lower(name) <> name")
+ @Query("SELECT * FROM DUMMY_ENTITY WHERE lower(name) <> name")
List findByNameContainingCapitalLetter();
// DATAJDBC-164
- @Query("SELECT * FROM DUMMYENTITY WHERE name < :upper and name > :lower")
+ @Query("SELECT * FROM DUMMY_ENTITY WHERE name < :upper and name > :lower")
List findByNamedRangeWithNamedParameter(@Param("lower") String lower, @Param("upper") String upper);
- @Query("SELECT * FROM DUMMYENTITY WHERE name = :name")
+ @Query("SELECT * FROM DUMMY_ENTITY WHERE name = :name")
Optional findByNameAsOptional(@Param("name") String name);
// DATAJDBC-172
- @Query("SELECT * FROM DUMMYENTITY WHERE name = :name")
+ @Query("SELECT * FROM DUMMY_ENTITY WHERE name = :name")
DummyEntity findByNameAsEntity(@Param("name") String name);
// DATAJDBC-172
- @Query("SELECT * FROM DUMMYENTITY")
+ @Query("SELECT * FROM DUMMY_ENTITY")
Stream findAllWithReturnTypeIsStream();
// DATAJDBC-175
- @Query("SELECT count(*) FROM DUMMYENTITY WHERE name like '%' || :name || '%'")
+ @Query("SELECT count(*) FROM DUMMY_ENTITY WHERE name like '%' || :name || '%'")
int countByNameContaining(@Param("name") String name);
// DATAJDBC-175
- @Query("SELECT count(*) FROM DUMMYENTITY WHERE name like '%' || :name || '%'")
+ @Query("SELECT count(*) FROM DUMMY_ENTITY WHERE name like '%' || :name || '%'")
boolean existsByNameContaining(@Param("name") String name);
// DATAJDBC-175
@@ -314,17 +314,17 @@ public class QueryAnnotationHsqlIntegrationTests {
// DATAJDBC-182
@Modifying
- @Query("UPDATE DUMMYENTITY SET name = :name WHERE id = :id")
+ @Query("UPDATE DUMMY_ENTITY SET name = :name WHERE id = :id")
int updateName(@Param("id") Long id, @Param("name") String name);
// DATAJDBC-182
@Modifying
- @Query("DELETE FROM DUMMYENTITY WHERE name = :name")
+ @Query("DELETE FROM DUMMY_ENTITY WHERE name = :name")
boolean deleteByName(@Param("name") String name);
// DATAJDBC-182
@Modifying
- @Query("INSERT INTO DUMMYENTITY (name) VALUES(:name)")
+ @Query("INSERT INTO DUMMY_ENTITY (name) VALUES(:name)")
void insert(@Param("name") String name);
}
diff --git a/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-hsql.sql b/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-hsql.sql
index a20900fd..20a0a290 100644
--- a/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-hsql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-hsql.sql
@@ -1,5 +1,5 @@
-CREATE TABLE LEGOSET ( id BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) PRIMARY KEY, NAME VARCHAR(30));
-CREATE TABLE MANUAL ( id BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) PRIMARY KEY, LEGOSET BIGINT, CONTENT VARCHAR(2000));
+CREATE TABLE LEGO_SET ( id BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) PRIMARY KEY, NAME VARCHAR(30));
+CREATE TABLE MANUAL ( id BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) PRIMARY KEY, LEGO_SET BIGINT, CONTENT VARCHAR(2000));
-ALTER TABLE MANUAL ADD FOREIGN KEY (LEGOSET)
-REFERENCES LEGOSET(id);
+ALTER TABLE MANUAL ADD FOREIGN KEY (LEGO_SET)
+REFERENCES LEGO_SET(id);
diff --git a/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-mariadb.sql b/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-mariadb.sql
index a3a84905..0ac78e63 100644
--- a/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-mariadb.sql
+++ b/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-mariadb.sql
@@ -1,5 +1,5 @@
-CREATE TABLE LEGOSET ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(30));
-CREATE TABLE MANUAL ( id BIGINT AUTO_INCREMENT PRIMARY KEY, LEGOSET BIGINT, CONTENT VARCHAR(2000));
+CREATE TABLE LEGO_SET ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(30));
+CREATE TABLE MANUAL ( id BIGINT AUTO_INCREMENT PRIMARY KEY, LEGO_SET BIGINT, CONTENT VARCHAR(2000));
-ALTER TABLE MANUAL ADD FOREIGN KEY (LEGOSET)
-REFERENCES LEGOSET(id);
+ALTER TABLE MANUAL ADD FOREIGN KEY (LEGO_SET)
+REFERENCES LEGO_SET(id);
diff --git a/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-mysql.sql b/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-mysql.sql
index a3a84905..0ac78e63 100644
--- a/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-mysql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-mysql.sql
@@ -1,5 +1,5 @@
-CREATE TABLE LEGOSET ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(30));
-CREATE TABLE MANUAL ( id BIGINT AUTO_INCREMENT PRIMARY KEY, LEGOSET BIGINT, CONTENT VARCHAR(2000));
+CREATE TABLE LEGO_SET ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(30));
+CREATE TABLE MANUAL ( id BIGINT AUTO_INCREMENT PRIMARY KEY, LEGO_SET BIGINT, CONTENT VARCHAR(2000));
-ALTER TABLE MANUAL ADD FOREIGN KEY (LEGOSET)
-REFERENCES LEGOSET(id);
+ALTER TABLE MANUAL ADD FOREIGN KEY (LEGO_SET)
+REFERENCES LEGO_SET(id);
diff --git a/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-postgres.sql b/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-postgres.sql
index e13b2925..e36e5607 100644
--- a/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-postgres.sql
+++ b/src/test/resources/org.springframework.data.jdbc.core/JdbcEntityTemplateIntegrationTests-postgres.sql
@@ -1,8 +1,8 @@
DROP TABLE MANUAL;
-DROP TABLE LEGOSET;
+DROP TABLE LEGO_SET;
-CREATE TABLE LEGOSET ( id SERIAL PRIMARY KEY, NAME VARCHAR(30));
-CREATE TABLE MANUAL ( id SERIAL PRIMARY KEY, LEGOSET BIGINT, CONTENT VARCHAR(2000));
+CREATE TABLE LEGO_SET ( id SERIAL PRIMARY KEY, NAME VARCHAR(30));
+CREATE TABLE MANUAL ( id SERIAL PRIMARY KEY, LEGO_SET BIGINT, CONTENT VARCHAR(2000));
-ALTER TABLE MANUAL ADD FOREIGN KEY (LEGOSET)
-REFERENCES LEGOSET(id);
+ALTER TABLE MANUAL ADD FOREIGN KEY (LEGO_SET)
+REFERENCES LEGO_SET(id);
diff --git a/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcAuditingHsqlIntegrationTests-hsql.sql b/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcAuditingHsqlIntegrationTests-hsql.sql
index fc86c5cf..7763dd23 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcAuditingHsqlIntegrationTests-hsql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcAuditingHsqlIntegrationTests-hsql.sql
@@ -1,8 +1,8 @@
CREATE TABLE DummyEntity (
id BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY,
name VARCHAR(128),
- createdBy VARCHAR(128),
- createdDate TIMESTAMP,
- lastModifiedBy VARCHAR(128),
- lastModifiedDate TIMESTAMP
+ created_By VARCHAR(128),
+ created_Date TIMESTAMP,
+ last_Modified_By VARCHAR(128),
+ last_Modified_Date TIMESTAMP
);
\ No newline at end of file
diff --git a/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-hsql.sql b/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-hsql.sql
index ee4d4de3..aab1bd85 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-hsql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-hsql.sql
@@ -1 +1 @@
-CREATE TABLE DummyEntity ( id BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY)
\ No newline at end of file
+CREATE TABLE Dummy_Entity ( id BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY)
\ No newline at end of file
diff --git a/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-mariadb.sql b/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-mariadb.sql
index 808c99e6..ec172704 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-mariadb.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-mariadb.sql
@@ -1 +1 @@
-CREATE TABLE DummyEntity ( id BIGINT AUTO_INCREMENT PRIMARY KEY)
\ No newline at end of file
+CREATE TABLE Dummy_Entity ( id BIGINT AUTO_INCREMENT PRIMARY KEY)
\ No newline at end of file
diff --git a/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-mysql.sql b/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-mysql.sql
index 808c99e6..ec172704 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-mysql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-mysql.sql
@@ -1 +1 @@
-CREATE TABLE DummyEntity ( id BIGINT AUTO_INCREMENT PRIMARY KEY)
\ No newline at end of file
+CREATE TABLE Dummy_Entity ( id BIGINT AUTO_INCREMENT PRIMARY KEY)
\ No newline at end of file
diff --git a/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-postgres.sql b/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-postgres.sql
index 0a855395..78469c6d 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-postgres.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-postgres.sql
@@ -1,2 +1,2 @@
-DROP TABLE DummyEntity
-CREATE TABLE DummyEntity ( id SERIAL PRIMARY KEY)
\ No newline at end of file
+DROP TABLE Dummy_Entity
+CREATE TABLE Dummy_Entity ( id SERIAL PRIMARY KEY)
\ No newline at end of file
diff --git a/src/test/resources/org.springframework.data.jdbc.repository.query/QueryAnnotationHsqlIntegrationTests-hsql.sql b/src/test/resources/org.springframework.data.jdbc.repository.query/QueryAnnotationHsqlIntegrationTests-hsql.sql
index 23bf117b..12c793ea 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository.query/QueryAnnotationHsqlIntegrationTests-hsql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository.query/QueryAnnotationHsqlIntegrationTests-hsql.sql
@@ -1 +1 @@
-CREATE TABLE dummyentity ( id BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY, NAME VARCHAR(100))
+CREATE TABLE dummy_entity ( id BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY, NAME VARCHAR(100))
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-hsql.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-hsql.sql
index d6458976..7d747dff 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-hsql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-hsql.sql
@@ -1 +1 @@
-CREATE TABLE dummyentity ( idProp BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY, NAME VARCHAR(100))
+CREATE TABLE dummy_entity ( id_Prop BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY, NAME VARCHAR(100))
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-mariadb.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-mariadb.sql
index 89763ecd..2f008796 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-mariadb.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-mariadb.sql
@@ -1 +1 @@
-CREATE TABLE dummyentity (idProp BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
+CREATE TABLE dummy_entity (id_Prop BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-mysql.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-mysql.sql
index 89763ecd..2f008796 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-mysql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-mysql.sql
@@ -1 +1 @@
-CREATE TABLE dummyentity (idProp BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
+CREATE TABLE dummy_entity (id_Prop BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-postgres.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-postgres.sql
index 25e9c426..7d6c03bb 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-postgres.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-postgres.sql
@@ -1,2 +1,2 @@
-DROP TABLE dummyentity;
-CREATE TABLE dummyentity (idProp SERIAL PRIMARY KEY, NAME VARCHAR(100));
+DROP TABLE dummy_entity;
+CREATE TABLE dummy_entity (id_Prop SERIAL PRIMARY KEY, NAME VARCHAR(100));
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-hsql.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-hsql.sql
index 27f8287c..616c4a8c 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-hsql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-hsql.sql
@@ -1,2 +1,2 @@
-CREATE TABLE dummyentity ( id BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY, NAME VARCHAR(100), DELETED CHAR(1), log BIGINT);
+CREATE TABLE dummy_entity ( id BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY, NAME VARCHAR(100), DELETED CHAR(1), log BIGINT);
CREATE TABLE log ( id BIGINT, TEXT VARCHAR(100));
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-mariadb.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-mariadb.sql
index 9b52d44d..f536225e 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-mariadb.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-mariadb.sql
@@ -1,2 +1,2 @@
-CREATE TABLE dummyentity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100), DELETED CHAR(1), log BIGINT);
+CREATE TABLE dummy_entity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100), DELETED CHAR(1), log BIGINT);
CREATE TABLE log ( id BIGINT, TEXT VARCHAR(100));
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-mysql.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-mysql.sql
index 9b52d44d..f536225e 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-mysql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-mysql.sql
@@ -1,2 +1,2 @@
-CREATE TABLE dummyentity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100), DELETED CHAR(1), log BIGINT);
+CREATE TABLE dummy_entity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100), DELETED CHAR(1), log BIGINT);
CREATE TABLE log ( id BIGINT, TEXT VARCHAR(100));
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-postgres.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-postgres.sql
index 703cd57f..4ce926ec 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-postgres.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-postgres.sql
@@ -1,4 +1,4 @@
-DROP TABLE dummyentity;
+DROP TABLE dummy_entity;
DROP TABLE log;
-CREATE TABLE dummyentity ( id SERIAL PRIMARY KEY, NAME VARCHAR(100), DELETED CHAR(5), log BIGINT);
+CREATE TABLE dummy_entity ( id SERIAL PRIMARY KEY, NAME VARCHAR(100), DELETED CHAR(5), log BIGINT);
CREATE TABLE log ( id BIGINT, TEXT VARCHAR(100));
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-hsql.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-hsql.sql
index e60eb17b..8fe6fbee 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-hsql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-hsql.sql
@@ -1 +1 @@
-CREATE TABLE ENTITYWITHCOLUMNSREQUIRINGCONVERSIONS ( idTimestamp DATETIME PRIMARY KEY, bool boolean, SOMEENUM VARCHAR(100), bigDecimal DECIMAL(1025), bigInteger DECIMAL(20), date DATETIME, localDateTime DATETIME, zonedDateTime VARCHAR(30))
+CREATE TABLE ENTITY_WITH_COLUMNS_REQUIRING_CONVERSIONS ( id_Timestamp DATETIME PRIMARY KEY, bool boolean, SOME_ENUM VARCHAR(100), big_Decimal DECIMAL(1025), big_Integer DECIMAL(20), date DATETIME, local_Date_Time DATETIME, zoned_Date_Time VARCHAR(30))
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-mariadb.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-mariadb.sql
index 91f0b575..3f08147d 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-mariadb.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-mariadb.sql
@@ -1 +1 @@
-CREATE TABLE ENTITYWITHCOLUMNSREQUIRINGCONVERSIONS ( idTimestamp DATETIME PRIMARY KEY, bool boolean, SOMEENUM VARCHAR(100), bigDecimal DECIMAL(65), bigInteger DECIMAL(20), date DATETIME, localDateTime DATETIME, zonedDateTime VARCHAR(30))
+CREATE TABLE ENTITY_WITH_COLUMNS_REQUIRING_CONVERSIONS ( id_Timestamp DATETIME PRIMARY KEY, bool boolean, SOME_ENUM VARCHAR(100), big_Decimal DECIMAL(65), big_Integer DECIMAL(20), date DATETIME, local_Date_Time DATETIME, zoned_Date_Time VARCHAR(30))
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-mysql.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-mysql.sql
index 91f0b575..3f08147d 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-mysql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-mysql.sql
@@ -1 +1 @@
-CREATE TABLE ENTITYWITHCOLUMNSREQUIRINGCONVERSIONS ( idTimestamp DATETIME PRIMARY KEY, bool boolean, SOMEENUM VARCHAR(100), bigDecimal DECIMAL(65), bigInteger DECIMAL(20), date DATETIME, localDateTime DATETIME, zonedDateTime VARCHAR(30))
+CREATE TABLE ENTITY_WITH_COLUMNS_REQUIRING_CONVERSIONS ( id_Timestamp DATETIME PRIMARY KEY, bool boolean, SOME_ENUM VARCHAR(100), big_Decimal DECIMAL(65), big_Integer DECIMAL(20), date DATETIME, local_Date_Time DATETIME, zoned_Date_Time VARCHAR(30))
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-postgres.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-postgres.sql
index 0384fb55..c55f4c32 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-postgres.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-postgres.sql
@@ -1,2 +1,2 @@
-DROP TABLE ENTITYWITHCOLUMNSREQUIRINGCONVERSIONS;
-CREATE TABLE ENTITYWITHCOLUMNSREQUIRINGCONVERSIONS ( idTimestamp TIMESTAMP PRIMARY KEY, bool boolean, SOMEENUM VARCHAR(100), bigDecimal DECIMAL(65), bigInteger BIGINT, date TIMESTAMP, localDateTime TIMESTAMP, zonedDateTime VARCHAR(30))
+DROP TABLE ENTITY_WITH_COLUMNS_REQUIRING_CONVERSIONS;
+CREATE TABLE ENTITY_WITH_COLUMNS_REQUIRING_CONVERSIONS ( id_Timestamp TIMESTAMP PRIMARY KEY, bool boolean, SOME_ENUM VARCHAR(100), big_Decimal DECIMAL(65), big_Integer BIGINT, date TIMESTAMP, local_Date_Time TIMESTAMP, zoned_Date_Time VARCHAR(30))
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-hsql.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-hsql.sql
index 814e583a..480b9f27 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-hsql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-hsql.sql
@@ -1,2 +1,2 @@
-CREATE TABLE dummyentity ( id BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY, NAME VARCHAR(100));
-CREATE TABLE element (id BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1) PRIMARY KEY, content VARCHAR(100), dummyentity BIGINT);
+CREATE TABLE dummy_entity ( id BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY, NAME VARCHAR(100));
+CREATE TABLE element (id BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1) PRIMARY KEY, content VARCHAR(100), dummy_entity BIGINT);
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-mariadb.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-mariadb.sql
index 0e0a7e56..29432839 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-mariadb.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-mariadb.sql
@@ -1,2 +1,2 @@
-CREATE TABLE dummyentity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
-CREATE TABLE element (id BIGINT AUTO_INCREMENT PRIMARY KEY, content VARCHAR(100), dummyentity BIGINT);
+CREATE TABLE dummy_entity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
+CREATE TABLE element (id BIGINT AUTO_INCREMENT PRIMARY KEY, content VARCHAR(100), dummy_entity BIGINT);
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-mysql.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-mysql.sql
index 0e0a7e56..29432839 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-mysql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-mysql.sql
@@ -1,2 +1,2 @@
-CREATE TABLE dummyentity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
-CREATE TABLE element (id BIGINT AUTO_INCREMENT PRIMARY KEY, content VARCHAR(100), dummyentity BIGINT);
+CREATE TABLE dummy_entity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
+CREATE TABLE element (id BIGINT AUTO_INCREMENT PRIMARY KEY, content VARCHAR(100), dummy_entity BIGINT);
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-postgres.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-postgres.sql
index cfab77d5..824a1e94 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-postgres.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-postgres.sql
@@ -1,4 +1,4 @@
DROP TABLE element;
-DROP TABLE dummyentity;
-CREATE TABLE dummyentity ( id SERIAL PRIMARY KEY, NAME VARCHAR(100));
-CREATE TABLE element (id SERIAL PRIMARY KEY, content VARCHAR(100), dummyentity BIGINT);
+DROP TABLE dummy_entity;
+CREATE TABLE dummy_entity ( id SERIAL PRIMARY KEY, NAME VARCHAR(100));
+CREATE TABLE element (id SERIAL PRIMARY KEY, content VARCHAR(100), dummy_entity BIGINT);
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-hsql.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-hsql.sql
index 8ef56e10..73abf96c 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-hsql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-hsql.sql
@@ -1,2 +1,2 @@
-CREATE TABLE dummyentity ( id BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY, NAME VARCHAR(100));
-CREATE TABLE element (id BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1) PRIMARY KEY, content VARCHAR(100), DummyEntity_key BIGINT, dummyentity BIGINT);
+CREATE TABLE dummy_entity ( id BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY, NAME VARCHAR(100));
+CREATE TABLE element (id BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1) PRIMARY KEY, content VARCHAR(100), Dummy_Entity_key BIGINT, dummy_entity BIGINT);
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-mariadb.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-mariadb.sql
index 7dad33bd..4cff7496 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-mariadb.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-mariadb.sql
@@ -1,2 +1,2 @@
-CREATE TABLE dummyentity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
-CREATE TABLE element (id BIGINT AUTO_INCREMENT PRIMARY KEY, content VARCHAR(100), DummyEntity_key BIGINT,dummyentity BIGINT);
+CREATE TABLE dummy_entity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
+CREATE TABLE element (id BIGINT AUTO_INCREMENT PRIMARY KEY, content VARCHAR(100), Dummy_Entity_key BIGINT,dummy_entity BIGINT);
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-mysql.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-mysql.sql
index 7dad33bd..4cff7496 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-mysql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-mysql.sql
@@ -1,2 +1,2 @@
-CREATE TABLE dummyentity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
-CREATE TABLE element (id BIGINT AUTO_INCREMENT PRIMARY KEY, content VARCHAR(100), DummyEntity_key BIGINT,dummyentity BIGINT);
+CREATE TABLE dummy_entity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
+CREATE TABLE element (id BIGINT AUTO_INCREMENT PRIMARY KEY, content VARCHAR(100), Dummy_Entity_key BIGINT,dummy_entity BIGINT);
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-postgres.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-postgres.sql
index 80fd52e3..c61ae2bd 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-postgres.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-postgres.sql
@@ -1,4 +1,4 @@
DROP TABLE element;
-DROP TABLE dummyentity;
-CREATE TABLE dummyentity ( id SERIAL PRIMARY KEY, NAME VARCHAR(100));
-CREATE TABLE element (id SERIAL PRIMARY KEY, content VARCHAR(100),dummyentity_key BIGINT, dummyentity BIGINT);
+DROP TABLE dummy_entity;
+CREATE TABLE dummy_entity ( id SERIAL PRIMARY KEY, NAME VARCHAR(100));
+CREATE TABLE element (id SERIAL PRIMARY KEY, content VARCHAR(100),dummy_entity_key BIGINT, dummy_entity BIGINT);
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-hsql.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-hsql.sql
index 9e813b30..33c747b6 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-hsql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-hsql.sql
@@ -1,2 +1,2 @@
-CREATE TABLE dummyentity ( id BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY, NAME VARCHAR(100));
-CREATE TABLE element (id BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1) PRIMARY KEY, content VARCHAR(100), DummyEntity_key VARCHAR(100), dummyentity BIGINT);
+CREATE TABLE dummy_entity ( id BIGINT GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 ) PRIMARY KEY, NAME VARCHAR(100));
+CREATE TABLE element (id BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1) PRIMARY KEY, content VARCHAR(100), Dummy_Entity_key VARCHAR(100), dummy_entity BIGINT);
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-mariadb.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-mariadb.sql
index f30df0af..fdd3be31 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-mariadb.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-mariadb.sql
@@ -1,2 +1,2 @@
-CREATE TABLE dummyentity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
-CREATE TABLE element (id BIGINT AUTO_INCREMENT PRIMARY KEY, content VARCHAR(100), DummyEntity_key VARCHAR(100),dummyentity BIGINT);
+CREATE TABLE dummy_entity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
+CREATE TABLE element (id BIGINT AUTO_INCREMENT PRIMARY KEY, content VARCHAR(100), Dummy_Entity_key VARCHAR(100),dummy_entity BIGINT);
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-mysql.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-mysql.sql
index f30df0af..fdd3be31 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-mysql.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-mysql.sql
@@ -1,2 +1,2 @@
-CREATE TABLE dummyentity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
-CREATE TABLE element (id BIGINT AUTO_INCREMENT PRIMARY KEY, content VARCHAR(100), DummyEntity_key VARCHAR(100),dummyentity BIGINT);
+CREATE TABLE dummy_entity ( id BIGINT AUTO_INCREMENT PRIMARY KEY, NAME VARCHAR(100));
+CREATE TABLE element (id BIGINT AUTO_INCREMENT PRIMARY KEY, content VARCHAR(100), Dummy_Entity_key VARCHAR(100),dummy_entity BIGINT);
diff --git a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-postgres.sql b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-postgres.sql
index 25562c65..6d1c0b3e 100644
--- a/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-postgres.sql
+++ b/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-postgres.sql
@@ -1,4 +1,4 @@
DROP TABLE element;
-DROP TABLE dummyentity;
-CREATE TABLE dummyentity ( id SERIAL PRIMARY KEY, NAME VARCHAR(100));
-CREATE TABLE element (id SERIAL PRIMARY KEY, content VARCHAR(100),dummyentity_key VARCHAR(100), dummyentity BIGINT);
+DROP TABLE dummy_entity;
+CREATE TABLE dummy_entity ( id SERIAL PRIMARY KEY, NAME VARCHAR(100));
+CREATE TABLE element (id SERIAL PRIMARY KEY, content VARCHAR(100),dummy_entity_key VARCHAR(100), dummy_entity BIGINT);