|
1 | | -================== |
2 | | -FAQ |
3 | | -================== |
| 1 | +========================== |
| 2 | +Frequently Asked Questions |
| 3 | +========================== |
4 | 4 |
|
5 | | -.. contents:: 目次 |
| 5 | +.. contents:: |
6 | 6 | :depth: 3 |
7 | 7 |
|
8 | | -一般的な質問 |
9 | | -============ |
| 8 | +General Questions |
| 9 | +================= |
10 | 10 |
|
11 | | -Domaとはどのような意味ですか? |
| 11 | +What does Doma stand for? |
| 12 | +------------------------- |
| 13 | + |
| 14 | +Doma stands for the **D** ao **O** riented database **MA** pping framework. |
| 15 | + |
| 16 | +What is annotation processing? |
12 | 17 | ------------------------------ |
13 | 18 |
|
14 | | -**D** AO **O** riented Database **MA** pping Framework の略です。 |
| 19 | +Annotation processing, that is introduced in Java 6, |
| 20 | +allows us to validate and generate source codes at compile time. |
15 | 21 |
|
16 | | -注釈処理とはなんですか? |
17 | | ------------------------- |
| 22 | +We use annotation processing to do followings: |
18 | 23 |
|
19 | | -Java 6 で導入された Pluggable Annotation Processing API を利用した処理で、 |
20 | | -コンパイル時のソースコード検証や、ソースコード生成が可能です。 |
| 24 | +- Generating meta classes from the classes annotated with ``@Entity`` and ``@Domain`` |
| 25 | +- Generating implementation classes of the interfaces annotated with ``@Dao`` |
| 26 | +- Validating SQL statements |
21 | 27 |
|
22 | | -Domaでは、注釈処理を使用して以下のことを実現しています。 |
| 28 | +Runtime environment |
| 29 | +=================== |
23 | 30 |
|
24 | | -* エンティティクラスやドメインクラスのメタ情報の生成 |
25 | | -* Daoのインタフェースから実装クラスの生成 |
26 | | -* SQLファイルのバリデーション |
| 31 | +Which version of JRE does Doma support? |
| 32 | +--------------------------------------- |
27 | 33 |
|
28 | | -動作環境に関する質問 |
29 | | -==================== |
| 34 | +JRE 8、9、10 and 11. |
30 | 35 |
|
31 | | -どのバージョンのJREをサポートしていますか? |
32 | | -------------------------------------------- |
| 36 | +What libraries are required to work Doma? |
| 37 | +-------------------------------------- |
33 | 38 |
|
34 | | -JRE 8、9、10、11 をサポートしています。 |
| 39 | +Nothing. |
35 | 40 |
|
36 | | -Domaを動作させるのに必要なライブラリは何ですか? |
37 | | ------------------------------------------------- |
| 41 | +Doma has no dependencies to other libraries. |
38 | 42 |
|
39 | | -何もありません。 |
40 | | -DomaはJRE以外のどんなライブラリにも依存していません。 |
| 43 | +Development environment |
| 44 | +======================= |
41 | 45 |
|
42 | | -開発環境に関する質問 |
43 | | -==================== |
| 46 | +Which version of JDK does Doma support? |
| 47 | +--------------------------------------- |
44 | 48 |
|
45 | | -どのバージョンのJDKをサポートしていますか? |
46 | | -------------------------------------------- |
| 49 | +JDK 8、9、10 and 11. |
47 | 50 |
|
48 | | -JDK 8、9、10、11 をサポートしています。 |
| 51 | +Which IDE do you recommend? |
| 52 | +--------------------------- |
49 | 53 |
|
50 | | -推奨されたIDE(統合開発環境)はありますか? |
51 | | -------------------------------------------- |
| 54 | +We recommend Eclipse and IntelliJ IDEA. |
52 | 55 |
|
53 | | -Eclipse と IntelliJ IDEA です。 |
| 56 | +In Eclipse, the jar file of Doma is added to the Java Build Path but annotation processing doesn't run. |
| 57 | +------------------------------------------------------------------------------------------------------- |
54 | 58 |
|
55 | | -DomaのjarをEclipseのビルドパスに設定しましたが注釈処理が実行されません。 |
56 | | ------------------------------------------------------------------------- |
| 59 | +Enable annotation processing and add the jar file to the Factory Path too. |
| 60 | +See also :ref:`eclipse-build`. |
57 | 61 |
|
58 | | -Factory PathにもDomaのjarファイルを登録してください。 |
| 62 | +Where are generated source files in annotation processing? |
| 63 | +---------------------------------------------------------- |
59 | 64 |
|
60 | | -Factory Pathの設定画面は、プロジェクトのプロパティ設定画面から、 |
61 | | -Java - Compiler - Annotation Processing - Factory Path と辿れます。 |
62 | | -Annotation ProcessingとFactory Pathの画面では、 |
63 | | -「Enable project specific settings」のチェックボックスをチェックしてください。 |
| 65 | +In Eclipse, they are found in the .apt_generated directory. |
64 | 66 |
|
65 | | -注釈処理で生成されたコードはどこに出力されますか? |
| 67 | +In Eclipse, where is the .apt_generated directory? |
66 | 68 | -------------------------------------------------- |
67 | 69 |
|
68 | | -Eclipseを利用している場合、 |
69 | | -デフォルトではプロジェクト直下の ``.apt_generated`` ディレクトリに出力されます。 |
| 70 | +You can find it in the Nivigator view. |
70 | 71 |
|
71 | | -Eclipseを使用していますが、.apt_generated ディレクトリがみつかりません。 |
72 | | ----------------------------------------------------------------------------------------- |
| 72 | +I get the message that the sql file is not found, but it exists. |
| 73 | +---------------------------------------------------------------- |
73 | 74 |
|
74 | | -単にPackage Explorerビュー上に ``.apt_generated`` |
75 | | -ディレクトリが表示されていないだけかもしれません。 |
76 | | -``.apt_generated`` は、名称が ``.`` で始まっているために、 |
77 | | -Package Explorerビューで表示対象外になります。 |
78 | | -対応方法としては以下のいずれかを選択してください。 |
| 75 | +You may get the following message, though the file exists: |
79 | 76 |
|
80 | | -* Nivigatorビューから ``.apt_generated`` ディレクトリを確認する |
81 | | -* Package Explorerビューのフィルタリングの設定を変更し ``.apt_generated`` ディレクトリを表示させる |
82 | | -* 出力先ディレクトリを変更し名称が ``.`` で始まらないようにする |
| 77 | +.. code-block:: sh |
83 | 78 |
|
84 | | -SQLファイルが見つかりません。 |
85 | | ------------------------------ |
| 79 | + [DOMA4019] The file[META-INF/../select.sql] is not found from the classpath |
86 | 80 |
|
87 | | -SQLファイルが存在するにも関わらず、次のエラーメッセージが出力されることがあります。 |
88 | | -:: |
| 81 | +When you use Eclipse, check that the location of the output folder of resources is |
| 82 | +same as the one of class files in the Java Build Path dialog. |
89 | 83 |
|
90 | | - [DOMA4019] SQLファイル[META-INF/../select.sql]がクラスパスから見つかりませんでした |
| 84 | +When you use Gradle, check that the resource files are copied to ``compileJava.destinationDir`` |
| 85 | +in advance of the compileJava task. See also :ref:`build-with-gradle`. |
91 | 86 |
|
92 | | -SQLファイルはクラスの出力ディレクトリから検索されます。 |
93 | | -SQLファイルの出力ディレクトリとクラスの出力ディレクトリが同じであることを確認してください。 |
94 | 87 |
|
95 | | -Eclipseの場合、プロジェクトのプロパティの「Java Build Path」の設定画面で、 |
96 | | -ソースフォルダごとに出力先ディレクトリを変更可能になっています。 |
| 88 | +Features as the database access library |
| 89 | +======================================= |
97 | 90 |
|
98 | | -DBアクセスライブラリとしての機能に関する質問 |
99 | | -============================================ |
| 91 | +Does Doma generate SQL statements? |
| 92 | +---------------------------------- |
100 | 93 |
|
101 | | -SQLを自動生成する機能はありますか? |
102 | | ------------------------------------ |
| 94 | +Yes, Doma generates following statements: |
103 | 95 |
|
104 | | -はい。 |
| 96 | +- INSERT |
| 97 | +- DELETE |
| 98 | +- UPDATE |
| 99 | +- stored procedure call |
| 100 | +- stored function call |
105 | 101 |
|
106 | | -更新系SQL、ストアドプロシージャー/ファンクション呼び出しについてはSQLを自動で生成できます。 |
107 | | -検索系のSQLについては、自動生成機能はありませんが、ファイルに外部化したSQLを実行し、 |
108 | | -その結果をJavaのオブジェクトにマッピングする機能があります。 |
| 102 | +Doma doesn't generate SELECT statements |
| 103 | +but executes arbitrary SELECT statements and maps the results to the Java objects. |
109 | 104 |
|
110 | | -詳しくは :doc:`query/index` を参照してください。 |
| 105 | +See also :doc:`query/index` for detail information. |
111 | 106 |
|
112 | | -条件が動的に変わるSQLはどのように実行できますか? |
113 | | -------------------------------------------------- |
| 107 | +How dynamic SQL statements are executed? |
| 108 | +---------------------------------------- |
114 | 109 |
|
115 | | -SQLファイルに、SQLコメントを使って条件を指定できます。 |
116 | | -SQLコメントは実行時に解析され、条件によって異なるSQLが生成されます。 |
| 110 | +The dynamic SQL statements are built by directives that are represented as the SQL comments. |
117 | 111 |
|
118 | | -詳しくは :doc:`sql` を参照してください。 |
| 112 | +See also :doc:`sql` for detail information. |
119 | 113 |
|
120 | | -1対1 や 1対n などデータベース上のリレーションシップをJavaオブジェクトにマッピングできますか? |
121 | | ---------------------------------------------------------------------------------------------- |
| 114 | +Does Doma map database relationships such as one-to-one and one-to-many to Java objects? |
| 115 | +---------------------------------------------------------------------------------------- |
122 | 116 |
|
123 | | -いいえ、できません。 |
| 117 | +No. |
124 | 118 |
|
125 | | -Domaでは、SQLの結果セットの1行をそのまま1つのエンティティのインスタンスにマッピングします。 |
126 | | -このほうがシンプルでわかりやすいと考えているためです。 |
| 119 | +Doma only maps each row of the SQL result set to a Java entity instance. |
127 | 120 |
|
128 | | -コネクションプーリングの機能はありますか? |
129 | | ------------------------------------------- |
| 121 | +Does Doma provide a JDBC connection pooling feature? |
| 122 | +---------------------------------------------------- |
130 | 123 |
|
131 | | -いいえ、Domaでは提供していません。 |
| 124 | +No. |
132 | 125 |
|
133 | | -コネクションプーリング機能をもつアプリケーションサーバー、フレームワーク、 |
134 | | -ライブラリ等と組み合わせて使用してください。 |
| 126 | +Use Doma together with |
| 127 | +the JDBC connection pool library such as `HikariCP <https://github.com/brettwooldridge/HikariCP>`_. |
135 | 128 |
|
0 commit comments