@@ -109,6 +109,42 @@ public void testSelectAllRowsWithOrder() {
109
109
}
110
110
}
111
111
112
+ @ Test
113
+ public void testSelectAllRowsAllColumnsWithOrder () {
114
+ try (SqlSession sqlSession = sqlSessionFactory .openSession ()) {
115
+ AnimalDataMapper mapper = sqlSession .getMapper (AnimalDataMapper .class );
116
+ SelectStatementProvider selectStatement = select (animalData .allColumns ())
117
+ .from (animalData )
118
+ .orderBy (id .descending ())
119
+ .build ()
120
+ .render (RenderingStrategy .MYBATIS3 );
121
+ List <AnimalData > animals = mapper .selectMany (selectStatement );
122
+ assertAll (
123
+ () -> assertThat (selectStatement .getSelectStatement ()).isEqualTo ("select * from AnimalData order by id DESC" ),
124
+ () -> assertThat (animals .size ()).isEqualTo (65 ),
125
+ () -> assertThat (animals .get (0 ).getId ()).isEqualTo (65 )
126
+ );
127
+ }
128
+ }
129
+
130
+ @ Test
131
+ public void testSelectAllRowsAllColumnsWithOrderAndAlias () {
132
+ try (SqlSession sqlSession = sqlSessionFactory .openSession ()) {
133
+ AnimalDataMapper mapper = sqlSession .getMapper (AnimalDataMapper .class );
134
+ SelectStatementProvider selectStatement = select (animalData .allColumns ())
135
+ .from (animalData , "ad" )
136
+ .orderBy (id .descending ())
137
+ .build ()
138
+ .render (RenderingStrategy .MYBATIS3 );
139
+ List <AnimalData > animals = mapper .selectMany (selectStatement );
140
+ assertAll (
141
+ () -> assertThat (selectStatement .getSelectStatement ()).isEqualTo ("select ad.* from AnimalData ad order by id DESC" ),
142
+ () -> assertThat (animals .size ()).isEqualTo (65 ),
143
+ () -> assertThat (animals .get (0 ).getId ()).isEqualTo (65 )
144
+ );
145
+ }
146
+ }
147
+
112
148
@ Test
113
149
public void testSelectRowsLessThan20 () {
114
150
try (SqlSession sqlSession = sqlSessionFactory .openSession ()) {
0 commit comments