File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed
main/java/org/mybatis/dynamic/sql/insert/render
test/java/org/mybatis/dynamic/sql Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ public String getInsertStatementSQL() {
56
56
}
57
57
58
58
public List <T > getRecords () {
59
- return Collections . unmodifiableList ( records ) ;
59
+ return records ;
60
60
}
61
61
62
62
public static <T > Builder <T > withRecords (List <T > records ) {
Original file line number Diff line number Diff line change @@ -48,12 +48,43 @@ public String orderByName() {
48
48
49
49
@ Override
50
50
public boolean isDescending () {
51
- return true ;
51
+ return false ;
52
52
}
53
53
};
54
54
55
55
OrderByModel model = OrderByModel .of (List .of (ss ));
56
56
57
+ RenderingContext renderingContext = RenderingContext
58
+ .withRenderingStrategy (RenderingStrategies .MYBATIS3 )
59
+ .withTableAliasCalculator (TableAliasCalculator .empty ())
60
+ .withStatementConfiguration (new StatementConfiguration ())
61
+ .build ();
62
+ OrderByRenderer renderer = new OrderByRenderer (renderingContext );
63
+ FragmentAndParameters fp = renderer .render (model );
64
+ assertThat (fp .fragment ()).isEqualTo ("order by id" );
65
+ }
66
+
67
+ @ Test
68
+ void bothMethodsExistDescending () {
69
+ SortSpecification ss = new SortSpecification () {
70
+ @ Override
71
+ public SortSpecification descending () {
72
+ return this ;
73
+ }
74
+
75
+ @ Override
76
+ public String orderByName () {
77
+ return "id" ;
78
+ }
79
+
80
+ @ Override
81
+ public boolean isDescending () {
82
+ return true ;
83
+ }
84
+ };
85
+
86
+ OrderByModel model = OrderByModel .of (List .of (ss ));
87
+
57
88
RenderingContext renderingContext = RenderingContext
58
89
.withRenderingStrategy (RenderingStrategies .MYBATIS3 )
59
90
.withTableAliasCalculator (TableAliasCalculator .empty ())
You can’t perform that action at this time.
0 commit comments