transactd 1.2.0-x64-mswin64-100 → 2.0.0-x64-mswin64-100

Sign up to get free protection for your applications and to get access to all the features.
data/README-JA CHANGED
@@ -1,4 +1,4 @@
1
- Transactd リリースノート
1
+ Transactd リリースノート
2
2
  ===============================================================================
3
3
  Transactd PluginはMySQL/MariaDBにNoSQLアクセスを追加するプラグインです。
4
4
 
@@ -13,6 +13,8 @@ Transactd PluginはMySQL/MariaDBにNoSQLアクセスを追加するプラグイ
13
13
  * アプリケーションの開発
14
14
  * Testプログラム
15
15
  * ベンチマークプログラム
16
+ * C++ O/Rマッピングソースコードジェネレータ
17
+ * クエリーエグゼキューター
16
18
  * Transactd Pluginのライセンス
17
19
  * Transactdクライアントのライセンス
18
20
  * バグ報告・要望・質問など
@@ -43,14 +45,14 @@ show variables like 'version';
43
45
  ```
44
46
  ダウンロードするファイルは
45
47
 
46
- * Windowsの場合 transactd-[platform]-1.1.0_[mysql-version].zip
47
- * Linuxの場合 transactd-linux-x86_64-1.1.0_[mysql-version].tar.gz
48
+ * Windowsの場合 transactd-[platform]-2.0.0_[mysql-version].zip
49
+ * Linuxの場合 transactd-linux-x86_64-2.0.0_[mysql-version].tar.gz
48
50
 
49
51
  といった形式です。
50
52
  [platform]はwin32またはwin64、[mysql-version]はmysql-5.x.xまたはmariadb-5.5.xです。
51
53
  たとえば、Linux-x86_64bit mysql-5.6.14用の完全なURLは以下の通りです。
52
54
 
53
- http://www.bizstation.jp/al/transactd/download/transactd-1.1.0/transactd-linux-x86_64-1.1.0_mysql-5.6.14.tar.gz
55
+ http://www.bizstation.jp/al/transactd/download/transactd-2.0.0/transactd-linux-x86_64-2.0.0_mysql-5.6.14.tar.gz
54
56
 
55
57
  また、ソースをダウンロードしてビルドすることもできます。その場合は、
56
58
  MySQL/MariaDBのソースコードも必要です。ビルド方法はソースコード内の
@@ -71,53 +73,53 @@ MySQL/MariaDBのバイナリに変更を加えることなく、所定の位置
71
73
  2. [MySQL|MariaDBインストールフォルダ]/lib/pluginに、transactd.dllをコピーします。
72
74
  MySQL|MariaDBインストールフォルダが不明な場合は、MySQL Command Line clientを
73
75
  起動し以下のコマンドでplugin_dirを確認してください。
74
- ```
75
- mysql>show variables like 'Plugin%';
76
- +---------------+----------------------------------------------------+
77
- | Variable_name | Value |
78
- +---------------+----------------------------------------------------+
79
- | plugin_dir | C:\Program Files\MySQL\MySQL Server 5.6\lib\plugin |
80
- +---------------+----------------------------------------------------+
81
- ```
76
+ ```
77
+ mysql>show variables like 'Plugin%';
78
+ +---------------+----------------------------------------------------+
79
+ | Variable_name | Value |
80
+ +---------------+----------------------------------------------------+
81
+ | plugin_dir | C:\Program Files\MySQL\MySQL Server 5.6\lib\plugin |
82
+ +---------------+----------------------------------------------------+
83
+ ```
82
84
 
83
85
  3. MySQL Command Line clientを起動し、以下のコマンドを実行します。
84
- ```
85
- mysql>INSTALL PLUGIN transactd SONAME 'transactd.dll';
86
- ```
87
- これでPluginのインストールは終了です。
86
+ ```
87
+ mysql>INSTALL PLUGIN transactd SONAME 'transactd.dll';
88
+ ```
89
+ これでPluginのインストールは終了です。
88
90
 
89
91
 
90
92
  ### Linuxでのインストール
91
93
  1. ダウンロードしたtar.gzのあるフォルダに移動します。
92
- ```
93
- shell>cd [TargetFolder]
94
- ```
94
+ ```
95
+ cd [TargetFolder]
96
+ ```
95
97
 
96
98
  2. ダウンロードしたtar.gzを解凍し、解凍したフォルダに移動します。
97
- ```
98
- shell>tar zxf transactd-linux-x86_64-1.1.0_mysql-5.6.14.tar.gz
99
- shell>cd transactd-linux-x86_64-1.1.0_mysql-5.6.14
100
- ```
99
+ ```
100
+ tar zxf transactd-linux-x86_64-2.0.0_mysql-5.6.14.tar.gz
101
+ cd transactd-linux-x86_64-2.0.0_mysql-5.6.14
102
+ ```
101
103
 
102
104
  3. [MySQL|MariaDBインストールフォルダ]/lib/pluginに、libtransactd.soをコピー
103
105
  します。MySQL|MariaDBインストールが不明な場合は、mysqlを起動し以下の
104
106
  コマンドでplugin_dirを確認してください。
105
- ```
106
- mysql>show variables like 'plugin%';
107
- +---------------+-----------------------------+
108
- | Variable_name | Value |
109
- +---------------+-----------------------------+
110
- | plugin_dir | /usr/local/mysql/lib/plugin |
111
- +---------------+-----------------------------+
112
- mysql>exit
113
- shell>cp libtransactd.so /usr/local/mysql/lib/plugin/
114
- ```
107
+ ```
108
+ mysql>show variables like 'plugin%';
109
+ +---------------+-----------------------------+
110
+ | Variable_name | Value |
111
+ +---------------+-----------------------------+
112
+ | plugin_dir | /usr/local/mysql/lib/plugin |
113
+ +---------------+-----------------------------+
114
+ mysql>exit
115
+ cp libtransactd.so /usr/local/mysql/lib/plugin/
116
+ ```
115
117
 
116
118
  4. mysqlを起動し、以下のコマンドを実行します。
117
- ```
118
- mysql>INSTALL PLUGIN transactd SONAME 'libtransactd.so';
119
- ```
120
- これでPluginのインストールは終了です。
119
+ ```
120
+ mysql>INSTALL PLUGIN transactd SONAME 'libtransactd.so';
121
+ ```
122
+ これでPluginのインストールは終了です。
121
123
 
122
124
 
123
125
 
@@ -127,13 +129,13 @@ Transactd Pluginを介してデータにアクセスするにはTransactdクラ
127
129
  プラットフォームに合ったビルド済Transactdクライアントをダウンロードします。
128
130
  ダウンロードするファイルは
129
131
 
130
- * Windowsの場合 transactd-client-[platform]_with_sdk-1.1.0.msi
131
- * Linuxの場合 transactd-client-linux-x86_64_with_sdk-1.1.0.tar.gz
132
+ * Windowsの場合 transactd-client-[platform]_with_sdk-2.0.0.zip
133
+ * Linuxの場合 transactd-client-linux-x86_64_with_sdk-2.0.0.tar.gz
132
134
 
133
135
  といった形式です。[platform]はwin32またはwin64です。
134
136
  たとえば、LINUXの完全なURLは以下の通りです。
135
137
 
136
- http://www.bizstation.jp/al/transactd/download/transactd-client/transactd-client-linux-x86_64_with_sdk-1.1.0.tar.gz
138
+ http://www.bizstation.jp/al/transactd/download/transactd-client/transactd-client-linux-x86_64_with_sdk-2.0.0.tar.gz
137
139
 
138
140
 
139
141
 
@@ -141,36 +143,48 @@ Transactdクライアントのインストール
141
143
  -------------------------------------------------------------------------------
142
144
 
143
145
  ### Windowsでのインストール
144
- 1. transactd-client-[platform]_with_sdk-1.1.0.msiをダブルクリックするとWindows
145
- インストーラによるインストールが始まります。あとは画面に従ってインストールし
146
- ます。
146
+ 1. ダウンロードしたtransactd-client-[platform]_with_sdk-2.0.0.zipを開きます。
147
+ 2. ルートフォルダーのtransactd-client-[platform]_with_sdk-2.0.0ごと適当なフォルダに
148
+ コピーします。
149
+ 3. transactd-client-[platform]_with_sdk-2.0.0直下にあるinstall.cmdを実行します。
150
+ これによりtransactd-client-[platform]_with_sdk-2.0.0\binフォルダをシステム環境変数
151
+ PATHに追加します。
147
152
 
148
- セットアップタイプの選択画面で[カスタム]を選択するとEmbarcadero C++Builder XE
149
- シリーズ用のクライアントも選択できます。インストールできるコンパイラターゲットは
153
+ C++クライアントは binフォルダに配置された以下の3つのDLLからなります。
150
154
 
151
- * Microsoft Visual studio 2010用 (ActiveX(COM)クライアントを含みます)
152
- * Embarcadero C++Builder XEシリーズ用
155
+ * tdclc_xx_[version].dll
156
+ * tdclcpp_xx_[Compiler]_[version].dll
157
+ * tdclstmt_xx_[Compiler]_[version].dll
158
+
159
+ このうち下の2つはC++のクラスをエクスポートするための、コンパイラごとに異なった
160
+ モジュールです。また、それを利用したテストやベンチマーク、その他のプログラムも
161
+ コンパイラごとになっていますです。それらはbin配下にコンパイラの名前のフォルダに
162
+ 配置されています。
163
+ 開発コンパイラが特定されている場合には、不要なモジュールは削除しても構いません。
153
164
 
154
- の2種類です。Microsoft Visual studio 2010版については必ずインストールされます。
165
+ ビルド済みバイナリーが含まれるコンパイラは以下の7種類です。
166
+
167
+ * Microsoft Visual studio 2010用 (ActiveX(COM)クライアントを含みます)
168
+ * Embarcadero C++Builder XE~XE6シリーズ用
155
169
 
156
170
 
157
171
  ### Linuxでのインストール
158
172
  1. ダウンロードしたtar.gzのあるフォルダに移動します。
159
- ```
160
- shell>cd [TargetFolder]
161
- ```
173
+ ```
174
+ cd [TargetFolder]
175
+ ```
162
176
 
163
177
  2. ダウンロードしたtar.gzを解凍し、解凍したフォルダに移動します。
164
- ```
165
- shell>tar zxf transactd-client-linux-x86_64_with_sdk-1.1.0.tar.gz
166
- shell>cd transactd-client-linux-x86_64_with_sdk-1.1.0
167
- ```
178
+ ```
179
+ tar zxf transactd-client-linux-x86_64_with_sdk-2.0.0.tar.gz
180
+ cd transactd-client-linux-x86_64_with_sdk-2.0.0
181
+ ```
168
182
 
169
183
  3. インストールスクリプトを実行します。
170
- ```
171
- shell>./install_client.sh
172
- ```
173
- これでクライアントのインストールは終了です。
184
+ ```
185
+ ./install_client.sh
186
+ ```
187
+ これでクライアントのインストールは終了です。
174
188
 
175
189
 
176
190
 
@@ -187,21 +201,21 @@ Transactdへアクセスするには、事前にMySQLのuserテーブルにroot@
187
201
  ```
188
202
  mysql>CREATE USER root@'192.168.0.0/255.255.255.0';
189
203
  ```
190
- この操作はrootでのアクセスを可能にしますので、rootのパスワードが未設定の場合は、
204
+ この操作はrootでのアクセスを可能にするので、rootのパスワードが未設定の場合は、
191
205
  必ず設定してください。
192
206
 
193
207
 
194
208
  ### Windowsでのrootパスワードの設定
195
209
  コマンドプロンプトを開きます。
196
210
  ```
197
- shell>"C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqladmin" -u root password 'xxxxx'
211
+ "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqladmin" -u root password 'xxxxx'
198
212
  ```
199
213
  (xxxxxは実際のパスワードに置き換えてください)
200
214
 
201
215
 
202
216
  ### Linuxでのrootパスワードの設定
203
217
  ```
204
- shell>/usr/local/mysql/bin/mysqladmin -u root password 'xxxxx'
218
+ /usr/local/mysql/bin/mysqladmin -u root password 'xxxxx'
205
219
  ```
206
220
  (xxxxxは実際のパスワードに置き換えてください)
207
221
 
@@ -224,23 +238,58 @@ Transactd Pluginとクライアントのインストールが済んだら、テ
224
238
  テストとベンチマークの詳しい内容は、このトピックス以降にあるそれぞれのトピックス
225
239
  を参照してください。
226
240
 
241
+ テストスクリプトは、以下の内容を順に実行します。
242
+ * test_tdclcpp_xx_xxm_xxx.exe マルチバイト版テスト
243
+ * test_tdclcpp_xx_xxu_xxx.exe ユニコード版テスト(Windowsのみ)
244
+ * bench_tdclcpp_xx.exe Insert read update ベンチマーク
245
+ * bench_query_xx.exe クエリーのベンチマーク
246
+ * querystmtsxx.exe コマンドライン クエリー実行モジュール
247
+
248
+ 最後の コマンドライン クエリー実行モジュールは、ターゲットhostが localhost の場合
249
+ にのみ実行されます。
250
+
251
+
227
252
  ### Windowsでの起動
228
- 1. スタートメニューから[すべてのプログラム]-[BizStation]-[Transactd Client]-
229
- [Test (compiler)(charset)]または[Benchmark local (compiler)]
230
- をクリックします。
231
- (compiler)はVC100またはBCBです。(charset)はUnicodeまたはMultibyteです。
253
+ 1. クライアントのインストールで解凍したフォルダに移動します
254
+ ```
255
+ cd transactd-client-[platform]_with_sdk-2.0.0
256
+ ```
257
+
258
+ 2. テストの起動
259
+ ```
260
+ TestClient.cmd
261
+ ```
262
+
263
+ 最初にホスト名を聞かれるので、Transactdサーバーのホスト名を指定します。
264
+ 何も指定しない場合は localhostが自動で設定されます。
265
+
266
+ 次に、テストするコンパイラーを番号で選択します。
267
+ テストおよびベンチマークなどが連続して実行されます。
268
+
269
+ 3. ActiveX(COM)のテストの起動
270
+ ```
271
+ TestClient_ATL.cmd
272
+ ```
273
+
274
+ 最初にホスト名を聞かれるので、Transactdサーバーのホスト名を指定します。
275
+ 何も指定しない場合は localhostが自動で設定されます。
276
+ テストおよびベンチマークなどが連続して実行されます。
232
277
 
233
278
 
234
279
  ### Linuxでの起動
235
280
  1. クライアントのインストールで解凍したフォルダに移動します
236
- ```
237
- shell>cd transactd-client-linux-x86_64_with_sdk-1.1.0
238
- ```
281
+ ```
282
+ cd transactd-client-linux-x86_64_with_sdk-2.0.0
283
+ ```
239
284
 
240
285
  2. テストの起動
241
- ```
242
- ./exec_test_local.sh
243
- ```
286
+ ```
287
+ ./exec_test_all.sh
288
+ ```
289
+
290
+ 最初にホスト名を聞かれるので、Transactdサーバーのホスト名を指定します。
291
+ 何も指定しない場合は localhostが自動で設定されます。
292
+ テストおよびベンチマークなどが連続して実行されます。
244
293
 
245
294
 
246
295
 
@@ -251,6 +300,22 @@ Transactdクライアントによるアプリケーションの開発は以下
251
300
 
252
301
  http://www.bizstation.jp/ja/transactd/client/sdk/doc/
253
302
 
303
+ source/bzs/exampleフォルダに、簡単なサンプルコードがあります。
304
+
305
+ build/exampleフォルダにコンパイラに応じたプロジェクトファイル(Windows)があります。
306
+ または、make_example.shスクリプト(Linux)でこれらをビルドできます。
307
+
308
+ Visual C++ 2010のExpress版 64Bitでコンパイルする際は、各プロジェクトの[オプション]
309
+ -[構成プロパティー]-[全般]-[プラットフォームツールセット]を"v100"から"Windows7.1SDK"
310
+ に変更してください。
311
+
312
+ C++ Builderの場合は、事前にコンパイラ付属のboostをインストールが必要です。また、
313
+ [ツール]-[オプション]-[環境オプション]-[C++ オプション]-[パスとディレクトリ]の
314
+ [システムインクルードパス]に以下の変数を追加します。
315
+
316
+ * 32Bitの場合 $(CG_BOOST_ROOT)
317
+ * 64Bitの場合 $(CG_64_BOOST_ROOT)
318
+
254
319
 
255
320
 
256
321
  Testプログラム
@@ -288,9 +353,12 @@ character-set-server=utf8
288
353
 
289
354
  ベンチマークプログラム
290
355
  -------------------------------------------------------------------------------
291
- ベンチマークプログラムは、コマンドライン引数のprocessNumberを変えることで複数の
292
- インスタンスを同時に実行して計測することができます。
293
- ベンチマークプログラムのコマンドラインオプションは以下の通りです。
356
+ ベンチマークプログラムは、基本的なCRUDオペレーションのベンチマーク(bench_tdclcpp_xxx)
357
+ と、SQLライクな読み取りクエリーのベンチマーク(bench_query_xxx)の2種類あります。
358
+
359
+ bench_tdclcpp_xxxベンチマークプログラムは、コマンドライン引数のprocessNumberを
360
+ 変えることで複数のインスタンスを同時に実行して計測することができます。
361
+ bench_tdclcpp_xxxプログラムのコマンドラインオプションは以下の通りです。
294
362
 
295
363
  ```
296
364
  bench_tdclcpp_xxx.exe databaseUri processNumber functionNumber
@@ -318,8 +386,71 @@ bench_tdclcpp_xxx.exe databaseUri processNumber functionNumber
318
386
  | | 8: update in transaction. 20rec x 1000times |
319
387
  |----------------|--------------------------------------------------------|
320
388
  ex)
321
- shell>bench_tdclcpp_c_bcb_64.exe "tdap://localhost/test?dbfile=test.bdf" 0 -1
389
+ bench_tdclcpp_bc200_64u.exe "tdap://localhost/test?dbfile=test.bdf" 0 -1
390
+ ```
391
+
392
+ bench_query_xxxベンチマークプログラムは、以下のSQLと同等な結果を得る速度を計測
393
+ します。
394
+ ```
395
+ select
396
+ `user`.`id`
397
+ ,`user`.`name`
398
+ ,`extention`.`comment`
399
+ ,`groups`.`name` as `group_name`
400
+ from
401
+ `user` INNER JOIN `extention`
402
+ ON `user`.`id` = `extention`.`id`
403
+ LEFT JOIN `groups`
404
+ ON `user`.`group` = `groups`.`code`
405
+ where
406
+ `user`.`id` > 0 and `user`.`id` <= 15000;
407
+
408
+ ```
409
+ コマンドラインオプションは以下の通りです。
322
410
  ```
411
+ bench_query_xxx createdb hostname type n
412
+ |----------------|--------------------------------------------------------|
413
+ | パラメータ | 内容 |
414
+ |----------------|--------------------------------------------------------|
415
+ | createdb | テスト用データベースを新しく作成するかどうかを 1 または|
416
+ | | 0で指定します。デフォルトは1です。 |
417
+ |----------------|--------------------------------------------------------|
418
+ | hostname | テストを行うホストをIPアドレスまたは名前で指定します。 |
419
+ | | デフォルトは localhostです。 |
420
+ |----------------|--------------------------------------------------------|
421
+ | type | クエリーの内容を番号で指定します。デフォルトは15です。 |
422
+ | | 1: userテーブルから15000レコードの取得 |
423
+ | | 3: 1の結果にextentionテーブルのcommentフィールドをJOIN |
424
+ | | 7: 3の結果にgroupsテーブルのnameをJOIN |
425
+ | | 5: 1の結果にgroupsテーブルのnameをJOIN |
426
+ | |+8: 繰り返しの実行プログレスを.で表示 |
427
+ |----------------|--------------------------------------------------------|
428
+ | n | typeで指定したクエリの実行回数を指定します。 |
429
+ | | デフォルトは100です。 |
430
+ |----------------|--------------------------------------------------------|
431
+ ex)
432
+ bench_query_xxx 0 localhost 15 100
433
+ ```
434
+
435
+
436
+
437
+ C++ O/Rマッピングソースコードジェネレータ
438
+ -------------------------------------------------------------------------------
439
+ ormsrcgen(32|64)はC++ O/Rマッピングのためのソースコードジェネレータです。C++で
440
+ O/Rマッピングを利用する場合はこのプログラムを使って、モデルクラスをデータベース
441
+ 定義から生成することができます。
442
+
443
+ 詳しくはSDKに付属するREADME_ORMSRCGEN-JA.mdを参照してください。
444
+
445
+
446
+
447
+ クエリーエグゼキューター
448
+ -------------------------------------------------------------------------------
449
+ querystmts(32|64)はXMLファイルに記述されたTransactdクエリーの実行プログラムです。
450
+
451
+ querystmtsにXMLファイルを渡すとその内容に従ってクエリーを実行し、結果を標準出力
452
+ に出力します。XMLファイルは、queryBuilderプログラムにて作成します。queryBuilderは
453
+ 現在まだリリースされていません。近日中にリリースされる予定です。
323
454
 
324
455
 
325
456
 
data/README_ORMSRCGEN ADDED
@@ -0,0 +1,118 @@
1
+ ormsrcgen C ++ O/R mapping source code generator
2
+ ===============================================================================
3
+ ormsrcgen (32|64) is a source code generator for C++ O/R mapping.
4
+
5
+ C++ does not allow to define classes dynamically. So we need to generate model
6
+ classes with the source code generator. You can use O/R mapping fast and easy
7
+ in C++ with it.
8
+
9
+
10
+
11
+ Introduction
12
+ -------------------------------------------------------------------------------
13
+ Related files of the generator is in `source/global/ormsrcgen/template`.
14
+ The descriptions of each files are:
15
+
16
+ * ormDataClass_template.cpp : Template of C ++ model class.
17
+ * ormDataClass_template.h : Template of C ++ model class.
18
+ * ormMapClass_template.cpp : Template of C ++ map class.
19
+ * ormMapClass_template.h : Template of C ++ map class.
20
+ * template.cnf : Template of the configuration file
21
+ * fieldNameList_sample.txt : Sample file of field name alias.
22
+
23
+ Edit `fieldNameList_sample.txt` and `template.cnf` as needed.
24
+
25
+
26
+
27
+ Command-line options
28
+ -------------------------------------------------------------------------------
29
+ Command line options are:
30
+
31
+ ```
32
+ command line option:
33
+ -d [ --database_uri ] database uri ex:tdap://hostname/dbname?dbfile=trnasctd_schema
34
+ -t [ --table_name ] table name.
35
+ -c [ --class_name ] class name.
36
+ -f [ --conf_name ] configuration file.
37
+
38
+ -d :Specify the database URI.
39
+ -t :Specify the table name to generate the model class.
40
+ The class is generated for each table.
41
+ -c :Specify the name of the model class.
42
+ -f :Specify the path of configuration file.
43
+ ```
44
+
45
+ In many cases, you can use same configuration file even if tables are different.
46
+ Template of configuration file is `source/global/ormsrcgen/template/template.cnf`.
47
+ You can copy and edit it.
48
+
49
+
50
+
51
+ Descriptions of the configuration file
52
+ -------------------------------------------------------------------------------
53
+ * `lang = (language)`
54
+
55
+ Specify the language of the code to be generated. Only `C++` is supported in
56
+ current version.
57
+
58
+ * `files = (number of file)`
59
+
60
+ Specify the number of template files required for a model. In the case of
61
+ C++, the number is `2`.
62
+
63
+ * `file1 = (file path) file2 = (file path) ... fileN = (file path)`
64
+
65
+ Specify the path of the template file, with the number that was specified in
66
+ `files=`.
67
+ Default values are `file1 = ormDataClass_template` `file2 = ormMapClass_template`,
68
+ but please specify the absolute path in actually.
69
+
70
+ * `saveDir = (output dir)`
71
+
72
+ Specify the output directory to save generated source code files.
73
+
74
+ * `setPrefix = (setter prefix)`
75
+
76
+ Specify the prefix of the setter method of member variables in the class.
77
+ If `setPrefix = set`is specified, the setter function for `name` field is:
78
+
79
+ ```
80
+ setName(const char* v)
81
+ ```
82
+
83
+ * `getPrefix = (getter prefix)`
84
+
85
+ Specify the prefix of the getter method as well as setPrefix.
86
+
87
+ * `externWord = (extern keyword)`
88
+
89
+ Add export keyword in class declaration when make shared libraries
90
+ such as `.SO` or `.DLL`.
91
+
92
+ ```
93
+ class $externWord someModel
94
+ {
95
+ ...
96
+ };
97
+ ```
98
+
99
+ * `fieldRenameList = (alias list file)`
100
+
101
+ Normally, the member variable name of the class is same as the name of
102
+ field in the table. If you want to change the name, specify fieldRenameList
103
+ which contains alias list.
104
+ The fieldRenameList format is:
105
+
106
+ ```
107
+ originalName1=alias1
108
+ originalName2=alias2
109
+ ```
110
+
111
+ * `name_space = (namespace of model class)`
112
+
113
+ Specify the namespace of the model class.
114
+
115
+ * `name_space_map = (namespace of map class)`
116
+
117
+ Specify the namespace of the map class.
118
+ The map class maps the members of the model class and the fields in the table.
@@ -0,0 +1,115 @@
1
+ ormsrcgen C++ O/Rマッピングソースコードジェネレータ
2
+ ===============================================================================
3
+ ormsrcgen(32|64) はC++ O/Rマッピングのためのソースコードジェネレータです。
4
+
5
+ C++では動的にクラスを定義することはできないため、ソースコードジェネレータで
6
+ モデルクラスを生成しコンパイルする形式を採ります。
7
+ これを使うとC++で簡単に高速なO/Rマッピングを行うことができます。
8
+
9
+
10
+
11
+ はじめに
12
+ -------------------------------------------------------------------------------
13
+ ジェネレータの関連ファイルは source/global/ormsrcgen/templateに格納されています。
14
+ それぞれのファイルの役割を説明します。
15
+
16
+ * ormDataClass_template.cpp : C++ モデルクラスのテンプレート
17
+ * ormDataClass_template.h : C++ モデルクラスのテンプレート
18
+ * ormMapClass_template.cpp : C++ マップクラスのテンプレート
19
+ * ormMapClass_template.h : C++ マップクラスのテンプレート
20
+ * template.cnf : 設定ファイルのひな形
21
+ * fieldNameList_sample.txt : フィールド名変換ファイルのサンプル
22
+
23
+ このうち、template.cnfとfieldNameList_sample.txtを必要に応じて編集します。
24
+
25
+
26
+
27
+ コマンドラインオプション
28
+ -------------------------------------------------------------------------------
29
+ コマンドラインオプションは以下の通りです。
30
+
31
+ ```
32
+ command line options:
33
+ -d [ --database_uri ] database uri ex:tdap://hostname/dbname?dbfile=trnasctd_schema
34
+ -t [ --table_name ] table name
35
+ -c [ --class_name ] class name
36
+ -f [ --conf_name ] configuration filename
37
+
38
+ -d :データベースを指定します。
39
+ -t :生成するモデルのテーブルを指定します。生成はテーブルごとに行います。
40
+ -c :-tで指定したテーブルに対応するモデルのクラス名を指定します。
41
+ -f :その他の設定項目を記述したテキストファイル(configuration file)です。
42
+ ```
43
+
44
+ configuration fileは、多くの場合、テーブルが異なっても共通の内容です。ひな形が
45
+ `source/global/ormsrcgen/template/template.cnf`として用意されています。
46
+ これをコピーして内容を編集します。
47
+
48
+
49
+
50
+ configuration fileの書式
51
+ -------------------------------------------------------------------------------
52
+ * `lang = (language)`
53
+
54
+ 生成するコードの言語を指定します。現在のバージョンでは`C++`のみサポートされます。
55
+
56
+ * `files = (number of file)`
57
+
58
+ 1つのモデルのために必要なテンプレートファイルの数を指定します。C++の場合は`2`です。
59
+
60
+ * `file1 = (file path) file2 = (file path) ... fileN = (file path)`
61
+
62
+ `files =`で指定した数のテンプレートファイルのパスを指定します。
63
+ デフォルトでは`file1 = ormDataClass_template` `file2 = ormMapClass_template`
64
+ となっていますが、実際に使用する際は絶対パスで指定してください。
65
+
66
+ * `saveDir = (output dir)`
67
+
68
+ 生成したソースコードを保存するフォルダを指定します。
69
+
70
+ * `setPrefix = (setter prefix)`
71
+
72
+ クラスのメンバ変数に値をセットするアクセスメソッド名のプレフィックスを指定します。
73
+ 例えば、`setPrefix = set`とした場合、`name`というフィールドの値をセットする
74
+ メンバ関数は以下のようになります。
75
+
76
+ ```
77
+ setName(const char* v)
78
+ ```
79
+
80
+ * `getPrefix = (getter prefix)`
81
+
82
+ setPrefixと同様に値の取得メソッドにつけられるプレフィックスを指定します。
83
+
84
+ * `externWord = (extern keyword)`
85
+
86
+ 出力されたクラスをDLLやSOなどのライブラリに含めて共有する場合は、class 宣言の後ろに
87
+ エクスポートのためのキーワードを付加できます。
88
+
89
+ ```
90
+ class $externWord someModel
91
+ {
92
+ ...
93
+ };
94
+ ```
95
+
96
+ * `fieldRenameList = (alias list file)`
97
+
98
+ 通常はテーブルに含まれるフィールド名がそのままクラスのメンバ変数名になります。
99
+ 異なる名前に変更したい場合は、このfieldRenameListで変換リストの書かれたテキスト
100
+ ファイルを指定できます。変換リストは以下のように、変換前=変換後の形式で指定します。
101
+
102
+ ```
103
+ customer_id=id
104
+ customer_name=name
105
+ ```
106
+
107
+ * `name_space = (namespace of model class)`
108
+
109
+ モデルクラスの名前空間を指定します。
110
+
111
+ * `name_space_map = (namespace of map class)`
112
+
113
+ C++の場合、モデルクラスとともに、テーブルとクラスの復元と保存をマッピングする
114
+ mapクラスも同時に生成されます。
115
+ name_space_mapはそのマップクラスの名前空間を指定します。
data/bin/2.0/transactd.so CHANGED
Binary file
Binary file