Skip to content

Commit 60d1288

Browse files
authored
Merge pull request #277 from domaframework/translate
Translate documents from Japanese into English
2 parents c6e673b + f1ce950 commit 60d1288

File tree

4 files changed

+469
-472
lines changed

4 files changed

+469
-472
lines changed

docs/basic.rst

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
==================
2-
基本型
3-
==================
1+
=============
2+
Basic classes
3+
=============
44

5-
.. contents:: 目次
5+
.. contents::
66
:depth: 3
77

8-
Domaでは、データベースのカラムにマッピング可能なJavaの型を基本型と呼びます。
8+
Overview
9+
========
910

10-
種類
11-
==================
11+
The Java types can be mapped to database column types are called "Basic classes" in Doma.
1212

13-
基本型には以下の種類があります。
13+
List of basic classes
14+
=====================
1415

15-
* プリミティブ型とそのラッパー型(ただし ``char`` と ``java.lang.Character`` は除く)
16-
* 列挙型
16+
* primitive types except ``char``
17+
* wrapper class for above primitive types
18+
* enum types
1719
* byte[]
1820
* java.lang.String
1921
* java.lang.Object
@@ -31,37 +33,35 @@ Domaでは、データベースのカラムにマッピング可能なJavaの型
3133
* java.sql.SQLXML
3234
* java.util.Date
3335

34-
日付/時刻型
35-
------------------
36+
Differences between temporal classes
37+
------------------------------------
3638

37-
日付と時刻の型の違いについて説明します。
39+
:java.time.LocalDate:
40+
represents SQL DATE
3841

39-
java.time.LocalDate
40-
SQL標準のDATE型 (日付のみ)を表します。
42+
:java.time.LocalTime:
43+
represents SQL TIME
4144

42-
java.time.LocalTime
43-
SQL標準のTIME型 (時刻のみ)を表します。
45+
:java.time.LocalDateTime:
46+
represents SQL TIMESTAMP and may hold nanoseconds if RDBMS supports it
4447

45-
java.time.LocalDateTime
46-
SQL標準のTIMESTAMP型 (日付と時刻)を表します。RDBMSがサポートしている場合ナノ秒を保持します。
48+
:java.sql.Date:
49+
represents SQL DATE
4750

48-
java.sql.Date
49-
SQL標準のDATE型 (日付のみ)を表します。
51+
:java.sql.Time:
52+
represents SQL TIME
5053

51-
java.sql.Time
52-
SQL標準のTIME型 (時刻のみ)を表します。
54+
:java.sql.Timestamp:
55+
represents SQL TIMESTAMP and may hold nanoseconds if RDBMS supports it
5356

54-
java.sql.Timestamp
55-
SQL標準のTIMESTAMP型 (日付と時刻)を表します。RDBMSがサポートしている場合ナノ秒を保持します。
57+
:java.util.Date:
58+
represents SQL TIMESTAMP and doesn't hold nanoseconds
5659

57-
java.util.Date
58-
SQL標準のTIMESTAMP型 (日付と時刻)を表します。ナノ秒を保持しません。
60+
Examples
61+
========
5962

60-
利用例
61-
==================
62-
63-
エンティティクラス
64-
------------------
63+
Using in entity class
64+
---------------------
6565

6666
.. code-block:: java
6767
@@ -80,8 +80,8 @@ java.util.Date
8080
}
8181
8282
83-
ドメインクラス
84-
------------------
83+
Using in domain class
84+
---------------------
8585

8686
.. code-block:: java
8787
@@ -99,8 +99,8 @@ java.util.Date
9999
}
100100
}
101101
102-
Daoクラス
103-
------------------
102+
Using in DAO interface
103+
----------------------
104104

105105
.. code-block:: java
106106

docs/index.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Welcome to Doma 2
1313
=====================
1414

1515
Doma 2 is a database access framework for Java 8+.
16-
Doma has some strong points:
16+
Doma has various strengths:
1717

18-
* Verifies and generates source code at compile-time using annotation processing.
19-
* Maps a database column to a user-defined Java object.
20-
* Uses SQL-templates that is called two-way-SQL.
21-
* Supports classes introduced in Java8, such as ``java.time.LocalDate``, ``java.util.Optional`` and ``java.util.stream.Stream``.
18+
* Verifies and generates source code at compile time using annotation processing.
19+
* Maps database columns to user-defined Java objects.
20+
* Uses SQL templates, called "two-way SQL".
21+
* Supports classes introduced in Java 8, such as ``java.time.LocalDate``, ``java.util.Optional``, and ``java.util.stream.Stream``.
2222
* Has no dependence on other libraries.
2323

2424
This document consists of following sections:

docs/query-builder/index.rst

Lines changed: 22 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,17 @@
1-
============
2-
クエリビルダ
3-
============
1+
==============
2+
Query builders
3+
==============
44

5-
.. contents:: 目次
5+
.. contents::
66
:depth: 3
77

8-
``org.seasar.doma.jdbc.builder`` パッケージでは、
9-
プログラムでSQLを組み立てるためのクエリビルダを提供しています。
8+
The package ``org.seasar.doma.jdbc.builder`` provides SQL builders.
109

11-
何らかの理由により :doc:`../query/index` の利用が難しい場合にのみ、
12-
クエリビルダを利用することを推奨します。
13-
また、クエリビルダは :ref:`dao-default-method` の中で使用することを推奨します。
10+
When it is difficult to build a SQL statement with :doc:`../query/index`,
11+
consider to use the SQL builders in :ref:`dao-default-method`.
1412

15-
どのクエリビルダも、インスタンスは ``Config`` 型の引数をとる
16-
``static`` な ``newInstance`` メソッドで生成できます。
17-
インスタンスには、 ``sql`` メソッドでSQL文字列の断片を、
18-
``param`` メソッドと ``literal`` メソッドでパラメータの型とパラメータを渡せます。
19-
20-
``param`` メソッドで渡されたパラメータは ``PreparedStatement`` のバインド変数として扱われます。
21-
22-
``literal`` メソッドで渡されたパラメータはSQLにリテラルとして埋め込まれます。
23-
このメソッドでパラメータが渡された場合、SQLインジェクション対策としてのエスケープ処理は実施されません。
24-
しかし、SQLインジェクションを防ぐためにパラメータの値にシングルクォテーションを含めることは禁止しています。
25-
26-
検索においてパラメータのリストを渡す場合は ``params`` メソッドと ``literals`` メソッドを利用できます。
27-
パラメータはカンマで連結されたSQLに変換されます。
28-
これらは、IN句と一緒に利用されることを想定されたメソッドです。
29-
30-
検索
31-
====
32-
33-
検索には、 ``SelectBuilder`` クラスを使用します。
34-
35-
利用例は次のとおりです。
13+
Search
14+
======
3615

3716
.. code-block:: java
3817
@@ -50,10 +29,10 @@
5029
builder.sql("age in (").params(Integer.class, Arrays.asList(20, 30, 40)).sql(")");
5130
List<Emp> employees = builder.getEntityResultList(Emp.class);
5231
53-
組み立てたSQLのいくつかの方法で取得できます。
32+
You can get result of the SQL execution in various ways.
5433

55-
1件取得
56-
-------
34+
Single record search
35+
--------------------
5736

5837
* getScalarSingleResult
5938
* getOptionalScalarSingleResult
@@ -62,36 +41,24 @@
6241
* getMapSingleResult
6342
* getOptionalMapSingleResult
6443

65-
複数件取得
66-
----------
44+
Multiple records search
45+
-----------------------
6746

6847
* getScalarResultList
6948
* getOptionalScalarResultList
7049
* getEntityResultList
7150
* getMapResultList
7251

73-
イテレート検索
74-
--------------
75-
76-
* iterateAsScalar
77-
* iterateAsOptionalScalar
78-
* iterateAsEntity
79-
* iterateAsMap
80-
81-
ストリーム検索
82-
--------------
52+
Stream search
53+
-------------
8354

8455
* streamAsScalar
8556
* streamAsOptionalScalar
8657
* streamAsEntity
8758
* streamAsMap
8859

89-
挿入
90-
====
91-
92-
挿入には、 ``InsertBuilder`` クラスを使用します。
93-
94-
利用例は次のとおりです。
60+
Insert
61+
======
9562

9663
.. code-block:: java
9764
@@ -103,14 +70,8 @@
10370
builder.param(BigDecimal.class, new BigDecimal(1000)).sql(")");
10471
builder.execute();
10572
106-
組み立てたSQLは ``execute`` メソッドで実行できます。
107-
108-
更新
109-
====
110-
111-
更新には、 ``UpdateBuilder`` クラスを使用します。
112-
113-
利用例は次のとおりです。
73+
Update
74+
======
11475

11576
.. code-block:: java
11677
@@ -123,14 +84,8 @@
12384
builder.sql("id = ").param(int.class, 10);
12485
builder.execute();
12586
126-
組み立てたSQLは ``execute`` メソッドで実行できます。
127-
128-
削除
129-
====
130-
131-
削除には、 ``DeleteBuilder`` クラスを使用します。
132-
133-
利用例は次のとおりです。
87+
Delete
88+
======
13489

13590
.. code-block:: java
13691
@@ -142,5 +97,3 @@
14297
builder.sql("salary = ").param(BigDecimal.class, new BigDecimal(1000));
14398
builder.execute();
14499
145-
組み立てたSQLは ``execute`` メソッドで実行できます。
146-

0 commit comments

Comments
 (0)