File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed
src/test/java/examples/animal/data Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change 1
1
<!--
2
2
3
- Copyright 2016-2018 the original author or authors.
3
+ Copyright 2016-2019 the original author or authors.
4
4
5
5
Licensed under the Apache License, Version 2.0 (the "License");
6
6
you may not use this file except in compliance with the License.
20
20
<parent >
21
21
<groupId >org.mybatis</groupId >
22
22
<artifactId >mybatis-parent</artifactId >
23
- <version >31-SNAPSHOT </version >
23
+ <version >31</version >
24
24
</parent >
25
25
<groupId >org.mybatis.dynamic-sql</groupId >
26
26
<artifactId >mybatis-dynamic-sql</artifactId >
94
94
<dependency >
95
95
<groupId >org.mybatis</groupId >
96
96
<artifactId >mybatis</artifactId >
97
- <version >3.4.6 </version >
97
+ <version >3.5.0 </version >
98
98
<scope >test</scope >
99
99
</dependency >
100
100
<dependency >
106
106
<dependency >
107
107
<groupId >org.springframework</groupId >
108
108
<artifactId >spring-jdbc</artifactId >
109
- <version >5.1.3 .RELEASE</version >
109
+ <version >5.1.4 .RELEASE</version >
110
110
<scope >test</scope >
111
111
</dependency >
112
112
<dependency >
Original file line number Diff line number Diff line change 1
1
/**
2
- * Copyright 2016-2018 the original author or authors.
2
+ * Copyright 2016-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -109,6 +109,25 @@ public void testSelectAllRowsWithOrder() {
109
109
}
110
110
}
111
111
112
+ @ Test
113
+ public void testSelectAllRowsAllColumns () {
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 <Map <String , Object >> animals = mapper .generalSelect (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 ).get ("ID" )).isEqualTo (65 ),
126
+ () -> assertThat (animals .get (0 ).get ("ANIMAL_NAME" )).isEqualTo ("Brachiosaurus" )
127
+ );
128
+ }
129
+ }
130
+
112
131
@ Test
113
132
public void testSelectAllRowsAllColumnsWithOrder () {
114
133
try (SqlSession sqlSession = sqlSessionFactory .openSession ()) {
You can’t perform that action at this time.
0 commit comments