Giới thiệu về tool WAK CRUD generation tool

Là công cụ cực kỳ hữu ích để sinh ra các thư mục (file .dic) trên framework WAK khi bạn đã có sẵn DB

Download

Bạn có thể download công cụ trên tại đây

Hướng dẫn sử dụng

Khi download và giải nén công cụ CRUD xong,ta được các file và thư mục sau

  1. Thư mục: wak
  2. File jar: ftl_schema_code_generator_1_0
  3. Batch file: gen_adm_wak
  4. Batch file: gen_oracle_wak

Để tạo được các file trên hãy lần lượt làm các bước:

Bước 1: Mở file gen_adm_wak-Giải thích các cấu hình

Sử dụng các trình chỉnh sửa văn bản (emEditor,notepad++..).Bạn sẽ thấy được các dòng cấu hình CRUD mặc định ban đầu như sau:

gen_oracle_wak.bat jdbc:oracle:thin:@cangiuoc.ftl.vn:1522:orcl WAK WAK "(ut.table_name like 'ADM_%%' OR ut.table_name like 'ADM_%%' OR ut.table_name like 'ADM_%%')" com.ftl.wakadm wak_out

Ý nghĩa của các tham số như sau:
  1. gen_oracle_wak.bat : file .bat để kết nối đến DB
  2. jdbc:oracle:thin:@cangiuoc.ftl.vn:1522:orcl: Thông tin DB mà bạn dự án của bạn đang sử dụng
  3. WAK WAK: Thông tin User/Password của DB
  4. (ut.table_name like 'ADM_%%' OR ut.table_name like 'ADM_%%' OR ut.table_name like 'ADM_%%': Câu lệnh để xác định xem bạn mong muốn sinh ra thư mục từ các bảng nào.Như câu lệnh trên là sinh thư mục từ các bảng bắt đầu bằng 'ADM_'. Bạn có thể thêm nhiều điều kiện để lọc ra thư mục cần thiết,các điều kiện được nối với nhau bằng từ khóa 'OR'
  5. com.ftl.wakadm: Đường dẫn file khi sinh ra
  6. wak-out: thư mục chứa các file sinh ra

Bước 2: Chạy file gen_adm_wak.bat

Sau khi thay các tham số được viết ra ở bước 1 cho phù hợp với thông tin DB của dự án của bạn,thì bước tiếp theo đơn giản là chạy file gen_adm_wak.bat .
Ví dụ minh họa ở đây ,file gen_adm_wak.bat của tôi được sửa như sau:

gen_oracle_wak.bat jdbc:oracle:thin:@192.168.9.172:1521:orcl EXAMPLE EXAMPLE "(ut.table_name like 'EXAMPLE_%%' )" com.ftl.wakadm wak_out

Ở đây tôi sử dụng DB có thông tin sau:192.168.9.172:1521:orcl
Có User:EXAMPLE
Có pass:EXAMPLE
Và lấy ra các bảng được bắt đầu bằng "EXAMPLE"
Sau khi chạy nhận được thông báo sau:
Query table statement:
SELECT ut.table_name, ut.tablespace_name, utc.comments FROM user_tables ut, USER_TAB_COMMENTS utc WHERE ut.table_name = utc.table_name AND ut.table_name NOT LIKE 'BIN$%' AND (ut.table_name like 'NEIF_%' ) ORDER BY table_name
Oct 19, 2016 9:33:17 AM com.ftl.util.Log info
INFO: Loading configuration file com/ftl/dictionary/Dictionary.dic failed
Oct 19, 2016 9:33:17 AM com.ftl.util.Log info
INFO: Loaded dictionary from resource /com/ftl/as/CharformConverter.dic
Loading columns & key on table NEIF_DETAIL
Completed
Loading columns & key on table NEIF_LIMIT
Completed
Loading reference on table NEIF_DETAIL
Completed
Loading reference on table NEIF_LIMIT
Completed
Analyze table reference on table NEIF_DETAIL
Completed
Analyze table reference on table NEIF_LIMIT
Completed
Analyze many-mary reference on table NEIF_DETAIL
Completed
Analyze many-mary reference on table NEIF_LIMIT
Completed
Oct 19, 2016 9:33:17 AM com.ftl.util.Log info
INFO: Loaded dictionary from file C:\Users\TruongNV20\Downloads\wak-generation-tool\wak\report.scg
Oct 19, 2016 9:33:17 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating code for NEIF_DETAIL
Oct 19, 2016 9:33:17 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target ReportLangVN
Oct 19, 2016 9:33:17 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_detail//listVN.dic
Oct 19, 2016 9:33:17 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_detail\listVN.dic created
Oct 19, 2016 9:33:17 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target ReportLangVN completed
Oct 19, 2016 9:33:17 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target ReportLangEN
Oct 19, 2016 9:33:17 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_detail//listEN.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target DetailLangVN
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_detail//detailVN.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_detail\detailVN.dic created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target DetailLangVN completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target DetailLangEN
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_detail//detailEN.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_detail\detailEN.dic created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target DetailLangEN completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target Detail
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_detail//detail.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_detail\detail.dic created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target Detail completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating code for NEIF_DETAIL completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating code for NEIF_LIMIT
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target ReportLangVN
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_limit//listVN.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_limit\listVN.dic created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target ReportLangVN completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target ReportLangEN
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_limit//listEN.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_limit\listEN.dic created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target ReportLangEN completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target Report
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_limit//list.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_limit\list.dic created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target Report completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target AdminScript
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm//admin.sql
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\admin.sql created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target AdminScript completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target CreateLangVN
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_limit//createVN.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_limit\createVN.dic created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target CreateLangVN completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target EditLangEN completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target Edit
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_limit//edit.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_limit\edit.dic created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target Edit completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target RemoveLangVN
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_limit//removeVN.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_limit\removeVN.dic created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target RemoveLangVN completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target RemoveLangEN
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_limit//removeEN.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_limit\removeEN.dic created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target RemoveLangEN completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target Remove
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_limit//remove.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_limit\remove.dic created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target Remove completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target DetailLangVN
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_limit//detailVN.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_limit\detailVN.dic created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target DetailLangVN completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target DetailLangEN
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_limit//detailEN.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_limit\detailEN.dic created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target DetailLangEN completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start generating target Detail
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Start creating file wak_out/com/ftl/wakadm/neif_limit//detail.dic
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: File C:\Users\TruongNV20\Downloads\wak-generation-tool\wak_out\com\ftl\wakadm\neif_limit\detail.dic created
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating target Detail completed
Oct 19, 2016 9:33:18 AM com.ftl.as.cg.SchemaCodeGenerator generateTableCode
INFO: Generating code for NEIF_LIMIT completed

=> Bạn đã gen thư mục thành công.

Tiếp tục tạo thêm thư mục

Khi đã tạo ra file ban đầu thành công trong thư mục CRUD sẽ sinh ra thêm file 'com_ftl_wakadm.schema'.Hãy xóa file trên và thư mục 'wak_out'
và cấu hình lại file 'gen_adm_wak'

Comment