Skip to content

Commit 7377db1

Browse files
committed
Remove unusual visitor method
1 parent ce7a29c commit 7377db1

File tree

6 files changed

+6
-10
lines changed

6 files changed

+6
-10
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private BatchInsertRenderer(Builder<T> builder) {
3232

3333
public BatchInsert<T> render() {
3434
FieldAndValueCollector collector = model.columnMappings()
35-
.map(visitor::renderMapping)
35+
.map(m -> m.accept(visitor))
3636
.collect(FieldAndValueCollector.collect());
3737

3838
String insertStatement = InsertRenderingUtilities.calculateInsertStatement(model.table(), collector);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private GeneralInsertRenderer(Builder builder) {
3939

4040
public GeneralInsertStatementProvider render() {
4141
FieldAndValueCollector collector = model.columnMappings()
42-
.map(visitor::renderMapping)
42+
.map(m -> m.accept(visitor))
4343
.filter(Optional::isPresent)
4444
.map(Optional::get)
4545
.collect(FieldAndValueCollector.collect());

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private InsertRenderer(Builder<T> builder) {
3434

3535
public InsertStatementProvider<T> render() {
3636
FieldAndValueCollector collector = model.columnMappings()
37-
.map(visitor::renderMapping)
37+
.map(m -> m.accept(visitor))
3838
.filter(Optional::isPresent)
3939
.map(Optional::get)
4040
.collect(FieldAndValueCollector.collect());

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private MultiRowInsertRenderer(Builder<T> builder) {
3535

3636
public MultiRowInsertStatementProvider<T> render() {
3737
FieldAndValueCollector collector = model.columnMappings()
38-
.map(visitor::renderMapping)
38+
.map(m -> m.accept(visitor))
3939
.collect(FieldAndValueCollector.collect());
4040

4141
String insertStatement = calculateInsertStatement(collector);

src/main/java/org/mybatis/dynamic/sql/update/render/UpdateRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private FragmentAndParameters calculateUpdateStatementStart() {
7878

7979
private FragmentAndParameters calculateSetPhrase() {
8080
List<Optional<FragmentAndParameters>> fragmentsAndParameters = updateModel.columnMappings()
81-
.map(visitor::renderMapping)
81+
.map(m -> m.accept(visitor))
8282
.collect(Collectors.toList());
8383

8484
Validator.assertFalse(fragmentsAndParameters.stream().noneMatch(Optional::isPresent),

src/main/java/org/mybatis/dynamic/sql/util/ColumnMappingVisitor.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* may or may not be supported. For example, it makes no sense to map a column to another column in
2222
* an insert - so the ColumnToColumnMapping is only supported on update statements.
2323
*
24-
* <p>Rather than implement this interface directly, we recommend implementing one of the derived
24+
* <p>Rather than implement this interface directly, we recommend extending one of the derived
2525
* classes. The derived classes encapsulate the rules about which mappings are applicable to the
2626
* different types of statements.
2727
*
@@ -31,10 +31,6 @@
3131
* The type of object created by the visitor
3232
*/
3333
public interface ColumnMappingVisitor<R> {
34-
default R renderMapping(AbstractColumnMapping mapping) {
35-
return mapping.accept(this);
36-
}
37-
3834
R visit(NullMapping mapping);
3935

4036
R visit(ConstantMapping mapping);

0 commit comments

Comments
 (0)