Skip to content

Commit ca09dc6

Browse files
committed
Deprecate SqlTable methods that accept suppliers
A supplier creates an effectively mutable object and this is against the principles of the library. The AliasableSqlTable object provides support for changing the table name and should be used instead.
1 parent 2ab5568 commit ca09dc6

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/main/java/org/mybatis/dynamic/sql/SqlTable.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,40 @@ protected SqlTable(String tableName) {
3232
this.nameSupplier = () -> tableName;
3333
}
3434

35+
/**
36+
* Creates an SqlTable whose name can be changed at runtime
37+
*
38+
* @param tableNameSupplier table name supplier
39+
* @deprecated please use {@link AliasableSqlTable} if you need to change the table name at runtime
40+
*/
41+
@Deprecated
3542
protected SqlTable(Supplier<String> tableNameSupplier) {
3643
Objects.requireNonNull(tableNameSupplier);
3744

3845
this.nameSupplier = tableNameSupplier;
3946
}
4047

48+
/**
49+
* Creates an SqlTable whose name can be changed at runtime
50+
*
51+
* @param schemaSupplier schema supplier
52+
* @param tableName table name
53+
* @deprecated please use {@link AliasableSqlTable} if you need to change the table name at runtime
54+
*/
55+
@Deprecated
4156
protected SqlTable(Supplier<Optional<String>> schemaSupplier, String tableName) {
4257
this(Optional::empty, schemaSupplier, tableName);
4358
}
4459

60+
/**
61+
* Creates an SqlTable whose name can be changed at runtime
62+
*
63+
* @param catalogSupplier catalog supplier
64+
* @param schemaSupplier schema supplier
65+
* @param tableName table name
66+
* @deprecated please use {@link AliasableSqlTable} if you need to change the table name at runtime
67+
*/
68+
@Deprecated
4569
protected SqlTable(Supplier<Optional<String>> catalogSupplier, Supplier<Optional<String>> schemaSupplier,
4670
String tableName) {
4771
Objects.requireNonNull(catalogSupplier);

0 commit comments

Comments
 (0)