Skip to content

Commit 24fef48

Browse files
committed
Remove Deprecated Java code
1 parent 3fb12f7 commit 24fef48

File tree

12 files changed

+1
-647
lines changed

12 files changed

+1
-647
lines changed

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

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@
1717

1818
import java.util.Optional;
1919

20-
import org.mybatis.dynamic.sql.exception.DynamicSqlException;
2120
import org.mybatis.dynamic.sql.render.RenderingContext;
22-
import org.mybatis.dynamic.sql.render.TableAliasCalculator;
2321
import org.mybatis.dynamic.sql.util.FragmentAndParameters;
24-
import org.mybatis.dynamic.sql.util.Messages;
2522

2623
/**
2724
* Describes attributes of columns that are necessary for rendering if the column is not expected to
@@ -59,25 +56,7 @@ public interface BasicColumn {
5956
* @return a rendered SQL fragment and, optionally, parameters associated with the fragment
6057
* @since 1.5.1
6158
*/
62-
default FragmentAndParameters render(RenderingContext renderingContext) {
63-
// the default implementation ensures compatibility with prior releases. When the
64-
// deprecated renderWithTableAlias method is removed, this function can become purely abstract.
65-
// Also remove the method tableAliasCalculator() from RenderingContext.
66-
return FragmentAndParameters.fromFragment(renderWithTableAlias(renderingContext.tableAliasCalculator()));
67-
}
68-
69-
/**
70-
* Returns the name of the item aliased with a table name if appropriate.
71-
* For example, "a.foo". This is appropriate for where clauses and order by clauses.
72-
*
73-
* @param tableAliasCalculator the table alias calculator for the current renderer
74-
* @return the item name with the table alias applied
75-
* @deprecated Please replace this method by overriding the more general "render" method
76-
*/
77-
@Deprecated
78-
default String renderWithTableAlias(TableAliasCalculator tableAliasCalculator) {
79-
throw new DynamicSqlException(Messages.getString("ERROR.36")); //$NON-NLS-1$
80-
}
59+
FragmentAndParameters render(RenderingContext renderingContext);
8160

8261
/**
8362
* Utility method to make it easier to build column lists for methods that require an

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

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -32,77 +32,6 @@ 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
42-
protected SqlTable(Supplier<String> tableNameSupplier) {
43-
Objects.requireNonNull(tableNameSupplier);
44-
45-
this.nameSupplier = tableNameSupplier;
46-
}
47-
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
56-
protected SqlTable(Supplier<Optional<String>> schemaSupplier, String tableName) {
57-
this(Optional::empty, schemaSupplier, tableName);
58-
}
59-
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
69-
protected SqlTable(Supplier<Optional<String>> catalogSupplier, Supplier<Optional<String>> schemaSupplier,
70-
String tableName) {
71-
Objects.requireNonNull(catalogSupplier);
72-
Objects.requireNonNull(schemaSupplier);
73-
Objects.requireNonNull(tableName);
74-
75-
this.nameSupplier = () -> compose(catalogSupplier, schemaSupplier, tableName);
76-
}
77-
78-
private String compose(Supplier<Optional<String>> catalogSupplier, Supplier<Optional<String>> schemaSupplier,
79-
String tableName) {
80-
return catalogSupplier.get().map(c -> compose(c, schemaSupplier, tableName))
81-
.orElseGet(() -> compose(schemaSupplier, tableName));
82-
}
83-
84-
private String compose(String catalog, Supplier<Optional<String>> schemaSupplier, String tableName) {
85-
return schemaSupplier.get().map(s -> composeCatalogSchemaAndTable(catalog, s, tableName))
86-
.orElseGet(() -> composeCatalogAndTable(catalog, tableName));
87-
}
88-
89-
private String compose(Supplier<Optional<String>> schemaSupplier, String tableName) {
90-
return schemaSupplier.get().map(s -> composeSchemaAndTable(s, tableName))
91-
.orElse(tableName);
92-
}
93-
94-
private String composeCatalogAndTable(String catalog, String tableName) {
95-
return catalog + ".." + tableName; //$NON-NLS-1$
96-
}
97-
98-
private String composeSchemaAndTable(String schema, String tableName) {
99-
return schema + "." + tableName; //$NON-NLS-1$
100-
}
101-
102-
private String composeCatalogSchemaAndTable(String catalog, String schema, String tableName) {
103-
return catalog + "." + schema + "." + tableName; //$NON-NLS-1$ //$NON-NLS-2$
104-
}
105-
10635
public String tableNameAtRuntime() {
10736
return nameSupplier.get();
10837
}

src/main/java/org/mybatis/dynamic/sql/insert/render/DefaultInsertStatementProvider.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,11 @@
2121

2222
public class DefaultInsertStatementProvider<T> implements InsertStatementProvider<T> {
2323
private final String insertStatement;
24-
// need to keep both row and record for now so we don't break
25-
// old code. The MyBatis reflection utilities don't handle
26-
// the case where the attribute name is different from the getter.
27-
//
28-
// MyBatis Generator version 1.4.1 (March 8, 2022) changed to use "row" instead of "record".
29-
// Target March 2023 for removing "record" from MyBatis Dynamic SQL.
30-
private final T record;
3124
private final T row;
3225

3326
private DefaultInsertStatementProvider(Builder<T> builder) {
3427
insertStatement = Objects.requireNonNull(builder.insertStatement);
3528
row = Objects.requireNonNull(builder.row);
36-
record = row;
37-
}
38-
39-
@Override
40-
public T getRecord() {
41-
return record;
4229
}
4330

4431
@Override

src/main/java/org/mybatis/dynamic/sql/insert/render/InsertStatementProvider.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@
1818
import org.jetbrains.annotations.NotNull;
1919

2020
public interface InsertStatementProvider<T> {
21-
/**
22-
* Return the row associated with this insert statement.
23-
*
24-
* @return the row associated with this insert statement.
25-
*
26-
* @deprecated in favor of {@link InsertStatementProvider#getRow()}
27-
*/
28-
@Deprecated
29-
T getRecord();
30-
3121
/**
3222
* Return the row associated with this insert statement.
3323
*

src/test/java/examples/schema_supplier/SchemaSupplier.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/test/java/examples/schema_supplier/SchemaSupplierTest.java

Lines changed: 0 additions & 146 deletions
This file was deleted.

src/test/java/examples/schema_supplier/User.java

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)