Skip to content

Commit 8327840

Browse files
committed
Japanese translation for r5094.
1 parent 570fa39 commit 8327840

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

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

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,29 +1555,28 @@ public class User {
15551555
</p>
15561556
</subsection>
15571557

1558-
<subsection name="Auto-mapping">
1558+
<subsection name="自動マッピング">
15591559

15601560
<p>
1561-
As you have already seen in the previous sections, in simple cases MyBatis can auto-map the results for you
1562-
and in others you will need to build a result map.
1563-
But as you will see in this section you can also mix both strategies.
1564-
Let's have a deeper look at how auto-mapping works.
1561+
前章では、シンプルなケースでは MyBatis の自動マッピングが利用できるということと、複雑なケースではあなた自身で Result Map を記述する必要があるということを説明しました。
1562+
この章では更に、この2つの方法を同時に利用する方法を説明していきます。
1563+
まず、自動マッピングの動作について詳しく見て行きましょう。
15651564
</p>
15661565

15671566
<p>
1568-
When auto-mapping results MyBatis will get the column name and look for a property with the same name ignoring case. That means that if
1569-
a column named <i>ID</i> and property named <i>id</i> are found, MyBatis will set the <i>id</i> property with the <i>ID</i> column value.
1567+
結果を自動マッピングする際、MyBatis は列名と同じ名前を持つプロパティを探します(大文字と小文字は区別しません)。
1568+
例えば <i>ID</i> という名前の列と <i>id</i> という名前のプロパティが見つかった場合、MyBatis <i>id</i> プロパティに <i>ID</i> 列の値をセットします。
15701569
</p>
15711570

15721571
<p>
1573-
Usually database columns are named using uppercase letters and underscores between words and java properties often follow the camelcase
1574-
naming covention. To enable the auto-mapping between them set the setting <code>mapUnderscoreToCamelCase</code> to true.
1572+
通常、データベースの列名は英数字と単語を区切るアンダースコアで定義され、Java のプロパティはキャメルケースで定義されるのが一般的です。
1573+
<code>mapUnderscoreToCamelCase</code> true に設定すると、この一般的な命名規則に基づいて自動マッピングを適用することができます。
15751574
</p>
15761575

15771576
<p>
1578-
Auto-mapping works even when there is an specific result map. When this happens, for each result map, all columns that are present in the
1579-
ResultSet that have not a manual mapping will be auto-mapped, then manual mappings will be processed.
1580-
In the following sample <i>id</i> and <i>userName</i> columns will be auto-mapped and <i>hashed_password</i> column will be mapped.</p>
1577+
Result Map が指定されている場合でも自動マッピングは動作します。この場合、ResultSet に含まれる列のうち、各 Result Map で明示的にマッピングが指定されていない列が自動マッピングの対象となります。
1578+
次の例では、<i>hashed_password</i> 列が password プロパティにマップされ、<i>id</i> と <i>userName</i> 列が自動マッピングの対象となります。
1579+
</p>
15811580

15821581
<source><![CDATA[<select id="selectUsers" parameterType="int" resultType="User">
15831582
select
@@ -1593,25 +1592,25 @@ public class User {
15931592
</resultMap>]]></source>
15941593

15951594
<p>
1596-
There are three auto-mapping levels:
1595+
自動マッピングには3つのレベルがあります。
15971596
</p>
15981597

15991598
<ul>
16001599
<li>
1601-
<code>NONE</code> - disables auto-mapping. Only manually mapped properties will be set.
1600+
<code>NONE</code> - 自動マッピングを無効化します。明示的にマッピングが指定されたプロパティにのみ値がセットされます。
16021601
</li>
16031602
<li>
1604-
<code>PARTIAL</code> - will auto-map results except those that have nested result mappings defined inside (joins).
1603+
<code>PARTIAL</code> - ネストされた Result Map を持たない Result Map のみが自動マッピングの対象となります。
16051604
</li>
16061605
<li>
1607-
<code>FULL</code> - auto-maps everything.
1606+
<code>FULL</code> - 全ての Result Map が自動マッピングの対象となります。
16081607
</li>
16091608
</ul>
16101609

16111610
<p>
1612-
The default value is <code>PARTIAL</code>, and it is so for a reason. When <code>FULL</code> is used auto-mapping will
1613-
be performed when processing join results and joins retrieve data of several different entities in the same row
1614-
hence this may result in undesired mappings. To understand the risk have a look at the following sample:
1611+
デフォルト値は <code>PARTIAL</code> で、それには理由があります。
1612+
<code>FULL</code> が指定されていると、JOIN 句によって複数のエンティティに対する結果が一行に結合されているような場合に自動マッピングによって意図しないマッピングが実行されてしまう場合があります。
1613+
次の例を見てください。
16151614
</p>
16161615

16171616
<source><![CDATA[<select id="selectBlog" parameterType="int" resultMap="blogResult">
@@ -1632,9 +1631,8 @@ public class User {
16321631
</resultMap>]]></source>
16331632

16341633
<p>
1635-
With this result map both <i>Blog</i> and <i>Author</i> will be auto-mapped. But note that <i>Author</i> has an <i>id</i>
1636-
property and there is a column named <i>id</i> in the ResultSet so Author's id will be filled with Blog's id, and that is not
1637-
what you were expecting. So use the <code>FULL</code> option with caution.
1634+
この Result Map では、<i>Blog</i> と <i>Author</i> の両方が自動マッピングの対象となりますが、<i>Author</i> に <i>id</i> というプロパティがあり、ResultSet に <i>id</i> という列が含まれているため、Author の id に Blog の id がセットされることになります。
1635+
自動マッピングで <code>FULL</code> を指定する場合は、こうした意図しないマッピングが行われないように注意する必要があります。
16381636
</p>
16391637

16401638
</subsection>

0 commit comments

Comments
 (0)