Skip to content

Commit d834e4b

Browse files
committed
Update table name getter so reserved keywords can be used as table name
1 parent 061db01 commit d834e4b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>cz.foresttech</groupId>
88
<artifactId>ForestDatabase</artifactId>
9-
<version>1.0.1</version>
9+
<version>1.0.2</version>
1010

1111
<properties>
1212
<maven.compiler.source>17</maven.compiler.source>

src/main/java/cz/foresttech/database/DatabaseEntityConvertor.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,11 @@ private static String getTableName(Class<?> clazz) {
438438
tableName = camelCaseToSnakeCase(clazz.getSimpleName());
439439
}
440440

441-
return tableName;
441+
if (tableName.isEmpty()) {
442+
return tableName;
443+
}
444+
445+
return "\"" + tableName + "\"";
442446
}
443447

444448
/**

0 commit comments

Comments
 (0)