11==================
2- バッチ削除
2+ Batch delete
33==================
44
5- .. contents :: 目次
5+ .. contents ::
66 :depth: 3
77
8- バッチ削除を行うには、 ``@BatchDelete `` をDaoのメソッドに注釈します。
8+ Annotate with ``@BatchDelete `` to Dao method for execute batch insert.
99
1010.. code-block :: java
1111
1616 ...
1717 }
1818
19- デフォルトでは、DELETE文が自動生成されます。
20- `` @BatchDelete `` の ``sqlFile `` に `` true `` を設定することで、任意のSQLファイルにマッピングできます。
19+ By default DELETE statement is auto generated.
20+ You can mapping arbitrary SQL file by specifying `` true `` to ``sqlFile `` property within the `` @BatchDelete `` annotation.
2121
22- パラメータの要素である :doc: `../entity ` にエンティティリスナーが指定されている場合、
23- 削除の実行前にエンティティリスナーの ``preDelete ``
24- メソッドがエンティティごとに呼び出されます。
25- また、削除の実行後にエンティティリスナーの ``postDelete ``
26- メソッドがエンティティごとに呼び出されます。
22+ The ``preDelete `` method of entity listener is called each entity when before executing delete if the entity listener is specified at :doc: `../entity ` parameter.
23+ Also the ``postDelete `` method of entity listener method is called each entity when after executing delete.
2724
28- 戻り値
29- ======
25+ Return value
26+ ==============
3027
31- 戻り値は各更新処理の更新件数を表す ``int[] `` でなければいけません。
28+ Return value must be ``int[] `` that is represented each deleting process's updated count.
3229
33- SQLの自動生成によるバッチ削除
34- =============================
30+ Batch delete by auto generated SQL
31+ ====================================
3532
36- パラメータの型は :doc: `../entity ` を要素とする ``java.lang.Iterable ``
37- のサブタイプでなければいけません。
38- 指定できるパラメータの数は1つです。
39- 引数は ``null `` であってはいけません。
40- 戻り値の配列の要素の数はパラメータの ``Iterable `` の要素の数と等しくなります。
41- 配列のそれぞれの要素が更新された件数を返します。
33+ Parameter type must be ``java.lang.Iterable `` subtype that has :doc: `../entity ` as an element.
34+ Specifiable parameter is only one.
35+ Parameter must not be ``null ``.
36+ Return value array element count become equal ``Iterable `` element count.
37+ Delete count is returned to array each element.
4238
43- SQL自動生成におけるバージョン番号と楽観的排他制御
44- -------------------------------------------------
39+ Version number and optimistic concurrency control in auto generated SQL
40+ -----------------------------------------------------------------------------
4541
46- 次の条件を満たす場合に、楽観的排他制御が行われます。
42+ Optimistic concurrency control is executed if you satisfied below conditions.
4743
48- * パラメータのjava.lang.Iterableのサブタイプの要素である
49- :doc: `../entity ` に@Versionが注釈されたプロパティがある
50- * @BatchDeleteのignoreVersion要素がfalseである
44+ * :doc: `../entity ` within parameter java.lang.Iterable subtype has property that is annotated with @Version
45+ * The ignoreVersion element within @BatchDelete annotation is false
5146
52- 楽観的排他制御が有効であれば、バージョン番号は識別子とともに削除条件に含まれます。
53- この場合、削除件数が0件であれば、楽観的排他制御の失敗を示す
54- ``BatchOptimisticLockException `` がスローされます。
47+ If optimistic concurrency control is enable, version number is included with identifier in delete condition.
48+ ``BatchOptimisticLockException `` representing optimistic concurrency control failure is thrown, if at that time deleted count is 0.
5549
5650ignoreVersion
5751~~~~~~~~~~~~~
5852
59- ``@BatchDelete `` の ``ignoreVersion `` 要素が ``true `` の場合、
60- バージョン番号は削除条件には含まれません。
61- 削除件数が0件であっても ``BatchOptimisticLockException `` はスローされません。
53+ If ``ignoreVersion `` property within ``@BatchDelete `` annotation is ``true ``, version number is not include in delete condition.
54+ ``BatchOptimisticLockException `` is not thrown, even if delete count is 0.
6255
6356.. code-block :: java
6457
@@ -68,65 +61,61 @@ ignoreVersion
6861 suppressOptimisticLockException
6962~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7063
71- ``@BatchDelete `` の ``suppressOptimisticLockException `` 要素が ``true `` の場合、
72- バージョン番号は削除条件に含まれますが、
73- 削除件数が0件であっても ``BatchOptimisticLockException `` はスローされません。
64+ In case of ``suppressOptimisticLockException `` property within ``@BatchDelete `` is ``true ``,
65+ version number is include in delete condition but ``BatchOptimisticLockException `` is not thrown even if delete count is 0.
7466
7567.. code-block :: java
7668
7769 @BatchDelete (suppressOptimisticLockException = true )
7870 int [] delete(List<Employee > employees);
7971
80- SQLファイルによるバッチ削除
72+ Batch delete by SQL file
8173===========================
8274
83- SQLファイルによるバッチ削除を行うには、 `` @BatchDelete `` の `` sqlFile `` 要素に
84- ``true `` を設定し、 メソッドに対応するSQLファイルを用意します。
75+ To execute batch deleting by SQL file,
76+ you set ``true `` to `` sqlFile `` property within `` @BatchDelete `` annotation and prepare SQL file that correspond method.
8577
8678.. code-block :: java
8779
8880 @BatchDelete (sqlFile = true )
8981 int [] delete(List<Employee > employees);
9082
91- パラメータは任意の型を要素とする ``java.lang.Iterable `` のサブタイプでなければいけません。
92- 指定できるパラメータの数は1つです。
93- 引数は ``null `` であってはいけません。
94- 戻り値の配列の要素の数はパラメータの ``Iterable `` の要素の数と等しくなります。
95- 配列のそれぞれの要素が更新された件数を返します。
83+ Parameter type must be ``java.lang.Iterable `` subtype that has arbitrary type as an element.
84+ Specifiable parameter is only one.
85+ Parameter must not be ``null ``.
86+ Return value array element count become equal ``Iterable `` element count.
87+ Delete count is returned to array each element.
9688
97- たとえば、上記のメソッドに対応するSQLは次のように記述します。
89+ For example, you describe SQL like below to correspond above method.
9890
9991.. code-block :: sql
10092
10193 delete from employee where name = /* employees.name */'hoge'
10294
103- SQLファイル上では、パラメータの名前は ``java.lang.Iterable `` のサブタイプの要素を指します。
95+ Parameter name indicate ``java.lang.Iterable `` subtype element in SQL file.
10496
105- SQLファイルにおけるバージョン番号と楽観的排他制御
106- -------------------------------------------------
97+ Version number and optimistic concurrency control in SQL file
98+ --------------------------------------------------------------
10799
108- 次の条件を満たす場合に、楽観的排他制御が行われます。
100+ Optimistic concurrency control is executed if you satisfied below conditions.
109101
110- * パラメータの ``java.lang.Iterable `` のサブタイプの要素が :doc: `../entity ` であり、
111- :doc: `../entity ` に@Versionが注釈されたプロパティがある
112- * @BatchDeleteのignoreVersion要素がfalseである
102+ * The parameter ``java.lang.Iterable `` subtype has :doc: `../entity ` element, the :doc: `../entity ` element is annotated with @Version
103+ * The ignoreVersion element within @BatchDelete annotation is false
113104
114- ただし、SQLファイルに楽観的排他制御用のSQLを記述するのは、アプリケーション開発者の責任です。
115- たとえば、下記のSQLのように、WHERE句でバージョンを番号を指定しなければいけません。
105+ However, describing to SQL file for Optimistic concurrency control SQL is application developer's responsibility.
106+ For example like below SQL, you must specify version number in WHERE clauses.
116107
117108.. code-block :: sql
118109
119110 delete from EMPLOYEE where ID = /* employees.id */1 and VERSION = /* employees.version */1
120111
121- このSQLの削除件数が0件または複数件の場合、
122- 楽観的排他制御の失敗を示す ``BatchOptimisticLockException `` がスローされます。
112+ ``BatchOptimisticLockException `` representing optimistic concurrency control failure is thrown, if deleted count is 0 or multiple in this SQL.
123113
124114ignoreVersion
125115~~~~~~~~~~~~~
126116
127- ``@BatchDelete `` の ``ignoreVersion ``
128- 要素が ``true `` の場合、削除件数が0件または複数件であっても
129- ``BatchOptimisticLockException `` はスローされません。
117+ If ``ignoreVersion `` property within ``@BatchDelete `` annotation is true,
118+ ``BatchOptimisticLockException `` is not thrown even if deleted count is 0 or multiple.
130119
131120.. code-block :: java
132121
@@ -136,51 +125,48 @@ ignoreVersion
136125 suppressOptimisticLockException
137126~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138127
139- ``@BatchDelete `` の ``suppressOptimisticLockException ``
140- 要素が ``true `` の場合、削除件数が0件または複数件であっても
141- ``BatchOptimisticLockException `` はスローされません。
128+ If ``suppressOptimisticLockException `` property within ``@BatchDelete `` is ``true ``,
129+ ``BatchOptimisticLockException `` is not thrown even if deleted count is 0 or multiple.
142130
143131.. code-block :: java
144132
145133 @BatchDelete (sqlFile = true , suppressOptimisticLockException = true )
146134 int [] delete(List<Employee > employees);
147135
148- クエリタイムアウト
136+ Query timeout
149137==================
150138
151- `` @BatchDelete `` の `` queryTimeout `` 要素にクエリタイムアウトの秒数を指定できます。
139+ You can specify seconds of query timeout to `` queryTimeout `` property within `` @BatchDelete `` annotation.
152140
153141.. code-block :: java
154142
155143 @BatchDelete (queryTimeout = 10 )
156144 int [] delete(List<Employee > employees);
157145
158- この指定は、SQLファイルの使用の有無に関係なく適用されます。
159- ``queryTimeout `` 要素に値を指定しない場合、
160- :doc: `../config ` に指定されたクエリタイムアウトが使用されます。
146+ This specifying is applied regardless of with or without using sql file.
147+ Query timeout that is specified in config class is used if ``queryTimeout `` property is not set value.
161148
162- バッチサイズ
149+ Batch size
163150============
164151
165- `` @BatchDelete `` の `` batchSize `` 要素にバッチサイズを指定できます。
152+ You can specify batch size to `` batchSize `` property within `` @BatchDelete `` annotation.
166153
167154.. code-block :: java
168155
169156 @BatchDelete (batchSize = 10 )
170157 int [] delete(List<Employee > employees);
171158
172- この設定は、SQLファイルの使用の有無に関係なく適用されます。
173- ``batchSize `` 要素に値を指定しない場合、 :doc: `../config ` に指定されたバッチサイズが使用されます。
159+ This specify is applied regardless of using or not using SQL file.
160+ It you do not specify the value to ``batchSize `` property, batch size that is specified at :doc: `../config ` class is applied.
174161
162+ SQL log output format
163+ =======================
175164
176- SQL のログ出力形式
177- ==================
178-
179- ``@BatchDelete `` の ``sqlLog `` 要素に SQL のログ出力形式を指定できます。
165+ You can specify SQL log output format to ``sqlLog `` property within ``@BatchDelete `` annotation.
180166
181167.. code-block :: java
182168
183169 @BatchDelete (sqlLog = SqlLogType . RAW )
184170 int [] delete(List<Employee > employees);
185171
186- ``SqlLogType.RAW `` はバインドパラメータ(?)付きの SQL をログ出力することを表します。
172+ ``SqlLogType.RAW `` represent outputting log that is sql with a binding parameter.
0 commit comments