Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd4aa917

Browse files
committed
spring例子的通用Mapper改为拦截器形式。
1 parente4d81ff commitd4aa917

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

‎src/main/resources/applicationContext.xml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@
7373
<propertyname="typeAliasesPackage"value="com.isea533.mybatis.model"/>
7474
<propertyname="plugins">
7575
<array>
76+
<beanclass="com.github.abel533.mapperhelper.MapperInterceptor">
77+
<propertyname="properties">
78+
<value>
79+
mappers=com.github.abel533.mapper.Mapper
80+
IDENTITY=MYSQL
81+
notEmpty=true
82+
</value>
83+
</property>
84+
</bean>
7685
<beanclass="com.github.pagehelper.PageHelper">
7786
<propertyname="properties">
7887
<value>
@@ -116,21 +125,4 @@
116125
<beanid="transactionManager"class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
117126
<propertyname="dataSource"ref="dataSource"/>
118127
</bean>
119-
120-
<beanclass="com.github.abel533.mapperhelper.MapperHelper"
121-
depends-on="sqlSession"init-method="initMapper"scope="singleton"lazy-init="false">
122-
<!--通用Mapper接口-->
123-
<propertyname="mappers">
124-
<array>
125-
<value>${mapper.Mapper}</value>
126-
</array>
127-
</property>
128-
<!--必须注入sqlSession-->
129-
<propertyname="sqlSessions"ref="sqlSession"/>
130-
<!--对于一般的getAllIfColumnNode,是否判断!='',默认不判断-->
131-
<!--该参数会影响所有使用getAllIfColumnNode方法的地方-->
132-
<!--具体到Mapper<T>,影响3个方法:select,selectCount,delete-->
133-
<propertyname="notEmpty"value="true"/>
134-
<propertyname="IDENTITY"value="MYSQL"/>
135-
</bean>
136128
</beans>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp