File tree Expand file tree Collapse file tree 4 files changed +18
-12
lines changed
test/java/com/isea533/mybatis/test Expand file tree Collapse file tree 4 files changed +18
-12
lines changed Original file line number Diff line number Diff line change 22
22
<!-- 编译jdk版本 -->
23
23
<jdk .version>1.6</jdk .version>
24
24
<!-- 依赖版本 -->
25
- <mapper .version>3.1.3-SNAPSHOT </mapper .version>
25
+ <mapper .version>3.1.3</mapper .version>
26
26
<pagehelper .version>4.0.0</pagehelper .version>
27
27
<mysql .version>5.1.29</mysql .version>
28
28
<spring .version>4.1.2.RELEASE</spring .version>
Original file line number Diff line number Diff line change 81
81
</value >
82
82
</property >
83
83
</bean >
84
- <bean class =" tk.mybatis.mapper.mapperhelper.MapperOnceInterceptor" >
85
- <property name =" properties" >
86
- <value >
87
- mappers=tk.mybatis.mapper.common.Mapper
88
- IDENTITY=MYSQL
89
- notEmpty=true
90
- </value >
91
- </property >
92
- </bean >
93
84
</array >
94
85
</property >
95
86
</bean >
103
94
<constructor-arg index =" 0" ref =" sqlSessionFactory" />
104
95
</bean >
105
96
97
+ <bean class =" tk.mybatis.mapper.mapperhelper.MapperHelper"
98
+ init-method =" initMapper" scope =" singleton" lazy-init =" false" >
99
+ <property name =" mappers" >
100
+ <array >
101
+ <value >${mapper.Mapper}</value >
102
+ </array >
103
+ </property >
104
+ <property name =" sqlSessions" ref =" sqlSession" />
105
+ </bean >
106
+
106
107
<aop : aspectj-autoproxy />
107
108
108
109
<aop : config >
Original file line number Diff line number Diff line change 24
24
25
25
# \u6570\u636E\u5E93\u914D\u7F6E
26
26
jdbc.driverClass = com.mysql.jdbc.Driver
27
- jdbc.url = jdbc:mysql://192.168.1.200 :3306/test
27
+ jdbc.url = jdbc:mysql://192.168.16.137 :3306/test
28
28
jdbc.user = root
29
29
jdbc.password =
30
30
Original file line number Diff line number Diff line change 28
28
import com .github .pagehelper .PageInfo ;
29
29
import com .isea533 .mybatis .mapper .CountryMapper ;
30
30
import com .isea533 .mybatis .model .Country ;
31
+ import org .apache .ibatis .session .SqlSession ;
31
32
import org .junit .Test ;
32
33
import org .springframework .beans .factory .annotation .Autowired ;
33
34
import tk .mybatis .mapper .entity .Example ;
39
40
*/
40
41
public class PageMapperTest extends BasicTest {
41
42
43
+ // @Autowired
44
+ // private CountryMapper countryMapper;
45
+
42
46
@ Autowired
43
- private CountryMapper countryMapper ;
47
+ private SqlSession sqlSession ;
44
48
45
49
@ Test
46
50
public void test (){
51
+ CountryMapper countryMapper = sqlSession .getMapper (CountryMapper .class );
47
52
Example example = new Example (Country .class );
48
53
example .createCriteria ().andGreaterThan ("id" ,100 );
49
54
PageHelper .startPage (2 ,10 );
You can’t perform that action at this time.
0 commit comments