@@ -165,12 +165,12 @@ AND title like ‘someTitle’]]></source>
165
165
<p >XML 設定ファイルと XML Mapper ファイルについての説明はここまでになります。次の章では、Java API について詳しく見ていきます。</p >
166
166
</subsection >
167
167
<subsection name =" bind" >
168
- <p >The <code >bind</code > element lets you create a variable out of an OGNL expression and bind it to the context. For example: </p >
168
+ <p ><code >bind</code > 要素を使うと、 OGNL 式の結果を変数に格納し、その変数を SQL 文中で使用することができます。 </p >
169
169
<source ><![CDATA[
170
170
<select id="selectBlogsLike" parameterType="Blog" resultType="Blog">
171
171
<bind name="pattern" value="'%' + _parameter.getTitle() + '%'" />
172
172
SELECT * FROM BLOG
173
- WHERE title LIKE #{pattern}
173
+ WHERE title LIKE #{pattern}
174
174
</select>]]> </source >
175
175
</subsection >
176
176
<subsection name =" 複数データベースのサポート" >
@@ -190,29 +190,26 @@ AND title like ‘someTitle’]]></source>
190
190
</subsection >
191
191
<subsection name =" ダイナミック SQL 記述言語" >
192
192
<p >バージョン 3.2 以降、ダイナミック SQL の記述言語が Pluggable になりました。言語ドライバーを記述することで、任意の言語でダイナミック SQL を記述することができます。</p >
193
- <p >機能の詳細については今後記述を追加する予定です。</p >
194
- <p >There are two built-in languages:</p >
193
+ <p >標準では次の2つの言語が用意されています。</p >
195
194
<ul >
196
195
<li >xml</li >
197
196
<li >raw</li >
198
197
</ul >
199
- <p >The <code >xml</code > language is the default one. It is able to execute all the dynamic tags we saw in the previous sections.</p >
200
- <p >The <code >raw</code > language is in fact the absence of language. When using this setting MyBatis just performs the
201
- parameter substitution and passes the statement to the database driver. As you may guess, the <code >raw</code > language
202
- is faster than the <code >xml</code > language.
198
+ <p ><code >xml</code > はデフォルトの SQL 記述言語で、これまでのセクションで説明した全ての機能を利用することができます。</p >
199
+ <p ><code >raw</code > というのは、実際には言語を使用しない場合に指定します。この場合、MyBatis がステートメントをデータベースドライバーに渡す前に行うのは引数の置換処理のみです。当然、 <code >xml</code > よりも <code >raw</code > を指定した場合の方が処理は高速です。
203
200
</p >
204
- <p >You can specify the language you want to use in an statement adding the <code >lang</code > attribute as follows:
201
+ <p >言語の指定は、ステートメント要素に <code >lang</code > 属性を追加することで行います。
205
202
</p >
206
203
<source ><![CDATA[ <select id="selectBlog" lang="raw">
207
204
SELECT * FROM BLOG
208
205
</select>]]> </source >
209
- <p >Or, in the case you are using mappers, using the <code >@Lang</code > annotation: </p >
206
+ <p >Mapper インターフェイスを使っている場合は <code >@Lang</code > アノテーションを使います。 </p >
210
207
<source ><![CDATA[ public interface Mapper {
211
208
@Lang(RawLanguageDriver.class)
212
209
@Select("SELECT * FROM BLOG")
213
210
List<Blog> selectBlog();
214
211
}]]> </source >
215
- <p >You can also implement your own language driver by implementing the following interface: </p >
212
+ <p >LanguageDriver インターフェイスを実装することで、カスタムの言語ドライバーを作成することもできます。 </p >
216
213
<source ><![CDATA[ public interface LanguageDriver {
217
214
public ParameterHandler createParameterHandler(MappedStatement mappedStatement, Object parameterObject, BoundSql boundSql);
218
215
public SqlSource createSqlSource(Configuration configuration, XNode script, Class<?> parameterType);
0 commit comments