Skip to content

Commit 1cbf994

Browse files
authored
Merge pull request #849 from kazuki43zoo/update-doc-for-gh-816
Update docs for gh-816
2 parents ae99cf4 + 57e97b2 commit 1cbf994

File tree

5 files changed

+68
-7
lines changed

5 files changed

+68
-7
lines changed

src/site/es/xdoc/sqlmap-xml.xml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,8 +1710,21 @@ SELECT * FROM POST WHERE BLOG_ID = #{id}]]></source>
17101710
<property name="cacheFile" value="/tmp/my-custom-cache.tmp"/>
17111711
</cache>]]></source>
17121712

1713-
<p>Puedes utilizar propiedades JavaBean de cualquier tipo simple y MyBatis hará la conversión.</p>
1714-
1713+
<p>
1714+
Puedes utilizar propiedades JavaBean de cualquier tipo simple y MyBatis hará la conversión.
1715+
And you can specify a placeholder(e.g. <code>${cache.file}</code>) to replace value defined at <a href="configuration.html#properties">configuration properties</a>.
1716+
</p>
1717+
1718+
<p>
1719+
Since 3.4.2, the MyBatis has been supported to call an initialization method after it's set all properties.
1720+
If you want to use this feature, please implements the <code>org.apache.ibatis.builder.InitializingObject</code>
1721+
interface on your custom cache class.
1722+
</p>
1723+
1724+
<source><![CDATA[public interface InitializingObject {
1725+
void initialize() throws Exception;
1726+
}]]></source>
1727+
17151728
<p><span class="label important">NOTE</span>
17161729
Los parametros de configuración de la cache (eviction, read write..etc.) explicados anteriormente no aplican cuando se usa
17171730
una caché personalizada.

src/site/ja/xdoc/sqlmap-xml.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1952,7 +1952,19 @@ SELECT * FROM POST WHERE BLOG_ID = #{id}]]></source>
19521952
<property name="cacheFile" value="/tmp/my-custom-cache.tmp"/>
19531953
</cache>]]></source>
19541954

1955-
<p>設定対象のプロパティは、単純型であれば String 以外でも使用可能です。</p>
1955+
<p>
1956+
設定対象のプロパティは、単純型であれば String 以外でも使用可能です。
1957+
加えて、<a href="configuration.html#properties">コンフィギュレーション用のプロパティ</a>に定義した値で置き換えるために、プレースホルダ(例:<code>${cache.file}</code>)を指定することができます。
1958+
</p>
1959+
1960+
<p>
1961+
3.4.2以降では, MyBatisはすべてのプロパティを設定した後に初期化メソッドを呼び出す仕組みをサポートしています。
1962+
この機能の使用したい場合は、あなたが作成したキャッシュの実装クラスに<code>org.apache.ibatis.builder.InitializingObject</code>インタフェースを実装してください。
1963+
</p>
1964+
1965+
<source><![CDATA[public interface InitializingObject {
1966+
void initialize() throws Exception;
1967+
}]]></source>
19561968

19571969
<p>
19581970
ここで重要なのは、キャッシュの設定とキャッシュのインスタンスは Mapper XML ファイルのネームスペースに関連付けられているということです。

src/site/ko/xdoc/sqlmap-xml.xml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,8 +1647,20 @@ public class User {
16471647
<property name="cacheFile" value="/tmp/my-custom-cache.tmp"/>
16481648
</cache>]]></source>
16491649

1650-
<p>모든 간단한 타입의 자바빈 프로퍼티를 사용할 수 있다.
1651-
마이바티스는 변환할 것이다.</p>
1650+
<p>
1651+
모든 간단한 타입의 자바빈 프로퍼티를 사용할 수 있다. 마이바티스는 변환할 것이다.
1652+
And you can specify a placeholder(e.g. <code>${cache.file}</code>) to replace value defined at <a href="configuration.html#properties">configuration properties</a>.
1653+
</p>
1654+
1655+
<p>
1656+
Since 3.4.2, the MyBatis has been supported to call an initialization method after it's set all properties.
1657+
If you want to use this feature, please implements the <code>org.apache.ibatis.builder.InitializingObject</code>
1658+
interface on your custom cache class.
1659+
</p>
1660+
1661+
<source><![CDATA[public interface InitializingObject {
1662+
void initialize() throws Exception;
1663+
}]]></source>
16521664

16531665
<p>캐시 설정과 캐시 인스턴스가 SQL Map 파일의 네임스페이스에 묶여지는(bound) 것을 기억하는게 중요하다.
16541666
게다가 같은 네임스페이스내 모든 구문은 묶여진다.

src/site/xdoc/sqlmap-xml.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2122,7 +2122,20 @@ SELECT * FROM POST WHERE BLOG_ID = #{id}]]></source>
21222122
<property name="cacheFile" value="/tmp/my-custom-cache.tmp"/>
21232123
</cache>]]></source>
21242124

2125-
<p>You can use JavaBeans properties of all simple types, MyBatis will do the conversion.</p>
2125+
<p>
2126+
You can use JavaBeans properties of all simple types, MyBatis will do the conversion.
2127+
And you can specify a placeholder(e.g. <code>${cache.file}</code>) to replace value defined at <a href="configuration.html#properties">configuration properties</a>.
2128+
</p>
2129+
2130+
<p>
2131+
Since 3.4.2, the MyBatis has been supported to call an initialization method after it's set all properties.
2132+
If you want to use this feature, please implements the <code>org.apache.ibatis.builder.InitializingObject</code>
2133+
interface on your custom cache class.
2134+
</p>
2135+
2136+
<source><![CDATA[public interface InitializingObject {
2137+
void initialize() throws Exception;
2138+
}]]></source>
21262139

21272140
<p><span class="label important">NOTE</span>
21282141
Settings of cache (like eviction strategy, read write..etc.) in section above are not applied

src/site/zh/xdoc/sqlmap-xml.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1876,9 +1876,20 @@ org.mybatis.cache.Cache 接口。这个接口是 MyBatis 框架中很多复杂
18761876
</cache>]]></source>
18771877

18781878
<p>
1879-
你可以使用所有简单类型作为 JavaBeans 的属性,MyBatis 会进行转换。
1879+
你可以使用所有简单类型作为 JavaBeans 的属性,MyBatis 会进行转换。
1880+
And you can specify a placeholder(e.g. <code>${cache.file}</code>) to replace value defined at <a href="configuration.html#properties">configuration properties</a>.
18801881
</p>
18811882

1883+
<p>
1884+
Since 3.4.2, the MyBatis has been supported to call an initialization method after it's set all properties.
1885+
If you want to use this feature, please implements the <code>org.apache.ibatis.builder.InitializingObject</code>
1886+
interface on your custom cache class.
1887+
</p>
1888+
1889+
<source><![CDATA[public interface InitializingObject {
1890+
void initialize() throws Exception;
1891+
}]]></source>
1892+
18821893
<p>
18831894
记得缓存配置和缓存实例是绑定在 SQL 映射文件的命名空间是很重要的。因此,所有
18841895
在相同命名空间的语句正如绑定的缓存一样。

0 commit comments

Comments
 (0)