Skip to content

Commit 45c764d

Browse files
committed
Update document
See mybatisgh-376
1 parent 75f8f0f commit 45c764d

File tree

5 files changed

+98
-5
lines changed

5 files changed

+98
-5
lines changed

src/site/es/xdoc/mappers.xml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,26 @@ public MapperFactoryBean<UserMapper> userMapper() throws Exception {
121121
</ul>
122122

123123
<p>Tango <code>&lt;mybatis:scan/&gt;</code> como <code>@MapperScan</code> son características añadidas en MyBatis-Spring 1.2.0.
124-
<code>@MapperScan</code> requiere Spring 3.1+.</p>
124+
<code>@MapperScan</code> requiere Spring 3.1+.</p>
125+
126+
<p>
127+
Since 2.0.2, mapper scanning feature support a option (<code>lazy-initialization</code>)
128+
that control lazy initialization enabled/disabled of mapper bean.
129+
The motivation for adding this option is supporting a lazy initialization control feature supported by Spring Boot 2.2.
130+
The default of this option is <code>false</code> (= not use lazy initialization).
131+
If developer want to use lazy initialization for mapper bean, it should be set to the <code>true</code> expressly.
132+
</p>
133+
<p>
134+
<span class="label important">IMPORTANT</span> If use the lazy initialization feature,
135+
the developer need to understand following limitations. If any of following conditions are matches,
136+
the lazy initialization feature cannot use on your application.
137+
</p>
138+
<ul>
139+
<li>When refers to the statement of <b>other mapper</b> using <code><![CDATA[<association>]]></code>(<code>@One</code>) and <code><![CDATA[<collection>]]></code>(<code>@Many</code>)</li>
140+
<li>When includes to the fragment of <b>other mapper</b> using <code><![CDATA[<include>]]></code></li>
141+
<li>When refers to the cache of <b>other mapper</b> using <code><![CDATA[<cache-ref>]]></code>(<code>@CacheNamespaceRef</code>)</li>
142+
<li>When refers to the result mapping of <b>other mapper</b> using <code><![CDATA[<select resultMap="...">]]></code>(<code>@ResultMap</code>)</li>
143+
</ul>
125144

126145
<h4>&lt;mybatis:scan/&gt;</h4>
127146

@@ -228,4 +247,4 @@ public class AppConfig {
228247
</subsection>
229248
</section>
230249
</body>
231-
</document>
250+
</document>

src/site/ja/xdoc/mappers.xml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,24 @@ public MapperFactoryBean<UserMapper> userMapper() throws Exception {
110110
<li>Spring の XML 設定ファイルに <code>MapperScannerConfigurer</code> のエントリーを追加する。</li>
111111
</ul>
112112

113-
<p><code>&lt;mybatis:scan/&gt;</code> または <code>@MapperScan</code> を使う場合は MyBatis-Spring 1.2.0 以降が必要です。また <code>@MapperScan</code> を使う場合は Spring 3.1 以降が必要となります。</p>
113+
<p><code>&lt;mybatis:scan/&gt;</code> または <code>@MapperScan</code> を使う場合は MyBatis-Spring 1.2.0 以降が必要です。また <code>@MapperScan</code> を使う場合は Spring 3.1 以降が必要となります。</p>
114+
115+
<p>
116+
2.0.2以降では、Mapperの自動検出機能は、Mapper Beanの遅延初期化の有効/無効を制御するオプション(<code>lazy-initialization</code>)をサポートします。
117+
このオプションを追加する動機は、Spring Boot 2.2でサポートされた遅延初期化を制御する機能をサポートすることです。
118+
このオプションのデフォルトは<code>false</code>です(遅延初期化を使用しません)。
119+
開発者がMapper Beanを遅延初期化したい場合は、明示的にこのオプションを<code>true</code>に設定する必要があります。
120+
</p>
121+
<p>
122+
<span class="label important">重要</span> 遅延初期化機能を使用する場合は、開発者は以下の制限を理解しておく必要があります。
123+
以下の条件のいずれかに一致する場合、あなたのアプリケーションで遅延初期化機能を使用することはできません。
124+
</p>
125+
<ul>
126+
<li><code><![CDATA[<association>]]></code>(<code>@One</code>) and <code><![CDATA[<collection>]]></code>(<code>@Many</code>)を利用して、<b>他のMapperの</b>ステートメントを参照している場合</li>
127+
<li><code><![CDATA[<include>]]></code>を利用して、<b>他のMapperの</b>フラグメントをインクルードしている場合</li>
128+
<li><code><![CDATA[<cache-ref>]]></code>(<code>@CacheNamespaceRef</code>)を利用して、<b>他のMapperの</b>キャッシュを参照している場合</li>
129+
<li><code><![CDATA[<select resultMap="...">]]></code>(<code>@ResultMap</code>)を利用して、<b>他のMapperの</b>結果マッピングを参照している場合</li>
130+
</ul>
114131

115132
<h4>&lt;mybatis:scan/&gt;</h4>
116133

src/site/ko/xdoc/mappers.xml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,26 @@ public MapperFactoryBean<UserMapper> userMapper() throws Exception {
9797
</ul>
9898

9999
<p><code>&lt;mybatis:scan/&gt;</code> 와 <code>@MapperScan</code> 모두 마이바티스 스프링 연동모듈 1.2.0에서 추가된 기능이다.
100-
<code>@MapperScan</code> 은 스프링 버전이 3.1이상이어야 한다. </p>
100+
<code>@MapperScan</code> 은 스프링 버전이 3.1이상이어야 한다. </p>
101+
102+
<p>
103+
Since 2.0.2, mapper scanning feature support a option (<code>lazy-initialization</code>)
104+
that control lazy initialization enabled/disabled of mapper bean.
105+
The motivation for adding this option is supporting a lazy initialization control feature supported by Spring Boot 2.2.
106+
The default of this option is <code>false</code> (= not use lazy initialization).
107+
If developer want to use lazy initialization for mapper bean, it should be set to the <code>true</code> expressly.
108+
</p>
109+
<p>
110+
<span class="label important">IMPORTANT</span> If use the lazy initialization feature,
111+
the developer need to understand following limitations. If any of following conditions are matches,
112+
the lazy initialization feature cannot use on your application.
113+
</p>
114+
<ul>
115+
<li>When refers to the statement of <b>other mapper</b> using <code><![CDATA[<association>]]></code>(<code>@One</code>) and <code><![CDATA[<collection>]]></code>(<code>@Many</code>)</li>
116+
<li>When includes to the fragment of <b>other mapper</b> using <code><![CDATA[<include>]]></code></li>
117+
<li>When refers to the cache of <b>other mapper</b> using <code><![CDATA[<cache-ref>]]></code>(<code>@CacheNamespaceRef</code>)</li>
118+
<li>When refers to the result mapping of <b>other mapper</b> using <code><![CDATA[<select resultMap="...">]]></code>(<code>@ResultMap</code>)</li>
119+
</ul>
101120

102121
<h4>&lt;mybatis:scan/&gt;</h4>
103122

src/site/xdoc/mappers.xml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,26 @@ public MapperFactoryBean<UserMapper> userMapper() throws Exception {
124124
</ul>
125125

126126
<p>Both <code>&lt;mybatis:scan/&gt;</code> and <code>@MapperScan</code> are features introduced in MyBatis-Spring 1.2.0.
127-
<code>@MapperScan</code> requires Spring 3.1+.</p>
127+
<code>@MapperScan</code> requires Spring 3.1+.</p>
128+
129+
<p>
130+
Since 2.0.2, mapper scanning feature support a option (<code>lazy-initialization</code>)
131+
that control lazy initialization enabled/disabled of mapper bean.
132+
The motivation for adding this option is supporting a lazy initialization control feature supported by Spring Boot 2.2.
133+
The default of this option is <code>false</code> (= not use lazy initialization).
134+
If developer want to use lazy initialization for mapper bean, it should be set to the <code>true</code> expressly.
135+
</p>
136+
<p>
137+
<span class="label important">IMPORTANT</span> If use the lazy initialization feature,
138+
the developer need to understand following limitations. If any of following conditions are matches,
139+
the lazy initialization feature cannot use on your application.
140+
</p>
141+
<ul>
142+
<li>When refers to the statement of <b>other mapper</b> using <code><![CDATA[<association>]]></code>(<code>@One</code>) and <code><![CDATA[<collection>]]></code>(<code>@Many</code>)</li>
143+
<li>When includes to the fragment of <b>other mapper</b> using <code><![CDATA[<include>]]></code></li>
144+
<li>When refers to the cache of <b>other mapper</b> using <code><![CDATA[<cache-ref>]]></code>(<code>@CacheNamespaceRef</code>)</li>
145+
<li>When refers to the result mapping of <b>other mapper</b> using <code><![CDATA[<select resultMap="...">]]></code>(<code>@ResultMap</code>)</li>
146+
</ul>
128147

129148
<h4>&lt;mybatis:scan/&gt;</h4>
130149

src/site/zh/xdoc/mappers.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,25 @@ public MapperFactoryBean<UserMapper> userMapper() throws Exception {
107107

108108
<p><code>&lt;mybatis:scan/&gt;</code> 和 <code>@MapperScan</code> 都在 MyBatis-Spring 1.2.0 中被引入。<code>@MapperScan</code> 需要你使用 Spring 3.1+。</p>
109109

110+
<p>
111+
Since 2.0.2, mapper scanning feature support a option (<code>lazy-initialization</code>)
112+
that control lazy initialization enabled/disabled of mapper bean.
113+
The motivation for adding this option is supporting a lazy initialization control feature supported by Spring Boot 2.2.
114+
The default of this option is <code>false</code> (= not use lazy initialization).
115+
If developer want to use lazy initialization for mapper bean, it should be set to the <code>true</code> expressly.
116+
</p>
117+
<p>
118+
<span class="label important">IMPORTANT</span> If use the lazy initialization feature,
119+
the developer need to understand following limitations. If any of following conditions are matches,
120+
the lazy initialization feature cannot use on your application.
121+
</p>
122+
<ul>
123+
<li>When refers to the statement of <b>other mapper</b> using <code><![CDATA[<association>]]></code>(<code>@One</code>) and <code><![CDATA[<collection>]]></code>(<code>@Many</code>)</li>
124+
<li>When includes to the fragment of <b>other mapper</b> using <code><![CDATA[<include>]]></code></li>
125+
<li>When refers to the cache of <b>other mapper</b> using <code><![CDATA[<cache-ref>]]></code>(<code>@CacheNamespaceRef</code>)</li>
126+
<li>When refers to the result mapping of <b>other mapper</b> using <code><![CDATA[<select resultMap="...">]]></code>(<code>@ResultMap</code>)</li>
127+
</ul>
128+
110129
<h4>&lt;mybatis:scan/&gt;</h4>
111130

112131
<p>

0 commit comments

Comments
 (0)