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 11<!--
22
3- Copyright 2016-2018 the original author or authors.
3+ Copyright 2016-2019 the original author or authors.
44
55 Licensed under the Apache License, Version 2.0 (the "License");
66 you may not use this file except in compliance with the License.
2020 <parent >
2121 <groupId >org.mybatis</groupId >
2222 <artifactId >mybatis-parent</artifactId >
23- <version >31-SNAPSHOT </version >
23+ <version >31</version >
2424 </parent >
2525 <groupId >org.mybatis.dynamic-sql</groupId >
2626 <artifactId >mybatis-dynamic-sql</artifactId >
9494 <dependency >
9595 <groupId >org.mybatis</groupId >
9696 <artifactId >mybatis</artifactId >
97- <version >3.4.6 </version >
97+ <version >3.5.0 </version >
9898 <scope >test</scope >
9999 </dependency >
100100 <dependency >
106106 <dependency >
107107 <groupId >org.springframework</groupId >
108108 <artifactId >spring-jdbc</artifactId >
109- <version >5.1.3 .RELEASE</version >
109+ <version >5.1.4 .RELEASE</version >
110110 <scope >test</scope >
111111 </dependency >
112112 <dependency >
Original file line number Diff line number Diff line change 11/**
2- * Copyright 2016-2018 the original author or authors.
2+ * Copyright 2016-2019 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -109,6 +109,25 @@ public void testSelectAllRowsWithOrder() {
109109 }
110110 }
111111
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+
112131 @ Test
113132 public void testSelectAllRowsAllColumnsWithOrder () {
114133 try (SqlSession sqlSession = sqlSessionFactory .openSession ()) {
You can’t perform that action at this time.
0 commit comments