DATACASS-747 - Add test to verify quoting of field names.

This commit is contained in:
Mark Paluch
2020-03-30 10:14:25 +02:00
parent 0a59375479
commit c9978f7a72

View File

@@ -389,6 +389,15 @@ public class CassandraMappingContextUnitTests {
assertThat(mappingContext.usesTable(tableMetadata.getName())).isFalse();
}
@Test // DATACASS-747
public void shouldQuoteFieldName() {
BasicCassandraPersistentEntity<?> entity = mappingContext.getRequiredPersistentEntity(UnsupportedFieldNames.class);
CassandraPersistentProperty property = entity.getRequiredPersistentProperty("_ent1");
assertThat(property.getColumnName()).isEqualTo(CqlIdentifier.fromCql("\"_ent1\""));
}
@Table
private static class InvalidEntityWithIdAndPrimaryKeyColumn {
@Id String foo;
@@ -447,4 +456,9 @@ public class CassandraMappingContextUnitTests {
public static class AnotherNested {
String str;
}
class UnsupportedFieldNames {
String _ent1;
String _ent2;
}
}