17
17
18
18
import java .util .Collection ;
19
19
import java .util .List ;
20
- import java .util .Optional ;
21
20
import java .util .function .Function ;
22
21
import java .util .function .ToIntFunction ;
23
22
import java .util .function .ToLongFunction ;
32
31
import org .mybatis .dynamic .sql .insert .MultiRowInsertDSL ;
33
32
import org .mybatis .dynamic .sql .insert .render .InsertStatementProvider ;
34
33
import org .mybatis .dynamic .sql .insert .render .MultiRowInsertStatementProvider ;
35
- import org .mybatis .dynamic .sql .render .RenderingStrategy ;
34
+ import org .mybatis .dynamic .sql .render .RenderingStrategies ;
36
35
import org .mybatis .dynamic .sql .select .CompletableQuery ;
37
36
import org .mybatis .dynamic .sql .select .QueryExpressionDSL ;
38
37
import org .mybatis .dynamic .sql .select .SelectDSL ;
@@ -57,27 +56,27 @@ public static long count(ToLongFunction<SelectStatementProvider> mapper,
57
56
58
57
public static long count (ToLongFunction <SelectStatementProvider > mapper ,
59
58
QueryExpressionDSL <SelectModel > start , MyBatis3SelectCompleter completer ) {
60
- return mapper .applyAsLong (completer .apply (start ).build ().render (RenderingStrategy .MYBATIS3 ));
59
+ return mapper .applyAsLong (completer .apply (start ).build ().render (RenderingStrategies .MYBATIS3 ));
61
60
}
62
61
63
62
public static int deleteFrom (ToIntFunction <DeleteStatementProvider > mapper ,
64
63
SqlTable table , MyBatis3DeleteCompleter completer ) {
65
64
return mapper .applyAsInt (
66
65
completer .apply (DeleteDSL .deleteFrom (table ))
67
66
.build ()
68
- .render (RenderingStrategy .MYBATIS3 ));
67
+ .render (RenderingStrategies .MYBATIS3 ));
69
68
}
70
69
71
70
public static <R > int insert (ToIntFunction <InsertStatementProvider <R >> mapper , R record ,
72
71
SqlTable table , UnaryOperator <InsertDSL <R >> completer ) {
73
72
return mapper .applyAsInt (completer .apply (
74
- InsertDSL .insert (record ).into (table )).build ().render (RenderingStrategy .MYBATIS3 ));
73
+ InsertDSL .insert (record ).into (table )).build ().render (RenderingStrategies .MYBATIS3 ));
75
74
}
76
75
77
76
public static <R > int insertMultiple (ToIntFunction <MultiRowInsertStatementProvider <R >> mapper ,
78
77
Collection <R > records , SqlTable table , UnaryOperator <MultiRowInsertDSL <R >> completer ) {
79
78
return mapper .applyAsInt (completer .apply (
80
- MultiRowInsertDSL .insert (records ).into (table )).build ().render (RenderingStrategy .MYBATIS3 ));
79
+ MultiRowInsertDSL .insert (records ).into (table )).build ().render (RenderingStrategies .MYBATIS3 ));
81
80
}
82
81
83
82
public static <R > List <R > selectDistinct (Function <SelectStatementProvider , List <R >> mapper ,
@@ -87,7 +86,7 @@ public static <R> List<R> selectDistinct(Function<SelectStatementProvider, List<
87
86
88
87
public static <R > List <R > selectDistinct (Function <SelectStatementProvider , List <R >> mapper ,
89
88
CompletableQuery <SelectModel > start , MyBatis3SelectCompleter completer ) {
90
- return mapper .apply (completer .apply (start ).build ().render (RenderingStrategy .MYBATIS3 ));
89
+ return mapper .apply (completer .apply (start ).build ().render (RenderingStrategies .MYBATIS3 ));
91
90
}
92
91
93
92
public static <R > List <R > selectList (Function <SelectStatementProvider , List <R >> mapper ,
@@ -97,25 +96,25 @@ public static <R> List<R> selectList(Function<SelectStatementProvider, List<R>>
97
96
98
97
public static <R > List <R > selectList (Function <SelectStatementProvider , List <R >> mapper ,
99
98
CompletableQuery <SelectModel > start , MyBatis3SelectCompleter completer ) {
100
- return mapper .apply (completer .apply (start ).build ().render (RenderingStrategy .MYBATIS3 ));
99
+ return mapper .apply (completer .apply (start ).build ().render (RenderingStrategies .MYBATIS3 ));
101
100
}
102
101
103
- public static <R > Optional < R > selectOne (Function <SelectStatementProvider , Optional < R > > mapper ,
102
+ public static <R > R selectOne (Function <SelectStatementProvider , R > mapper ,
104
103
BasicColumn [] selectList , SqlTable table , MyBatis3SelectCompleter completer ) {
105
104
return selectOne (mapper , SelectDSL .select (selectList ).from (table ), completer );
106
105
}
107
106
108
- public static <R > Optional < R > selectOne (Function <SelectStatementProvider , Optional < R > > mapper ,
107
+ public static <R > R selectOne (Function <SelectStatementProvider , R > mapper ,
109
108
CompletableQuery <SelectModel > start ,
110
109
MyBatis3SelectCompleter completer ) {
111
- return mapper .apply (completer .apply (start ).build ().render (RenderingStrategy .MYBATIS3 ));
110
+ return mapper .apply (completer .apply (start ).build ().render (RenderingStrategies .MYBATIS3 ));
112
111
}
113
112
114
113
public static int update (ToIntFunction <UpdateStatementProvider > mapper ,
115
114
SqlTable table , MyBatis3UpdateCompleter completer ) {
116
115
return mapper .applyAsInt (
117
116
completer .apply (UpdateDSL .update (table ))
118
117
.build ()
119
- .render (RenderingStrategy .MYBATIS3 ));
118
+ .render (RenderingStrategies .MYBATIS3 ));
120
119
}
121
120
}
0 commit comments