File tree Expand file tree Collapse file tree 3 files changed +4
-2
lines changed Expand file tree Collapse file tree 3 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 8686
8787 <programlisting language =" xml" ><![CDATA[ <bean id="userMapper" class="org.mybatis.spring.MapperFactoryBean">
8888 <property name="mapperInterface" value="org.mybatis.spring.sample.mapper.UserMapper" />
89+ <property name="sqlSessionFactory" ref="sqlSessionFactory" />
8990</bean>]]> </programlisting >
9091
9192 Note that the mapper class specified <emphasis >must</emphasis > be an
Original file line number Diff line number Diff line change 4949
5050 <programlisting language =" xml" ><![CDATA[ <bean id="userMapper" class="org.mybatis.spring.MapperFactoryBean">
5151 <property name="mapperInterface" value="org.mybatis.spring.sample.mapper.UserMapper" />
52+ <property name="sqlSessionFactory" ref="sqlSessionFactory" />
5253</bean>]]> </programlisting >
5354 </para >
5455
138139 <para >
139140 Notice that there is no need to specify a <literal >SqlSessionFactory</literal > or
140141 <literal >SqlSessionTemplate</literal > because the <literal >MapperScannerPostProcessor</literal >
141- will create <literal >MapperFactoryBean</literal >s that will be autowired. But if you are
142+ will create <literal >MapperFactoryBean</literal >s that can be autowired. But if you are
142143 using more than one <literal >DataSource</literal > autowire may not work for you. In this case
143144 you can use the <literal >sqlSessionFactoryBeanName</literal > or
144145 <literal >sqlSessionTemplateBeanName</literal > properties to set the right bean name to use.
Original file line number Diff line number Diff line change 128128 like the following:
129129
130130 <programlisting language =" xml" ><![CDATA[ <bean id="userMapperImpl" class="sample.UserMapperImpl">
131- <!-- SqlSessionFactory property is autowired -- >
131+ <property name="sqlSessionFactory" ref="sqlSessionFactory" / >
132132</bean>]]> </programlisting >
133133 </para >
134134 </section >
You can’t perform that action at this time.
0 commit comments