File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
mybatis-spring-boot-autoconfigure/src/site/xdoc
mybatis-spring-boot-samples/mybatis-spring-boot-sample-xml/src/main/java/sample/mybatis/dao Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 55
55
<ul>
56
56
<li>Build stand alone applications.</li>
57
57
<li>Reduce the boilerplate to almost zero.</li>
58
- <li>No longer xml configuration.</li>
58
+ <li>Less XML configuration.</li>
59
59
</ul>
60
60
61
61
</subsection>
@@ -163,10 +163,10 @@ public class SampleMybatisApplication implements CommandLineRunner {
163
163
public class CityDao {
164
164
165
165
@Autowired
166
- private SqlSessionTemplate sqlSessionTemplate ;
166
+ private SqlSession sqlSession ;
167
167
168
168
public City selectCityById(long id) {
169
- return this.sqlSessionTemplate .selectOne("selectCityById", id);
169
+ return this.sqlSession .selectOne("selectCityById", id);
170
170
}
171
171
172
172
}]]></source>
Original file line number Diff line number Diff line change 15
15
*/
16
16
package sample .mybatis .dao ;
17
17
18
- import org .mybatis . spring . SqlSessionTemplate ;
18
+ import org .apache . ibatis . session . SqlSession ;
19
19
import org .springframework .beans .factory .annotation .Autowired ;
20
20
import org .springframework .stereotype .Component ;
21
21
28
28
public class CityDao {
29
29
30
30
@ Autowired
31
- private SqlSessionTemplate sqlSessionTemplate ;
31
+ private SqlSession sqlSession ;
32
32
33
33
public City selectCityById (long id ) {
34
- return this .sqlSessionTemplate .selectOne ("selectCityById" , id );
34
+ return this .sqlSession .selectOne ("selectCityById" , id );
35
35
}
36
36
37
37
}
You can’t perform that action at this time.
0 commit comments