Skip to content

Commit 645888b

Browse files
committed
samples are clearer w/o autowire, a lot of people are going to copypaste them and will get an error if autowire is not enabled
1 parent 430a51b commit 645888b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/docbkx/getting_started.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
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

src/docbkx/mappers.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
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

@@ -138,7 +139,7 @@
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.

src/docbkx/templates_support.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
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>

0 commit comments

Comments
 (0)