Compare commits

...

222 Commits

Author SHA1 Message Date
ralfw 58eba308dd 8.8.0.2 2019-07-18 16:14:05 +02:00
ralfw 395d971b99 8.8.0 2019-07-18 16:09:39 +02:00
ralfw c31f453525 release notes update 2019-07-18 16:09:19 +02:00
ralfw d36fc2aa45 prevent connection in AWT thread 2019-07-18 16:08:50 +02:00
ralfw 754fdd631a added comments 2019-07-17 17:07:17 +02:00
ralfw 73addfd60e prevent AWT thread from waiting for meta data 2019-07-17 17:02:32 +02:00
Ralf Wisser de2522771e reduced max issue length 2019-07-17 13:53:12 +02:00
Ralf Wisser 2f11bbd2e1 added some TODOs 2019-07-17 13:51:07 +02:00
ralfw e0499dcbd7 8.8.0.1 2019-07-16 15:54:57 +02:00
ralfw de30765cb1 8.8 2019-07-16 15:38:50 +02:00
Ralf Wisser b77951e76a remove formatting spaces from error message 2019-07-16 13:18:34 +02:00
Ralf Wisser 400bf6cebd prevent reloading schema meta data in AWT thread 2019-07-16 12:50:01 +02:00
Ralf Wisser 2a8ae2c19d removed webupload.sh 2019-07-16 10:43:30 +02:00
Ralf Wisser c894f26625 urlRewriteRules 2019-07-16 10:37:25 +02:00
Ralf Wisser 1936cb35ff compressed error message 2019-07-16 08:58:30 +02:00
Ralf Wisser 2978a95a17 compressed error message 2019-07-16 08:58:19 +02:00
Ralf Wisser 1b97cc4ca2 urlRewriteRules 2019-07-16 08:01:53 +02:00
Ralf Wisser f51b1d1fd7 setThreadSharesConnection for temp thread 2019-07-16 08:00:37 +02:00
Ralf Wisser 14c062008d Fixed FindBugs issue 2019-07-15 09:29:09 +02:00
Ralf Wisser 58b5e7c93b compact stacktrace 2019-07-15 09:17:49 +02:00
Ralf Wisser e3df9fa40c limit max issue length 2019-07-15 08:29:25 +02:00
Ralf Wisser 3c57c0ab28 added jdbc:ibm:oracle.* pattern 2019-07-15 08:28:20 +02:00
ralfw fa68baafe2 added TODO 2019-07-13 06:40:18 +02:00
ralfw 00b7bbedc8 added TODO 2019-07-13 06:39:20 +02:00
Ralf Wisser c087460e09 release notes update 2019-07-11 07:54:48 +02:00
Ralf Wisser a494583bc0 don't use non-default fonts 2019-07-11 07:49:46 +02:00
Ralf Wisser 5cb61dbd04 release notes update 2019-07-10 14:30:05 +02:00
Ralf Wisser 0800c08d44 allow user/pw starting with '-' to be passed via cli 2019-07-10 14:22:07 +02:00
Ralf Wisser 2d470c3444 allow user/pw starting with '-' to be passed via cli 2019-07-10 14:18:45 +02:00
Ralf Wisser e2ae728053 allow user/pw starting with '-' to be passed via cli 2019-07-10 14:12:15 +02:00
ralfw b83ece2f84 api example updated 2019-07-09 18:46:17 +02:00
ralfw 747733d866 api example updated 2019-07-09 18:09:22 +02:00
Ralf Wisser 85438ab011 h2 update (1.4.199) 2019-07-09 08:21:07 +02:00
Ralf Wisser 953e8f3219 h2 update (1.4.199) 2019-07-09 08:20:16 +02:00
Ralf Wisser b94096ea29 h2 update (1.4.199) 2019-07-09 07:38:01 +02:00
Ralf Wisser f60799026a h2 update (1.4.199) 2019-07-09 07:12:23 +02:00
ralfw 71fe6d89c4 prevent showing errors if desktop is not visible 2019-07-08 17:36:40 +02:00
ralfw ff42096d12 release notes update 2019-07-08 17:35:50 +02:00
ralfw 718eeb2263 release notes update 2019-07-08 16:50:27 +02:00
ralfw 79ab21bd1c prevent showing errors if desktop is not visible 2019-07-08 16:49:20 +02:00
ralfw aa53d09dab prevent showing errors if desktop is not visible 2019-07-08 16:48:38 +02:00
ralfw 9516e89af9 prevent showing errors if desktop is not visible 2019-07-08 16:47:38 +02:00
ralfw 323e2a1cef release notes update 2019-07-08 16:33:12 +02:00
ralfw cd086058f0 prevent showing more than 1 error messages at once 2019-07-08 16:32:02 +02:00
ralfw 5c5d26eee3 h2 update (1.4.199) 2019-07-08 16:05:01 +02:00
ralfw 72b7652612 h2 update (1.4.199) 2019-07-08 15:44:49 +02:00
Ralf Wisser 388ea97bac release notes update 2019-07-08 07:16:10 +02:00
Ralf Wisser 1811f8cfcd store recently used file on save 2019-07-08 07:15:51 +02:00
ralfw 3e4939b797 reject invalid models 2019-07-07 08:50:24 +02:00
ralfw d25e6d4b1c commit/rollback explicitly 2019-07-07 08:24:54 +02:00
ralfw 349785c4cb 8.7.8.1 2019-07-04 16:39:52 +02:00
ralfw 0f7fc6c78b don't check collection count if no insert-script is written 2019-07-04 16:17:43 +02:00
ralfw 851c7d0fa6 release notes update 2019-07-04 15:50:42 +02:00
ralfw a13f2214a5 deleting caused syntactically incorrect SQL on table w/o PK 2019-07-04 15:49:37 +02:00
Ralf Wisser 6eaca4f955 release notes update 2019-07-02 08:52:02 +02:00
Ralf Wisser 0868742a8d allow loading extraction models in DataModelManagerDialog 2019-07-02 08:49:29 +02:00
Ralf Wisser fb11d3b1e2 removed TODO 2019-07-02 07:54:29 +02:00
Ralf Wisser 68d8b9c781 removed obsolete method 2019-07-02 07:54:12 +02:00
ralfw 30e07c5796 8.7.7.0 2019-06-28 17:10:32 +02:00
ralfw 268b4ac833 8.7.7 2019-06-28 16:53:17 +02:00
ralfw 2e3770407c added TODO 2019-06-28 16:52:29 +02:00
ralfw 098e1d368c release notes update 2019-06-28 16:50:57 +02:00
ralfw 2104c9d489 don't check PKs if script format is XML 2019-06-28 16:47:32 +02:00
ralfw 63b411a77d added TODO 2019-06-28 16:24:56 +02:00
ralfw 605ae30c98 release notes update 2019-06-28 15:49:44 +02:00
ralfw 828df86e49 8.7.6.0 2019-06-28 15:45:27 +02:00
ralfw ad2139ed97 8.7.6 2019-06-28 15:33:33 +02:00
ralfw 7b05807b99 New feature "Check Primary Keys" 2019-06-28 15:32:00 +02:00
Ralf Wisser 7ac4b3c462 License update 2019-06-27 12:29:20 +02:00
Ralf Wisser dab9b84719 new class ConcurrentTaskContol 2019-06-27 12:21:05 +02:00
Ralf Wisser c06dcad238 changed color of arrows 2019-06-27 07:24:06 +02:00
Ralf Wisser 44097e1260 dispose export dialog 2019-06-27 07:23:00 +02:00
Ralf Wisser 246bf33450 model updates 2019-06-26 14:05:05 +02:00
Ralf Wisser 81cb2c936d organized imports 2019-06-26 13:14:01 +02:00
Ralf Wisser 4c4fef89dc removed TODO 2019-06-26 12:21:47 +02:00
Ralf Wisser bf9ab7494b improved rendering quality 2019-06-26 12:04:25 +02:00
Ralf Wisser 639f48e6e2 rowsPerTablePanel.repaint() 2019-06-26 12:03:28 +02:00
Ralf Wisser 0830e7c680 don't warn in case of error 2019-06-26 11:15:36 +02:00
Ralf Wisser 336838ac07 release notes update 2019-06-26 10:57:04 +02:00
Ralf Wisser 5d357482fc warn if number of collected rows differs from number of exported ones 2019-06-26 10:56:41 +02:00
Ralf Wisser c73f214c2a 8.7.5.1 2019-06-25 06:44:11 +02:00
Ralf Wisser 4465f1d604 fixed dump-REGEX 2019-06-25 06:43:35 +02:00
ralfw a35d7477ec 8.7.5.0 2019-06-21 12:25:34 +02:00
ralfw 025ea22c63 8.7.5 2019-06-21 12:09:51 +02:00
ralfw bc77da4443 releasenotes update 2019-06-21 12:06:10 +02:00
ralfw bf9029a86d 8.7.5 2019-06-21 11:58:28 +02:00
ralfw eb99956031 separated config for PostgrSQL and Amazon Redshift 2019-06-20 11:18:19 +02:00
ralfw 1de01a9fc0 separated config for MariaDB 2019-06-20 11:00:16 +02:00
ralfw 8364db8c7c separated config for MySQL MariaDB 2019-06-20 10:58:22 +02:00
ralfw 978e70f66e improved AWTWatchdog 2019-06-20 10:49:05 +02:00
ralfw 171b507d0c added TODO 2019-06-18 17:39:57 +02:00
ralfw 0a5db71680 added TODO 2019-06-18 12:28:35 +02:00
ralfw b8d97e4596 added TODO 2019-06-18 07:02:16 +02:00
ralfw 6f0096d5ab getDatabaseProductName before shutdown 2019-06-18 06:50:49 +02:00
ralfw 62f5d5dbc1 8.7.4.0 2019-06-15 08:53:47 +02:00
ralfw b8eacf3596 8.7.4 2019-06-15 08:37:20 +02:00
ralfw f84117354f release notes update 2019-06-15 07:08:12 +02:00
ralfw d5177e0674 refactoring 2019-06-15 07:03:50 +02:00
Ralf Wisser f1179c6dbf removed TODO 2019-06-14 11:53:47 +02:00
Ralf Wisser 9d60ea56c5 render links as curves instead of lines 2019-06-14 11:53:26 +02:00
ralfw 01641ab452 added TODO 2019-06-13 16:32:20 +02:00
ralfw a38d791d6a added TODO 2019-06-13 16:28:55 +02:00
ralfw 69f5353209 8.7.3.0 2019-06-13 15:56:31 +02:00
ralfw ad1b1bbc0f 8.7.3 2019-06-13 15:36:34 +02:00
Ralf Wisser 5d015121b1 add limit clause only if necessary 2019-06-13 14:00:01 +02:00
Ralf Wisser 8aaf79ccfb set auto-commit to false on PostgreSQL 2019-06-13 13:34:51 +02:00
Ralf Wisser cecf21fd9f release notes update 2019-06-13 11:41:20 +02:00
Ralf Wisser ce8e221c16 catch SQLException 2019-06-13 11:41:03 +02:00
Ralf Wisser 1b3d8d8ec4 8.7.2.1 2019-06-13 10:42:30 +02:00
Ralf Wisser bba3ce5775 release notes update 2019-06-13 10:42:12 +02:00
Ralf Wisser df6dccdc83 aligned label 2019-06-13 10:39:30 +02:00
Ralf Wisser 1a37c3f3ed prevent OOM on PostgreSQL 2019-06-13 10:32:43 +02:00
Ralf Wisser ef94d823a6 don't modify table name 2019-06-13 09:35:38 +02:00
Ralf Wisser 1689825933 continue analyzing if getPrimaryKey fails 2019-06-13 08:59:45 +02:00
Ralf Wisser 918c4b0e4f improved SQL formatter 2019-06-12 07:41:17 +02:00
Ralf Wisser 361956428a improved formatting 2019-06-12 07:06:14 +02:00
ralfw 9badf1aab4 prepared next release notes 2019-06-06 16:54:21 +02:00
ralfw 6c4199a297 added TODO 2019-06-06 16:43:01 +02:00
ralfw de906c50ab 8.7.2.0 2019-06-06 15:45:19 +02:00
ralfw a376678736 8.7.2 2019-06-06 15:30:20 +02:00
Ralf Wisser b4be86aaf6 release notes update 2019-06-06 14:53:08 +02:00
Ralf Wisser d99b8032c8 retry storing file max 4 times 2019-06-06 14:16:14 +02:00
Ralf Wisser f4d2a32482 select table on double click 2019-06-06 13:36:04 +02:00
Ralf Wisser b03cecf727 limit height 2019-06-06 13:05:12 +02:00
Ralf Wisser ae162cee64 release notes update 2019-06-06 12:38:47 +02:00
Ralf Wisser 4d6437f144 removed shutdown hook 2019-06-06 12:34:27 +02:00
Ralf Wisser 58c48e26ab added shutdown hook 2019-06-06 12:34:10 +02:00
Ralf Wisser 722ebbd6ae scroll display s.t. selected table becomes visible 2019-06-06 11:39:31 +02:00
Ralf Wisser 16d2a00cab added search button for root table combobox 2019-06-05 14:39:48 +02:00
Ralf Wisser 2dab65a6a8 UI improvements 2019-06-05 14:39:48 +02:00
ralfw 15c0fd3214 8.7.1.0 2019-06-04 15:47:17 +02:00
ralfw 46dcbc0516 8.7.1 2019-06-04 15:34:42 +02:00
Ralf Wisser 1de182ed90 8.7.0.2 2019-06-04 10:08:22 +02:00
Ralf Wisser 892c0d2c3c UIM-Cnt 2019-06-04 10:07:56 +02:00
Ralf Wisser 736c1bb8f9 8.7.0.1 2019-06-03 12:58:29 +02:00
Ralf Wisser 7b530a5a66 release notes update 2019-06-03 12:58:09 +02:00
Ralf Wisser 164dfea1c7 reduced tooltip size 2019-06-03 12:24:20 +02:00
Ralf Wisser 5fa06f446f add missing edges 2019-06-03 11:18:38 +02:00
Ralf Wisser 594cd0393d made SQL Console robust against outdated metadata 2019-05-24 11:34:46 +02:00
Ralf Wisser 9b2d7e9a7b Merge branch 'master' of https://github.com/Wisser/Jailer.git 2019-05-24 11:30:45 +02:00
Ralf Wisser 7152107712 print stacktraces 2019-05-24 09:42:23 +02:00
Ralf Wisser 02690f41be prevent NPE 2019-05-24 09:41:46 +02:00
ralfw 33e6944a73 8.7.0.0 2019-05-21 15:47:45 +02:00
ralfw 122f71f02d 8.7 2019-05-21 15:34:17 +02:00
Ralf Wisser 7257700b44 8.6.3.3 2019-05-21 08:06:06 +02:00
Ralf Wisser 9f45305ca7 release notes update 2019-05-21 08:02:48 +02:00
Ralf Wisser 8bd5a133a5 sort lines of data model files 2019-05-21 07:41:41 +02:00
ralfw bf6050d50e made dummy labels invisible 2019-05-20 16:17:06 +02:00
Ralf Wisser a8a173024d replaced find button 2019-05-20 14:14:13 +02:00
Ralf Wisser 169fcc8df9 place searchPanel on left side 2019-05-20 14:10:29 +02:00
Ralf Wisser 40708ae74e use ToggleButtons 2019-05-20 13:59:20 +02:00
Ralf Wisser 0627a68e73 use JToggleButton 2019-05-20 13:24:08 +02:00
Ralf Wisser ad668107b0 added tool tip 2019-05-20 11:42:50 +02:00
Ralf Wisser a82239ec38 this is owner of StringSearchPanel 2019-05-20 11:42:31 +02:00
Ralf Wisser d862dbe790 fixed NPE 2019-05-20 11:41:08 +02:00
Ralf Wisser d45b61e131 added tool tip 2019-05-20 11:39:26 +02:00
Ralf Wisser f65962cc5a removed obsolete code 2019-05-20 10:17:37 +02:00
Ralf Wisser d608eb4d58 Modal dialogues were replaced by non-modal ones 2019-05-20 10:08:46 +02:00
Ralf Wisser 649fd0a75c release notes update 2019-05-16 07:39:14 +02:00
Ralf Wisser 7c858b3a5e minor UI improvements 2019-05-16 07:18:18 +02:00
Ralf Wisser 1753898629 8.6.3.1 2019-05-10 06:33:48 +02:00
Ralf Wisser c4683bb77f removed QA 331 2019-05-10 06:33:17 +02:00
ralfw cd5aa81c13 8.6.3.0 2019-05-09 15:37:10 +02:00
ralfw 6831c0eb92 8.6.3 2019-05-09 15:26:03 +02:00
Ralf Wisser d371492e6c prevent NPE 2019-05-09 07:46:18 +02:00
Ralf Wisser 50bc5de77b get class directly 2019-05-09 07:45:37 +02:00
Ralf Wisser 11c9be978a new menu item "insert child" 2019-05-09 07:12:55 +02:00
Ralf Wisser a4e543c8e7 QA 331 2019-05-09 07:12:06 +02:00
Ralf Wisser 18e9afb2e4 release notes update 2019-05-08 13:27:54 +02:00
Ralf Wisser 934228a82d fixed condition 2019-05-08 12:51:26 +02:00
Ralf Wisser c62b9540f1 stage label blinks during cleanup 2019-05-08 08:09:10 +02:00
Ralf Wisser 6faa3423b4 count at most once per table 2019-05-06 10:41:09 +02:00
ralfw 189dd83fb8 8.6.2.0 2019-05-03 15:40:46 +02:00
Ralf Wisser e7e5073b6d sort file content 2019-05-03 14:38:55 +02:00
Ralf Wisser 89600dc88c Unified headings 2019-05-03 14:07:59 +02:00
Ralf Wisser e21a53bc16 Merge branch 'master' of https://github.com/Wisser/Jailer.git 2019-05-03 12:11:50 +02:00
Ralf Wisser a330414c1a fixed estimatedRowCountQuery for MySQL 2019-05-03 08:37:48 +02:00
ralfw edd6bbe2a1 8.6.2 2019-05-02 15:43:31 +02:00
Ralf Wisser e19ed43a90 prevent NPE 2019-05-02 08:03:39 +02:00
Ralf Wisser 014f434734 Fixed "ERROR: failed to find conversion function from unknown to text" 2019-05-02 07:13:56 +02:00
ralfw 9d5e4a74cb 8.6.1.0 2019-04-30 16:24:21 +02:00
ralfw 1296e0d6e1 8.6.1 2019-04-30 16:10:36 +02:00
Ralf Wisser a586421d25 release notes update 2019-04-30 09:23:53 +02:00
Ralf Wisser 1eba21a1ed Fixed "ERROR: failed to find conversion function from unknown to text" 2019-04-30 09:18:45 +02:00
Ralf Wisser f1403b7dcf increased version 2019-04-25 12:46:11 +02:00
Ralf Wisser 2b5b38b2a9 release notes update 2019-04-25 12:31:40 +02:00
Ralf Wisser cd73432a66 Merge branch 'master' of https://github.com/Wisser/Jailer.git 2019-04-25 12:31:10 +02:00
Ralf Wisser 5ca97fb800 View execution plans for DB2 LUW 2019-04-25 12:30:57 +02:00
ralfw 548bb7d5df interim version 2019-04-16 15:59:15 +02:00
ralfw 3ff03cdd91 8.6 2019-04-16 15:34:16 +02:00
Ralf Wisser 01f38a055c added mssql-jdbc-7.2.1.jre8.jar 2019-04-16 12:23:02 +02:00
Ralf Wisser 41bedb3027 new 2019-04-16 12:20:54 +02:00
Ralf Wisser 9c9a90b969 release notes update 2019-04-16 08:02:02 +02:00
Ralf Wisser fcb4acd3d5 reconnect when the connection is lost 2019-04-16 07:50:17 +02:00
Ralf Wisser e1ad0d356a reorganized imports 2019-04-15 14:46:51 +02:00
Ralf Wisser 1efe4d1b8d fail-fast if reconnecting fails 2019-04-15 14:44:11 +02:00
Ralf Wisser 616530507f send issue if connection becomes invalid 2019-04-15 12:44:59 +02:00
Ralf Wisser 66469eb0b8 increased version 2019-04-15 11:24:18 +02:00
Ralf Wisser 56fdff7bf4 "reconnect If Connection Is Invalid" in data browser 2019-04-15 11:23:49 +02:00
ralfw 804d85892a 8.5.6 2019-04-11 15:30:38 +02:00
Ralf Wisser a1e471c251 removed dead store 2019-04-11 14:38:51 +02:00
Ralf Wisser 9c091de37a QA 331 2019-04-11 14:16:36 +02:00
Ralf Wisser 9f72bf5124 release notes update 2019-04-10 14:10:33 +02:00
Ralf Wisser 11162a5fcb count associations 2019-04-10 14:10:06 +02:00
Ralf Wisser b37845724c increased version 2019-04-10 11:58:38 +02:00
Ralf Wisser a13cf014f9 iterate over all columns 2019-04-10 11:58:20 +02:00
Ralf Wisser 87839c45ab release notes update 2019-04-05 10:21:16 +02:00
Ralf Wisser 625aa8c8dd QA 331 2019-04-05 10:20:27 +02:00
ralfw e104053988 increased version 2019-03-30 06:24:37 +01:00
ralfw ab293108f9 8.5.4 2019-03-29 15:27:16 +01:00
Ralf Wisser 14a6f8005a count bookmarks 2019-03-29 13:03:00 +01:00
Ralf Wisser 7effdb5088 tablesComboBox.setMaximumRowCount(20); 2019-03-29 12:55:45 +01:00
Ralf Wisser 0d62e75b94 removed reflection stuff 2019-03-29 11:08:37 +01:00
Ralf Wisser d9888cc188 hide "sort columns" panel if layout mode < SMALL 2019-03-29 10:54:37 +01:00
Ralf Wisser bae615523f don't delete file, just overwrite 2019-03-29 07:07:36 +01:00
Ralf Wisser 6b0d541a67 prevent unnecessary menu updates 2019-03-29 07:06:56 +01:00
Ralf Wisser 4129a63fec release notes update 2019-03-28 14:41:37 +01:00
Ralf Wisser 0eb34d6040 prevent unnecessary menu updates 2019-03-28 14:39:59 +01:00
Ralf Wisser 686064d1be organized imports 2019-03-28 13:24:27 +01:00
Ralf Wisser 6c4bc539b1 count rebases 2019-03-28 13:23:04 +01:00
Ralf Wisser 379b8c7a10 release notes update 2019-03-28 09:41:02 +01:00
Ralf Wisser 4e5af9889d new feature "start navigation here" 2019-03-28 09:38:46 +01:00
289 changed files with 7495 additions and 2185 deletions
+6
View File
@@ -59,3 +59,9 @@ rm $1.zip
zip -r jailer_$1.zip jailer
cp -r jailer dbeauty
zip -r dbeauty_$1.zip dbeauty
# Web upload
# cd docs
# scp -r * rwisser,jailer@web.sf.net:/home/groups/j/ja/jailer/htdocs/
# scp -r * rwisser,jailer@web.sf.net:/home/groups/j/ja/jailer/htdocs/doc/
-19
View File
@@ -1,19 +0,0 @@
rm -rf ~/tmp/jailer
rm -rf ~/tmp/1
rm -rf ~/tmp/1.co
mkdir ~/tmp/jailer
mkdir ~/tmp/1
mkdir ~/tmp/1.co
cd ~/tmp/1.co
svn checkout --username=rwisser https://svn.code.sf.net/p/jailer/code/trunk/docs jailer-code
cd ..
mv 1.co/jailer-code/* jailer
cd jailer
cp home.htm index.html
find -iname ".svn" -exec rm -rf '{}' \;
find -iname ".cvs*" -exec rm -rf '{}' \;
scp -r * rwisser,jailer@web.sf.net:/home/groups/j/ja/jailer/htdocs/
scp -r * rwisser,jailer@web.sf.net:/home/groups/j/ja/jailer/htdocs/doc/
+3 -3
View File
@@ -1,14 +1,14 @@
# Table A; Table B; First-insert; Cardinality; Join-condition; Name; Author
# Table A; Table B; First-insert; Cardinality (opt); Join-condition; Name; Author
ADDRESS; CITY; B; n:1; A.CITY_ID=B.CITY_ID; FK_ADDRESS_CITY; H2 JDBC Driver; ;
CITY; COUNTRY; B; n:1; A.COUNTRY_ID=B.COUNTRY_ID; FK_CITY_COUNTRY; H2 JDBC Driver; ;
CUSTOMER; ADDRESS; B; n:1; A.ADDRESS_ID=B.ADDRESS_ID; FK_CUSTOMER_ADDRESS; H2 JDBC Driver; ;
CUSTOMER; STORE; B; n:1; A.STORE_ID=B.STORE_ID; FK_CUSTOMER_STORE; H2 JDBC Driver; ;
FILM; "LANGUAGE"; B; n:1; A.LANGUAGE_ID=B.LANGUAGE_ID; FK_FILM_LANGUAGE; H2 JDBC Driver; ;
FILM; "LANGUAGE"; B; n:1; A.ORIGINAL_LANGUAGE_ID=B.LANGUAGE_ID; FK_FILM_LANGUAGE_ORIGINAL; H2 JDBC Driver; ;
FILM_ACTOR; ACTOR; B; n:1; A.ACTOR_ID=B.ACTOR_ID; FK_FILM_ACTOR_ACTOR; H2 JDBC Driver; ;
FILM_ACTOR; FILM; B; n:1; A.FILM_ID=B.FILM_ID; FK_FILM_ACTOR_FILM; H2 JDBC Driver; ;
FILM_CATEGORY; CATEGORY; B; n:1; A.CATEGORY_ID=B.CATEGORY_ID; FK_FILM_CATEGORY_CATEGORY; H2 JDBC Driver; ;
FILM_CATEGORY; FILM; B; n:1; A.FILM_ID=B.FILM_ID; FK_FILM_CATEGORY_FILM; H2 JDBC Driver; ;
FILM; LANGUAGE; B; n:1; A.LANGUAGE_ID=B.LANGUAGE_ID; FK_FILM_LANGUAGE; H2 JDBC Driver; ;
FILM; LANGUAGE; B; n:1; A.ORIGINAL_LANGUAGE_ID=B.LANGUAGE_ID; FK_FILM_LANGUAGE_ORIGINAL; H2 JDBC Driver; ;
INVENTORY; FILM; B; n:1; A.FILM_ID=B.FILM_ID; FK_INVENTORY_FILM; H2 JDBC Driver; ;
INVENTORY; STORE; B; n:1; A.STORE_ID=B.STORE_ID; FK_INVENTORY_STORE; H2 JDBC Driver; ;
PAYMENT; CUSTOMER; B; n:1; A.CUSTOMER_ID=B.CUSTOMER_ID; FK_PAYMENT_CUSTOMER; H2 JDBC Driver; ;
1 # Table A # Table A; Table B; First-insert; Cardinality (opt); Join-condition; Name; Author Table B First-insert Cardinality Join-condition Name Author
2 ADDRESS ADDRESS; CITY; B; n:1; A.CITY_ID=B.CITY_ID; FK_ADDRESS_CITY; H2 JDBC Driver; ; CITY B n:1 A.CITY_ID=B.CITY_ID FK_ADDRESS_CITY H2 JDBC Driver
3 CITY CITY; COUNTRY; B; n:1; A.COUNTRY_ID=B.COUNTRY_ID; FK_CITY_COUNTRY; H2 JDBC Driver; ; COUNTRY B n:1 A.COUNTRY_ID=B.COUNTRY_ID FK_CITY_COUNTRY H2 JDBC Driver
4 CUSTOMER CUSTOMER; ADDRESS; B; n:1; A.ADDRESS_ID=B.ADDRESS_ID; FK_CUSTOMER_ADDRESS; H2 JDBC Driver; ; ADDRESS B n:1 A.ADDRESS_ID=B.ADDRESS_ID FK_CUSTOMER_ADDRESS H2 JDBC Driver
5 CUSTOMER CUSTOMER; STORE; B; n:1; A.STORE_ID=B.STORE_ID; FK_CUSTOMER_STORE; H2 JDBC Driver; ; STORE B n:1 A.STORE_ID=B.STORE_ID FK_CUSTOMER_STORE H2 JDBC Driver
FILM LANGUAGE B n:1 A.LANGUAGE_ID=B.LANGUAGE_ID FK_FILM_LANGUAGE H2 JDBC Driver
FILM LANGUAGE B n:1 A.ORIGINAL_LANGUAGE_ID=B.LANGUAGE_ID FK_FILM_LANGUAGE_ORIGINAL H2 JDBC Driver
6 FILM_ACTOR FILM_ACTOR; ACTOR; B; n:1; A.ACTOR_ID=B.ACTOR_ID; FK_FILM_ACTOR_ACTOR; H2 JDBC Driver; ; ACTOR B n:1 A.ACTOR_ID=B.ACTOR_ID FK_FILM_ACTOR_ACTOR H2 JDBC Driver
7 FILM_ACTOR FILM_ACTOR; FILM; B; n:1; A.FILM_ID=B.FILM_ID; FK_FILM_ACTOR_FILM; H2 JDBC Driver; ; FILM B n:1 A.FILM_ID=B.FILM_ID FK_FILM_ACTOR_FILM H2 JDBC Driver
8 FILM_CATEGORY FILM_CATEGORY; CATEGORY; B; n:1; A.CATEGORY_ID=B.CATEGORY_ID; FK_FILM_CATEGORY_CATEGORY; H2 JDBC Driver; ; CATEGORY B n:1 A.CATEGORY_ID=B.CATEGORY_ID FK_FILM_CATEGORY_CATEGORY H2 JDBC Driver
9 FILM_CATEGORY FILM_CATEGORY; FILM; B; n:1; A.FILM_ID=B.FILM_ID; FK_FILM_CATEGORY_FILM; H2 JDBC Driver; ; FILM B n:1 A.FILM_ID=B.FILM_ID FK_FILM_CATEGORY_FILM H2 JDBC Driver
10 FILM; LANGUAGE; B; n:1; A.LANGUAGE_ID=B.LANGUAGE_ID; FK_FILM_LANGUAGE; H2 JDBC Driver; ;
11 FILM; LANGUAGE; B; n:1; A.ORIGINAL_LANGUAGE_ID=B.LANGUAGE_ID; FK_FILM_LANGUAGE_ORIGINAL; H2 JDBC Driver; ;
12 INVENTORY INVENTORY; FILM; B; n:1; A.FILM_ID=B.FILM_ID; FK_INVENTORY_FILM; H2 JDBC Driver; ; FILM B n:1 A.FILM_ID=B.FILM_ID FK_INVENTORY_FILM H2 JDBC Driver
13 INVENTORY INVENTORY; STORE; B; n:1; A.STORE_ID=B.STORE_ID; FK_INVENTORY_STORE; H2 JDBC Driver; ; STORE B n:1 A.STORE_ID=B.STORE_ID FK_INVENTORY_STORE H2 JDBC Driver
14 PAYMENT PAYMENT; CUSTOMER; B; n:1; A.CUSTOMER_ID=B.CUSTOMER_ID; FK_PAYMENT_CUSTOMER; H2 JDBC Driver; ; CUSTOMER B n:1 A.CUSTOMER_ID=B.CUSTOMER_ID FK_PAYMENT_CUSTOMER H2 JDBC Driver
+9 -9
View File
@@ -1,17 +1,17 @@
# Table; Columns
"LANGUAGE"; LANGUAGE_ID SMALLINT; NAME CHAR(20); LAST_UPDATE TIMESTAMP; ;
ACTOR; ACTOR_ID DECIMAL(65535, 32767); FIRST_NAME VARCHAR(45); LAST_NAME VARCHAR(45); LAST_UPDATE TIMESTAMP; ;
ADDRESS; ADDRESS_ID INTEGER; ADDRESS VARCHAR(50); ADDRESS2 VARCHAR(50); DISTRICT VARCHAR(20); CITY_ID INTEGER; POSTAL_CODE VARCHAR(10); PHONE VARCHAR(20); LAST_UPDATE TIMESTAMP; ;
ADDRESS; ADDRESS_ID INTEGER; ADDRESS VARCHAR(50); ADDRESS2 VARCHAR(50) null; DISTRICT VARCHAR(20); CITY_ID INTEGER; POSTAL_CODE VARCHAR(10) null; PHONE VARCHAR(20); LAST_UPDATE TIMESTAMP; ;
CATEGORY; CATEGORY_ID SMALLINT; NAME VARCHAR(25); LAST_UPDATE TIMESTAMP; ;
CITY; CITY_ID INTEGER; CITY VARCHAR(50); COUNTRY_ID SMALLINT; LAST_UPDATE TIMESTAMP; ;
COUNTRY; COUNTRY_ID SMALLINT; COUNTRY VARCHAR(50); LAST_UPDATE TIMESTAMP; ;
CUSTOMER; CUSTOMER_ID INTEGER; STORE_ID INTEGER; FIRST_NAME VARCHAR(45); LAST_NAME VARCHAR(45); EMAIL VARCHAR(50); ADDRESS_ID INTEGER; ACTIVE CHAR(1); CREATE_DATE TIMESTAMP; LAST_UPDATE TIMESTAMP; ;
FILM; FILM_ID INTEGER; TITLE VARCHAR(255); DESCRIPTION VARCHAR(255); RELEASE_YEAR VARCHAR(4); LANGUAGE_ID SMALLINT; ORIGINAL_LANGUAGE_ID SMALLINT; RENTAL_DURATION SMALLINT; RENTAL_RATE DECIMAL(4, 2); LENGTH SMALLINT; REPLACEMENT_COST DECIMAL(5, 2); RATING VARCHAR(10); SPECIAL_FEATURES VARCHAR(100); LAST_UPDATE TIMESTAMP; ;
COUNTRY; COUNTRY_ID SMALLINT; COUNTRY VARCHAR(50); LAST_UPDATE TIMESTAMP null; ;
CUSTOMER; CUSTOMER_ID INTEGER; STORE_ID INTEGER; FIRST_NAME VARCHAR(45); LAST_NAME VARCHAR(45); EMAIL VARCHAR(50) null; ADDRESS_ID INTEGER; ACTIVE VARCHAR(1); CREATE_DATE TIMESTAMP; LAST_UPDATE TIMESTAMP; ;
FILM; FILM_ID INTEGER; TITLE VARCHAR(255); DESCRIPTION VARCHAR(255) null; RELEASE_YEAR VARCHAR(4) null; LANGUAGE_ID SMALLINT; ORIGINAL_LANGUAGE_ID SMALLINT null; RENTAL_DURATION SMALLINT; RENTAL_RATE DECIMAL(4, 2); LENGTH SMALLINT null; REPLACEMENT_COST DECIMAL(5, 2); RATING VARCHAR(10) null; SPECIAL_FEATURES VARCHAR(100) null; LAST_UPDATE TIMESTAMP; ;
FILM_ACTOR; ACTOR_ID INTEGER; FILM_ID INTEGER; LAST_UPDATE TIMESTAMP; ;
FILM_CATEGORY; FILM_ID INTEGER; CATEGORY_ID SMALLINT; LAST_UPDATE TIMESTAMP; ;
FILM_TEXT; FILM_ID SMALLINT; TITLE VARCHAR(255); DESCRIPTION VARCHAR(255); ;
FILM_TEXT; FILM_ID SMALLINT; TITLE VARCHAR(255); DESCRIPTION VARCHAR(255) null; ;
INVENTORY; INVENTORY_ID INTEGER; FILM_ID INTEGER; STORE_ID INTEGER; LAST_UPDATE TIMESTAMP; ;
PAYMENT; PAYMENT_ID INTEGER; CUSTOMER_ID INTEGER; STAFF_ID SMALLINT; RENTAL_ID INTEGER; AMOUNT DECIMAL(5, 2); PAYMENT_DATE TIMESTAMP; LAST_UPDATE TIMESTAMP; ;
RENTAL; RENTAL_ID INTEGER; RENTAL_DATE TIMESTAMP; INVENTORY_ID INTEGER; CUSTOMER_ID INTEGER; RETURN_DATE TIMESTAMP; STAFF_ID SMALLINT; LAST_UPDATE TIMESTAMP; ;
STAFF; STAFF_ID SMALLINT; FIRST_NAME VARCHAR(45); LAST_NAME VARCHAR(45); ADDRESS_ID INTEGER; PICTURE BLOB; EMAIL VARCHAR(50); STORE_ID INTEGER; ACTIVE SMALLINT; USERNAME VARCHAR(16); PASSWORD VARCHAR(40); LAST_UPDATE TIMESTAMP; ;
LANGUAGE; LANGUAGE_ID SMALLINT; NAME VARCHAR(20); LAST_UPDATE TIMESTAMP; ;
PAYMENT; PAYMENT_ID INTEGER; CUSTOMER_ID INTEGER; STAFF_ID SMALLINT; RENTAL_ID INTEGER null; AMOUNT DECIMAL(5, 2); PAYMENT_DATE TIMESTAMP; LAST_UPDATE TIMESTAMP; ;
RENTAL; RENTAL_ID INTEGER; RENTAL_DATE TIMESTAMP; INVENTORY_ID INTEGER; CUSTOMER_ID INTEGER; RETURN_DATE TIMESTAMP null; STAFF_ID SMALLINT; LAST_UPDATE TIMESTAMP; ;
STAFF; STAFF_ID SMALLINT; FIRST_NAME VARCHAR(45); LAST_NAME VARCHAR(45); ADDRESS_ID INTEGER; PICTURE BLOB null; EMAIL VARCHAR(50) null; STORE_ID INTEGER; ACTIVE SMALLINT; USERNAME VARCHAR(16); PASSWORD VARCHAR(40) null; LAST_UPDATE TIMESTAMP; ;
STORE; STORE_ID INTEGER; MANAGER_STAFF_ID SMALLINT; ADDRESS_ID INTEGER; LAST_UPDATE TIMESTAMP; ;
1 # Table # Table; Columns Columns
LANGUAGE LANGUAGE_ID SMALLINT
2 ACTOR ACTOR; ACTOR_ID DECIMAL(65535, 32767); FIRST_NAME VARCHAR(45); LAST_NAME VARCHAR(45); LAST_UPDATE TIMESTAMP; ; ACTOR_ID DECIMAL(65535, 32767)
3 ADDRESS ADDRESS; ADDRESS_ID INTEGER; ADDRESS VARCHAR(50); ADDRESS2 VARCHAR(50) null; DISTRICT VARCHAR(20); CITY_ID INTEGER; POSTAL_CODE VARCHAR(10) null; PHONE VARCHAR(20); LAST_UPDATE TIMESTAMP; ; ADDRESS_ID INTEGER
4 CATEGORY CATEGORY; CATEGORY_ID SMALLINT; NAME VARCHAR(25); LAST_UPDATE TIMESTAMP; ; CATEGORY_ID SMALLINT
5 CITY CITY; CITY_ID INTEGER; CITY VARCHAR(50); COUNTRY_ID SMALLINT; LAST_UPDATE TIMESTAMP; ; CITY_ID INTEGER
6 COUNTRY COUNTRY; COUNTRY_ID SMALLINT; COUNTRY VARCHAR(50); LAST_UPDATE TIMESTAMP null; ; COUNTRY_ID SMALLINT
7 CUSTOMER CUSTOMER; CUSTOMER_ID INTEGER; STORE_ID INTEGER; FIRST_NAME VARCHAR(45); LAST_NAME VARCHAR(45); EMAIL VARCHAR(50) null; ADDRESS_ID INTEGER; ACTIVE VARCHAR(1); CREATE_DATE TIMESTAMP; LAST_UPDATE TIMESTAMP; ; CUSTOMER_ID INTEGER
8 FILM FILM; FILM_ID INTEGER; TITLE VARCHAR(255); DESCRIPTION VARCHAR(255) null; RELEASE_YEAR VARCHAR(4) null; LANGUAGE_ID SMALLINT; ORIGINAL_LANGUAGE_ID SMALLINT null; RENTAL_DURATION SMALLINT; RENTAL_RATE DECIMAL(4, 2); LENGTH SMALLINT null; REPLACEMENT_COST DECIMAL(5, 2); RATING VARCHAR(10) null; SPECIAL_FEATURES VARCHAR(100) null; LAST_UPDATE TIMESTAMP; ; FILM_ID INTEGER
9 FILM_ACTOR FILM_ACTOR; ACTOR_ID INTEGER; FILM_ID INTEGER; LAST_UPDATE TIMESTAMP; ; ACTOR_ID INTEGER
10 FILM_CATEGORY FILM_CATEGORY; FILM_ID INTEGER; CATEGORY_ID SMALLINT; LAST_UPDATE TIMESTAMP; ; FILM_ID INTEGER
11 FILM_TEXT FILM_TEXT; FILM_ID SMALLINT; TITLE VARCHAR(255); DESCRIPTION VARCHAR(255) null; ; FILM_ID SMALLINT
12 INVENTORY INVENTORY; INVENTORY_ID INTEGER; FILM_ID INTEGER; STORE_ID INTEGER; LAST_UPDATE TIMESTAMP; ; INVENTORY_ID INTEGER
13 PAYMENT LANGUAGE; LANGUAGE_ID SMALLINT; NAME VARCHAR(20); LAST_UPDATE TIMESTAMP; ; PAYMENT_ID INTEGER
14 RENTAL PAYMENT; PAYMENT_ID INTEGER; CUSTOMER_ID INTEGER; STAFF_ID SMALLINT; RENTAL_ID INTEGER null; AMOUNT DECIMAL(5, 2); PAYMENT_DATE TIMESTAMP; LAST_UPDATE TIMESTAMP; ; RENTAL_ID INTEGER
15 STAFF RENTAL; RENTAL_ID INTEGER; RENTAL_DATE TIMESTAMP; INVENTORY_ID INTEGER; CUSTOMER_ID INTEGER; RETURN_DATE TIMESTAMP null; STAFF_ID SMALLINT; LAST_UPDATE TIMESTAMP; ; STAFF_ID SMALLINT
16 STAFF; STAFF_ID SMALLINT; FIRST_NAME VARCHAR(45); LAST_NAME VARCHAR(45); ADDRESS_ID INTEGER; PICTURE BLOB null; EMAIL VARCHAR(50) null; STORE_ID INTEGER; ACTIVE SMALLINT; USERNAME VARCHAR(16); PASSWORD VARCHAR(40) null; LAST_UPDATE TIMESTAMP; ;
17 STORE STORE; STORE_ID INTEGER; MANAGER_STAFF_ID SMALLINT; ADDRESS_ID INTEGER; LAST_UPDATE TIMESTAMP; ; STORE_ID INTEGER
+1 -1
View File
@@ -1,2 +1,2 @@
# name; last modification
Demo-Sakila;
Demo Sakila (16 Tables);
1 # name last modification
2 Demo-Sakila Demo Sakila (16 Tables)
+2 -2
View File
@@ -1,5 +1,4 @@
# Name; Upsert; Primary key; ; Author
"LANGUAGE"; N; LANGUAGE_ID SMALLINT; ; H2 JDBC Driver; ;
# Name; Upsert; Primary Key; ; Author
ACTOR; N; ACTOR_ID DECIMAL(65535, 32767); ; H2 JDBC Driver; ;
ADDRESS; N; ADDRESS_ID INTEGER; ; H2 JDBC Driver; ;
CATEGORY; N; CATEGORY_ID SMALLINT; ; H2 JDBC Driver; ;
@@ -11,6 +10,7 @@ FILM_ACTOR; N; ACTOR_ID INTEGER; FILM_ID INTEGER; ; H2 JDBC Driver; ;
FILM_CATEGORY; N; FILM_ID INTEGER; CATEGORY_ID SMALLINT; ; H2 JDBC Driver; ;
FILM_TEXT; N; FILM_ID SMALLINT; ; H2 JDBC Driver; ;
INVENTORY; N; INVENTORY_ID INTEGER; ; H2 JDBC Driver; ;
LANGUAGE; N; LANGUAGE_ID SMALLINT; ; H2 JDBC Driver; ;
PAYMENT; N; PAYMENT_ID INTEGER; ; H2 JDBC Driver; ;
RENTAL; N; RENTAL_ID INTEGER; ; H2 JDBC Driver; ;
STAFF; N; STAFF_ID SMALLINT; ; H2 JDBC Driver; ;
1 # Name # Name; Upsert; Primary Key; ; Author Upsert Primary key Author
LANGUAGE N LANGUAGE_ID SMALLINT H2 JDBC Driver
2 ACTOR ACTOR; N; ACTOR_ID DECIMAL(65535, 32767); ; H2 JDBC Driver; ; N ACTOR_ID DECIMAL(65535, 32767) H2 JDBC Driver
3 ADDRESS ADDRESS; N; ADDRESS_ID INTEGER; ; H2 JDBC Driver; ; N ADDRESS_ID INTEGER H2 JDBC Driver
4 CATEGORY CATEGORY; N; CATEGORY_ID SMALLINT; ; H2 JDBC Driver; ; N CATEGORY_ID SMALLINT H2 JDBC Driver
10 FILM_CATEGORY FILM_CATEGORY; N; FILM_ID INTEGER; CATEGORY_ID SMALLINT; ; H2 JDBC Driver; ; N FILM_ID INTEGER CATEGORY_ID SMALLINT
11 FILM_TEXT FILM_TEXT; N; FILM_ID SMALLINT; ; H2 JDBC Driver; ; N FILM_ID SMALLINT H2 JDBC Driver
12 INVENTORY INVENTORY; N; INVENTORY_ID INTEGER; ; H2 JDBC Driver; ; N INVENTORY_ID INTEGER H2 JDBC Driver
13 LANGUAGE; N; LANGUAGE_ID SMALLINT; ; H2 JDBC Driver; ;
14 PAYMENT PAYMENT; N; PAYMENT_ID INTEGER; ; H2 JDBC Driver; ; N PAYMENT_ID INTEGER H2 JDBC Driver
15 RENTAL RENTAL; N; RENTAL_ID INTEGER; ; H2 JDBC Driver; ; N RENTAL_ID INTEGER H2 JDBC Driver
16 STAFF STAFF; N; STAFF_ID SMALLINT; ; H2 JDBC Driver; ; N STAFF_ID SMALLINT H2 JDBC Driver
+1 -1
View File
@@ -1 +1 @@
7.2.2
8.7.5
1 7.2.2 8.7.5
+3 -3
View File
@@ -1,8 +1,8 @@
# Table A; Table B; First-insert; Cardinality; Join-condition; Name; Author
# Table A; Table B; First-insert; Cardinality (opt); Join-condition; Name; Author
EMPLOYEE; BONUS; ; 1:1; A.NAME=B.ENAME and A.JOB=B.JOB; BONUS; Demo; ;
EMPLOYEE; DEPARTMENT; B; n:1; A.DEPTNO=B.DEPTNO; DEPARTMENT; Demo; ;
EMPLOYEE; EMPLOYEE; B; n:1; A.BOSS=B.EMPNO; BOSS; Demo; ;
EMPLOYEE; SALARYGRADE; ; n:1; A.SALARY BETWEEN B.LOSAL and B.HISAL; SALARY; Demo; ;
EMPLOYEE; DEPARTMENT; B; n:1; A.DEPTNO=B.DEPTNO; DEPARTMENT; Demo; ;
PROJECT_PARTICIPATION; EMPLOYEE; B; n:1; A.EMPNO=B.EMPNO; EMPLOYEE; Demo; ;
PROJECT_PARTICIPATION; PROJECT; B; n:1; A.PROJECTNO=B.PROJECTNO; PROJECT; Demo; ;
PROJECT_PARTICIPATION; ROLE; B; n:1; A.ROLE_ID=B.ROLE_ID; ROLE; Demo; ;
EMPLOYEE; SALARYGRADE; ; n:1; A.SALARY BETWEEN B.LOSAL and B.HISAL; SALARY; Demo; ;
1 # Table A; Table B; First-insert; Cardinality; Join-condition; Name; Author # Table A; Table B; First-insert; Cardinality (opt); Join-condition; Name; Author
2 EMPLOYEE; BONUS; ; 1:1; A.NAME=B.ENAME and A.JOB=B.JOB; BONUS; Demo; ; EMPLOYEE; BONUS; ; 1:1; A.NAME=B.ENAME and A.JOB=B.JOB; BONUS; Demo; ;
EMPLOYEE; DEPARTMENT; B; n:1; A.DEPTNO=B.DEPTNO; DEPARTMENT; Demo; ;
3 EMPLOYEE; EMPLOYEE; B; n:1; A.BOSS=B.EMPNO; BOSS; Demo; ; EMPLOYEE; EMPLOYEE; B; n:1; A.BOSS=B.EMPNO; BOSS; Demo; ;
4 EMPLOYEE; SALARYGRADE; ; n:1; A.SALARY BETWEEN B.LOSAL and B.HISAL; SALARY; Demo; ; EMPLOYEE; DEPARTMENT; B; n:1; A.DEPTNO=B.DEPTNO; DEPARTMENT; Demo; ;
5 PROJECT_PARTICIPATION; EMPLOYEE; B; n:1; A.EMPNO=B.EMPNO; EMPLOYEE; Demo; ; PROJECT_PARTICIPATION; EMPLOYEE; B; n:1; A.EMPNO=B.EMPNO; EMPLOYEE; Demo; ;
6 PROJECT_PARTICIPATION; PROJECT; B; n:1; A.PROJECTNO=B.PROJECTNO; PROJECT; Demo; ; PROJECT_PARTICIPATION; PROJECT; B; n:1; A.PROJECTNO=B.PROJECTNO; PROJECT; Demo; ;
7 PROJECT_PARTICIPATION; ROLE; B; n:1; A.ROLE_ID=B.ROLE_ID; ROLE; Demo; ; PROJECT_PARTICIPATION; ROLE; B; n:1; A.ROLE_ID=B.ROLE_ID; ROLE; Demo; ;
8 EMPLOYEE; SALARYGRADE; ; n:1; A.SALARY BETWEEN B.LOSAL and B.HISAL; SALARY; Demo; ;
+6 -6
View File
@@ -1,8 +1,8 @@
# Table; Columns
BONUS; ENAME VARCHAR(10); JOB VARCHAR(9); SAL DECIMAL(7, 2); COMM DECIMAL(7, 2); ;
DEPARTMENT; DEPTNO INTEGER; NAME VARCHAR(14); LOCATION VARCHAR(13); ;
EMPLOYEE; EMPNO INTEGER; NAME VARCHAR(10); JOB VARCHAR(9); BOSS INTEGER; HIREDATE VARCHAR(12); SALARY DECIMAL(7, 2); COMM DECIMAL(7, 2); DEPTNO INTEGER; ;
PROJECT; PROJECTNO INTEGER; DESCRIPTION VARCHAR(100); START_DATE VARCHAR(12); END_DATE VARCHAR(12); ;
PROJECT_PARTICIPATION; PROJECTNO INTEGER; EMPNO INTEGER; START_DATE VARCHAR(12); END_DATE VARCHAR(12); ROLE_ID INTEGER; ;
ROLE; ROLE_ID INTEGER; DESCRIPTION VARCHAR(100); ;
BONUS; ENAME VARCHAR(10); JOB VARCHAR(9); SAL DECIMAL(7, 2) null; COMM DECIMAL(7, 2) null; ;
DEPARTMENT; DEPTNO INTEGER; NAME VARCHAR(14) null; LOCATION VARCHAR(13) null; ;
EMPLOYEE; EMPNO INTEGER; NAME VARCHAR(10) null; JOB VARCHAR(9) null; BOSS INTEGER null; HIREDATE VARCHAR(12) null; SALARY DECIMAL(7, 2) null; COMM DECIMAL(7, 2) null; DEPTNO INTEGER null; ;
PROJECT; PROJECTNO INTEGER; DESCRIPTION VARCHAR(100) null; START_DATE VARCHAR(12) null; END_DATE VARCHAR(12) null; ;
PROJECT_PARTICIPATION; PROJECTNO INTEGER; EMPNO INTEGER; START_DATE VARCHAR(12); END_DATE VARCHAR(12) null; ROLE_ID INTEGER null; ;
ROLE; ROLE_ID INTEGER; DESCRIPTION VARCHAR(100) null; ;
SALARYGRADE; GRADE INTEGER; LOSAL INTEGER; HISAL INTEGER; ;
1 # Table; Columns
2 BONUS; ENAME VARCHAR(10); JOB VARCHAR(9); SAL DECIMAL(7, 2); COMM DECIMAL(7, 2); ; BONUS; ENAME VARCHAR(10); JOB VARCHAR(9); SAL DECIMAL(7, 2) null; COMM DECIMAL(7, 2) null; ;
3 DEPARTMENT; DEPTNO INTEGER; NAME VARCHAR(14); LOCATION VARCHAR(13); ; DEPARTMENT; DEPTNO INTEGER; NAME VARCHAR(14) null; LOCATION VARCHAR(13) null; ;
4 EMPLOYEE; EMPNO INTEGER; NAME VARCHAR(10); JOB VARCHAR(9); BOSS INTEGER; HIREDATE VARCHAR(12); SALARY DECIMAL(7, 2); COMM DECIMAL(7, 2); DEPTNO INTEGER; ; EMPLOYEE; EMPNO INTEGER; NAME VARCHAR(10) null; JOB VARCHAR(9) null; BOSS INTEGER null; HIREDATE VARCHAR(12) null; SALARY DECIMAL(7, 2) null; COMM DECIMAL(7, 2) null; DEPTNO INTEGER null; ;
5 PROJECT; PROJECTNO INTEGER; DESCRIPTION VARCHAR(100); START_DATE VARCHAR(12); END_DATE VARCHAR(12); ; PROJECT; PROJECTNO INTEGER; DESCRIPTION VARCHAR(100) null; START_DATE VARCHAR(12) null; END_DATE VARCHAR(12) null; ;
6 PROJECT_PARTICIPATION; PROJECTNO INTEGER; EMPNO INTEGER; START_DATE VARCHAR(12); END_DATE VARCHAR(12); ROLE_ID INTEGER; ; PROJECT_PARTICIPATION; PROJECTNO INTEGER; EMPNO INTEGER; START_DATE VARCHAR(12); END_DATE VARCHAR(12) null; ROLE_ID INTEGER null; ;
7 ROLE; ROLE_ID INTEGER; DESCRIPTION VARCHAR(100); ; ROLE; ROLE_ID INTEGER; DESCRIPTION VARCHAR(100) null; ;
8 SALARYGRADE; GRADE INTEGER; LOSAL INTEGER; HISAL INTEGER; ;
+1 -1
View File
@@ -1,2 +1,2 @@
# name; last modification
Demo-Scott;
Demo Scott (7 Tables);
1 # name last modification
2 Demo-Scott Demo Scott (7 Tables)
+1 -1
View File
@@ -1,4 +1,4 @@
# Name; Upsert; Primary key; ; Author
# Name; Upsert; Primary Key; ; Author
BONUS; N; ENAME VARCHAR(10); JOB VARCHAR(9); ; Demo; ;
DEPARTMENT; N; DEPTNO INTEGER; ; Demo; ;
EMPLOYEE; N; EMPNO INTEGER; ; Demo; ;
1 # Name; Upsert; Primary key; ; Author # Name; Upsert; Primary Key; ; Author
2 BONUS; N; ENAME VARCHAR(10); JOB VARCHAR(9); ; Demo; ; BONUS; N; ENAME VARCHAR(10); JOB VARCHAR(9); ; Demo; ;
3 DEPARTMENT; N; DEPTNO INTEGER; ; Demo; ; DEPARTMENT; N; DEPTNO INTEGER; ; Demo; ;
4 EMPLOYEE; N; EMPNO INTEGER; ; Demo; ; EMPLOYEE; N; EMPNO INTEGER; ; Demo; ;
+1 -1
View File
@@ -1 +1 @@
7.2.2
8.7.5
1 7.2.2 8.7.5
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+47 -125
View File
@@ -116,7 +116,7 @@
"font-weight: bold;">Dependencies</span></big>
<ul>
<li>jailer-engine-<i>version</i>.jar</li>
<li>jailer-engine-<i>version</i>.jar&nbsp;(included in jailer-<i>version</i>.zip)</li>
<li>log4J</li>
</ul><br />
@@ -137,8 +137,8 @@
<br />
The example is included in the
jailer-engine-<i>version</i>.jar. It extracts some data
from the "demo-scott" database and imports it into another
database "demo-scott-subset".<br />
from the "demo-scott-1.4" database and imports it into another
database "demo-scott-subset-1.4".<br />
<ul>
<li>Packages<br />
@@ -154,132 +154,54 @@
<div style=
'background:#FFFFFF; font-family: Courier New, Courier; font-size: 10pt; COLOR: #000000; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;'>
<pre style="color:#000000;background:#ffffff;"><span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#800000; font-weight:bold; ">class</span> APIExample <span style="color:#800080; ">{</span>
<span style="color:#696969; ">// JDBC connection pool size</span>
<span style="color:#800000; font-weight:bold; ">private</span> <span style="color:#800000; font-weight:bold; ">static</span> <span style="color:#800000; font-weight:bold; ">final</span> <span style="color:#bb7977; ">int</span> POOL_SIZE <span style="color:#808030; ">=</span> <span style="color:#008c00; ">10</span><span style="color:#800080; ">;</span>
<span style="color:#696969; ">// The subsetter</span>
<span style="color:#800000; font-weight:bold; ">private</span> <span style="color:#800000; font-weight:bold; ">static</span> Subsetter subsetter <span style="color:#808030; ">=</span>
<span style="color:#800000; font-weight:bold; ">new</span> Subsetter<span style="color:#808030; ">(</span>
<span style="color:#800000; font-weight:bold; ">new</span> BasicDataSource<span style="color:#808030; ">(</span>
<span style="color:#0000e6; ">"org.h2.Driver"</span><span style="color:#808030; ">,</span> <span style="color:#0000e6; ">"jdbc:h2:"</span> <span style="color:#808030; ">+</span> <span style="color:#800000; font-weight:bold; ">new</span> <span style="color:#bb7977; font-weight:bold; ">File</span><span style="color:#808030; ">(</span><span style="color:#0000e6; ">"demo-scott-1.4"</span><span style="color:#808030; ">)</span><span style="color:#808030; ">.</span>getAbsolutePath<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span><span style="color:#808030; ">,</span> <span style="color:#0000e6; ">"sa"</span><span style="color:#808030; ">,</span> <span style="color:#0000e6; ">""</span><span style="color:#808030; ">,</span>
POOL_SIZE<span style="color:#808030; ">,</span>
<span style="color:#800000; font-weight:bold; ">new</span> <span style="color:#bb7977; font-weight:bold; ">File</span><span style="color:#808030; ">(</span><span style="color:#0000e6; ">"lib/h2-1.4.199.jar"</span><span style="color:#808030; ">)</span><span style="color:#808030; ">)</span><span style="color:#808030; ">,</span>
<span style="color:#800000; font-weight:bold; ">null</span><span style="color:#808030; ">,</span>
APIExample<span style="color:#808030; ">.</span>class<span style="color:#808030; ">.</span>getResource<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Demo-Scott"</span><span style="color:#808030; ">)</span><span style="color:#808030; ">,</span>
APIExample<span style="color:#808030; ">.</span>class<span style="color:#808030; ">.</span>getResource<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"Demo-Scott.jm"</span><span style="color:#808030; ">)</span><span style="color:#808030; ">,</span>
ScriptFormat<span style="color:#808030; ">.</span>SQL<span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
<span style="color:#696969; ">// The importer</span>
<span style="color:#800000; font-weight:bold; ">private</span> <span style="color:#800000; font-weight:bold; ">static</span> Importer importer <span style="color:#808030; ">=</span>
<span style="color:#800000; font-weight:bold; ">new</span> Importer<span style="color:#808030; ">(</span>
<span style="color:#800000; font-weight:bold; ">new</span> BasicDataSource<span style="color:#808030; ">(</span>
<span style="color:#0000e6; ">"org.h2.Driver"</span><span style="color:#808030; ">,</span> <span style="color:#0000e6; ">"jdbc:h2:"</span> <span style="color:#808030; ">+</span> <span style="color:#800000; font-weight:bold; ">new</span> <span style="color:#bb7977; font-weight:bold; ">File</span><span style="color:#808030; ">(</span><span style="color:#0000e6; ">"demo-scott-subset-1.4"</span><span style="color:#808030; ">)</span><span style="color:#808030; ">.</span>getAbsolutePath<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span><span style="color:#808030; ">,</span> <span style="color:#0000e6; ">"sa"</span><span style="color:#808030; ">,</span> <span style="color:#0000e6; ">""</span><span style="color:#808030; ">,</span>
<span style="color:#008c00; ">10</span><span style="color:#808030; ">,</span>
<span style="color:#800000; font-weight:bold; ">new</span> <span style="color:#bb7977; font-weight:bold; ">File</span><span style="color:#808030; ">(</span><span style="color:#0000e6; ">"lib/h2-1.4.199.jar"</span><span style="color:#808030; ">)</span><span style="color:#808030; ">)</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
<span style="color:#3f5fbf; ">/**</span>
<span style="color:#3f5fbf; "> </span><span style="color:#7f9fbf; font-weight:bold; ">*</span><span style="color:#3f5fbf; "> Exports data related with employee "SCOTT"</span>
<span style="color:#3f5fbf; "> </span><span style="color:#7f9fbf; font-weight:bold; ">*</span><span style="color:#3f5fbf; "> and imports it into another database.</span>
<span style="color:#3f5fbf; "> */</span>
<span style="color:#800000; font-weight:bold; ">public</span> <span style="color:#800000; font-weight:bold; ">static</span> <span style="color:#bb7977; ">void</span> main<span style="color:#808030; ">(</span><span style="color:#bb7977; font-weight:bold; ">String</span><span style="color:#808030; ">[</span><span style="color:#808030; ">]</span> args<span style="color:#808030; ">)</span> <span style="color:#800000; font-weight:bold; ">throws</span> <span style="color:#bb7977; font-weight:bold; ">SQLException</span><span style="color:#808030; ">,</span> <span style="color:#bb7977; font-weight:bold; ">IOException</span> <span style="color:#800080; ">{</span>
<span style="color:#bb7977; font-weight:bold; ">File</span> exportScriptFile <span style="color:#808030; ">=</span> Configuration<span style="color:#808030; ">.</span>getInstance<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span><span style="color:#808030; ">.</span>createTempFile<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
subsetter<span style="color:#808030; ">.</span>setUpsertOnly<span style="color:#808030; ">(</span><span style="color:#800000; font-weight:bold; ">true</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span> <span style="color:#696969; ">// overwrite previous data</span>
subsetter<span style="color:#808030; ">.</span>execute<span style="color:#808030; ">(</span><span style="color:#0000e6; ">"NAME='SCOTT'"</span><span style="color:#808030; ">,</span> exportScriptFile<span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
importer<span style="color:#808030; ">.</span>execute<span style="color:#808030; ">(</span>exportScriptFile<span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
exportScriptFile<span style="color:#808030; ">.</span>delete<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span>
<span style="color:#800080; ">}</span>
<span style="color:#800080; ">}</span>
</pre>
<br />
<strong><font color=
'#7F0055'>package</font></strong>&nbsp;net.sf.jailer.api_example;<br />
<br />
<strong><font color=
'#7F0055'>import</font></strong>&nbsp;java.io.File;<br />
<strong><font color=
'#7F0055'>import</font></strong>&nbsp;java.io.IOException;<br />
<strong><font color=
'#7F0055'>import</font></strong>&nbsp;java.sql.SQLException;<br />
<br />
<strong><font color=
'#7F0055'>import</font></strong>&nbsp;net.sf.jailer.api.Importer;<br />
<strong><font color=
'#7F0055'>import</font></strong>&nbsp;net.sf.jailer.api.Subsetter;<br />
<strong><font color=
'#7F0055'>import</font></strong>&nbsp;net.sf.jailer.configuration.Configuration;<br />
<strong><font color=
'#7F0055'>import</font></strong>&nbsp;net.sf.jailer.database.BasicDataSource;<br />
<strong><font color=
'#7F0055'>import</font></strong>&nbsp;net.sf.jailer.subsetting.ScriptFormat;<br />
<br />
<font color='#2040A0'>/**<br />
&nbsp;*&nbsp;Jailer&nbsp;API&nbsp;Example.&nbsp;&nbsp;<br />
&nbsp;*&nbsp;<br />
&nbsp;*&nbsp;Extracts&nbsp;some&nbsp;data&nbsp;from&nbsp;the&nbsp;"demo-scott"&nbsp;database<br />
&nbsp;*&nbsp;and&nbsp;imports&nbsp;it&nbsp;into&nbsp;another&nbsp;database&nbsp;"demo-scott-subset".<br />
&nbsp;*/</font><br />
<strong><font color=
'#7F0055'>public</font></strong>&nbsp;<strong><font color='#7F0055'>class</font></strong>&nbsp;APIExample&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color=
'#3F7F5F'>//&nbsp;JDBC&nbsp;connection&nbsp;pool&nbsp;size</font><br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong><font color=
'#7F0055'>private</font></strong>&nbsp;<strong><font color='#7F0055'>static</font></strong>&nbsp;<strong><font color='#7F0055'>final</font></strong>&nbsp;<strong><font color='#7F0055'>int</font></strong>&nbsp;POOL_SIZE&nbsp;=&nbsp;10;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color=
'#3F7F5F'>//&nbsp;The&nbsp;subsetter</font><br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong><font color=
'#7F0055'>private</font></strong>&nbsp;<strong><font color='#7F0055'>static</font></strong>&nbsp;Subsetter&nbsp;subsetter&nbsp;=&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><font color='#7F0055'>new</font></strong>&nbsp;Subsetter(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><font color='#7F0055'>new</font></strong>&nbsp;BasicDataSource(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#2A00FF'>"org.h2.Driver"</font>,&nbsp;<font color='#2A00FF'>"jdbc:h2:demo-scott"</font>,&nbsp;<font color='#2A00FF'>"sa"</font>,&nbsp;<font color='#2A00FF'>""</font>,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;POOL_SIZE,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><font color='#7F0055'>new</font></strong>&nbsp;File(<font color='#2A00FF'>"lib/h2-1.3.160.jar"</font>)),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><font color='#7F0055'>null</font></strong>,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;APIExample.<strong><font color='#7F0055'>class</font></strong>.getResource(<font color='#2A00FF'>"Demo-Scott"</font>),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;APIExample.<strong><font color='#7F0055'>class</font></strong>.getResource(<font color='#2A00FF'>"Demo-Scott.csv"</font>),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ScriptFormat.SQL);<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color=
'#3F7F5F'>//&nbsp;The&nbsp;importer</font><br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong><font color=
'#7F0055'>private</font></strong>&nbsp;<strong><font color='#7F0055'>static</font></strong>&nbsp;Importer&nbsp;importer&nbsp;=<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><font color='#7F0055'>new</font></strong>&nbsp;Importer(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><font color='#7F0055'>new</font></strong>&nbsp;BasicDataSource(<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#2A00FF'>"org.h2.Driver"</font>,&nbsp;<font color='#2A00FF'>"jdbc:h2:demo-scott-subset"</font>,&nbsp;<font color='#2A00FF'>"sa"</font>,&nbsp;<font color='#2A00FF'>""</font>,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><font color='#7F0055'>new</font></strong>&nbsp;File(<font color='#2A00FF'>"lib/h2-1.3.160.jar"</font>)));<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color=
'#2040A0'>/**<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Exports&nbsp;data&nbsp;related&nbsp;with&nbsp;employee&nbsp;"SCOTT"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;and&nbsp;imports&nbsp;it&nbsp;into&nbsp;another&nbsp;database.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</font><br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong><font color=
'#7F0055'>public</font></strong>&nbsp;<strong><font color='#7F0055'>static</font></strong>&nbsp;<strong><font color='#7F0055'>void</font></strong>&nbsp;main(String[]&nbsp;args)&nbsp;<strong><font color='#7F0055'>throws</font></strong>&nbsp;SQLException,&nbsp;IOException&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File&nbsp;exportScriptFile&nbsp;=&nbsp;Configuration.getInstance().createTempFile();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;subsetter.setUpsertOnly(<strong><font color='#7F0055'>true</font></strong>);&nbsp;<font color='#3F7F5F'>//&nbsp;overwrite&nbsp;previous&nbsp;data</font><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;subsetter.execute(<font color='#2A00FF'>"NAME='SCOTT'"</font>,&nbsp;exportScriptFile);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;importer.execute(exportScriptFile);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exportScriptFile.delete();<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
}<br />
<div style=
'text-align:right;BORDER-TOP: #ccc 1px dashed'>
<a href=
"http://www.togotutor.com/code-to-html/java-to-html.php"
target="_blank">Code Formatted by ToGoTutor</a>
</div>
</div>
</li>
+3 -3
View File
@@ -12,14 +12,14 @@ Informix Dynamic Server;jdbc:informix-sqli://<HOST>:<PORT>/<DB>:INFORMIXSERVER=<
InstantDB (v3.13 and earlier);jdbc:idb:<DB>;jdbc.idbDriver
InstantDB (v3.14 and later);jdbc:idb:<DB>;org.enhydra.instantdb.jdbc.idbDriver
Interbase (InterClient Driver);jdbc:interbase://<HOST>/<DB>;interbase.interclient.Driver
H2 embedded (Java SQL database);jdbc:h2:<DB-File>;org.h2.Driver;lib/h2-1.3.175.jar
H2 TCP (Java SQL database);jdbc:h2:tcp://<HOST>/<DB-File>;org.h2.Driver;lib/h2-1.3.175.jar
H2 embedded (Java SQL database);jdbc:h2:<DB-File>;org.h2.Driver;lib/h2-1.4.199.jar
H2 TCP (Java SQL database);jdbc:h2:tcp://<HOST>/<DB-File>;org.h2.Driver;lib/h2-1.4.199.jar
HyperSQL;jdbc:hsqldb:<file|hsql|http>:<DB>;org.hsqldb.jdbcDriver
# Microsoft SQL Server (jTDS);jdbc:jtds:sqlserver://<server>[:<port>][/<database>];net.sourceforge.jtds.jdbc.Driver;lib/jtds-1.3.1.jar
# Microsoft SQL Server (JTurbo Driver);jdbc:JTurbo://<HOST>:<PORT>/<DB>;com.ashna.jturbo.driver.Driver
# Microsoft SQL Server (Sprinta Driver);jdbc:inetdae:<HOST>:<PORT>?database=<DB>;com.inet.tds.TdsDriver
# Microsoft SQL Server (Microsoft Driver);jdbc:microsoft:sqlserver://<HOST>:<PORT>[\;DatabaseName=<DB>];com.microsoft.jdbc.sqlserver.SQLServerDriver
Microsoft SQL Server;jdbc:sqlserver://<HOST>:<PORT>[\;DatabaseName=<DB>];com.microsoft.sqlserver.jdbc.SQLServerDriver
Microsoft SQL Server;jdbc:sqlserver://<HOST>:<PORT>[\;DatabaseName=<DB>];com.microsoft.sqlserver.jdbc.SQLServerDriver;lib/mssql-jdbc-7.2.1.jre8.jar
MySQL;jdbc:mysql://<HOST>:<PORT>/<DB>;org.gjt.mm.mysql.Driver;lib/mysql-connector-java-5.1.5-bin.jar
Oracle OCI;jdbc:oracle:oci:@<SID>;oracle.jdbc.driver.OracleDriver
# PostgreSQL (v6.5 and earlier);jdbc:postgresql://<HOST>:<PORT>/<DB>;postgresql.Driver
1 IBM DB2 Alias jdbc:db2://<HOST>:<PORT>/<DB> COM.ibm.db2.jdbc.app.DB2Driver
12 InstantDB (v3.13 and earlier) jdbc:idb:<DB> jdbc.idbDriver
13 InstantDB (v3.14 and later) jdbc:idb:<DB> org.enhydra.instantdb.jdbc.idbDriver
14 Interbase (InterClient Driver) jdbc:interbase://<HOST>/<DB> interbase.interclient.Driver
15 H2 embedded (Java SQL database) jdbc:h2:<DB-File> org.h2.Driver
16 H2 TCP (Java SQL database) jdbc:h2:tcp://<HOST>/<DB-File> org.h2.Driver
17 HyperSQL jdbc:hsqldb:<file|hsql|http>:<DB> org.hsqldb.jdbcDriver
18 # Microsoft SQL Server (jTDS) jdbc:jtds:sqlserver://<server>[:<port>][/<database>] net.sourceforge.jtds.jdbc.Driver
19 # Microsoft SQL Server (JTurbo Driver) jdbc:JTurbo://<HOST>:<PORT>/<DB> com.ashna.jturbo.driver.Driver
20 # Microsoft SQL Server (Sprinta Driver) jdbc:inetdae:<HOST>:<PORT>?database=<DB> com.inet.tds.TdsDriver
21 # Microsoft SQL Server (Microsoft Driver) jdbc:microsoft:sqlserver://<HOST>:<PORT>[\ DatabaseName=<DB>]
22 Microsoft SQL Server jdbc:sqlserver://<HOST>:<PORT>[\ DatabaseName=<DB>]
23 MySQL jdbc:mysql://<HOST>:<PORT>/<DB> org.gjt.mm.mysql.Driver
24 Oracle OCI jdbc:oracle:oci:@<SID> oracle.jdbc.driver.OracleDriver
25 # PostgreSQL (v6.5 and earlier) jdbc:postgresql://<HOST>:<PORT>/<DB> postgresql.Driver
Binary file not shown.
Binary file not shown.
Binary file not shown.
+47
View File
@@ -1,3 +1,50 @@
8.8.0
- New feature "Check Primary Keys" makes it possible to check the user-defined primary keys for uniqueness.
- A warning message appears if the number of collected rows differs from the number of exported ones.
- The performance of the preparation for the subsetting-process has been improved.
- Extraction models can now be loaded from the "Data Model Manager" dialog.
- It was not possible to pass user / password via cli when it starts with '-'
- Updated local database to H2 1.4.199.
- The fonts selection in the GUI has been standardized.
- Improved error handling in the data browser.
If the same error occurs multiple times because it affects multiple table browsers,
it will be displayed only once.
8.7.8
- Fixed a bug that caused the creation of a delete script to generate syntactically incorrect SQL statements when a table without a primary key exists.
8.7.5
- Fix for ticket 39 "Oracle queries are going failed". https://sourceforge.net/p/jailer/bugs/39/
- Minor bug fixes.
8.7.3
- Fix: the working table scope "local" did not work correctly with PostgreSQL.
- Cursor-based result sets have been activated under PostgreSQL.
Retrieving the entire ResultSet at once led to out-of-memory errors.
8.7.2
- Selected tables are automatically scrolled into the visible area of the display.
- Fix: not all associations between two visible tables were always visible.
8.7.1
- SQL Console is now robust against outdated metadata.
- Fixed: Associations between visible tables were not always visible.
8.7
- Modal dialogues were replaced by non-modal ones.
- Creation of the data model files has been revised.
- Execution plans for DB2 LUW.
- Fixed "ERROR: failed to find conversion function from unknown to text"
that could occur with PostgreSQL in connection with the "local database" scope.
8.6
- The data browser automatically reconnects when the connection is lost.
- Minor bug fixes.
8.5.4
- The table from which the navigation starts can now be changed at any time in the data browser.
- Improved data browser performance.
8.5.3
- Column order in the display can be defined not only globally but also for each table.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -161,7 +161,13 @@ public class CommandLine {
@Option(name="-limit-transaction-size", usage="collects the rows using multiple insert operations with a limited number of rows per operation")
boolean insertIncrementally = false;
@Option(name="-abortInCaseOfInconsistency", usage="abort the process if the result is inconsistent due to insufficient transaction isolation")
boolean abortInCaseOfInconsistency = false;
@Option(name="-", usage="do not interpret the next word as an option, even if it begins with '-'. For example, if the username is \"-abc\", use \"- -abc\".")
public List<String> escapedWords = new ArrayList<String>();
@Argument
public List<String> arguments = new ArrayList<String>();
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,10 @@
*/
package net.sf.jailer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
@@ -34,8 +38,32 @@ public class CommandLineParser {
public static CommandLine parse(String[] args, boolean silent) throws Exception {
CommandLine commandLine = new CommandLine();
try {
List<String> theArgs = new ArrayList<String>();
final String ESC_PREFIX = "((!JAILER_MINUS_ESC!!)";
int i = 0;
while (i < args.length) {
String arg = args[i];
if ("-".equals(arg) && i < args.length - 1) {
theArgs.add(ESC_PREFIX + args[++i]);
} else {
theArgs.add(arg);
}
++i;
}
CmdLineParser cmdLineParser = new CmdLineParser(commandLine);
cmdLineParser.parseArgument(args);
cmdLineParser.parseArgument(theArgs.toArray(new String[0]));
List<String> escapedWords = new ArrayList<String>();
for (String arg: commandLine.arguments) {
if (arg.startsWith(ESC_PREFIX)) {
escapedWords.add(arg.substring(ESC_PREFIX.length()));
} else {
escapedWords.add(arg);
}
}
commandLine.arguments = escapedWords;
if (commandLine.arguments.isEmpty()) {
if (!silent) {
printUsage();
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,9 +24,11 @@ import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import net.sf.jailer.api.Subsetter;
import net.sf.jailer.configuration.DBMS;
import net.sf.jailer.database.WorkingTableScope;
import net.sf.jailer.progress.ProgressListenerRegistry;
import net.sf.jailer.subsetting.InconsistentSubsettingResultException;
import net.sf.jailer.subsetting.ScriptFormat;
import net.sf.jailer.util.CsvFile;
import net.sf.jailer.util.LayoutStorage;
@@ -84,6 +86,7 @@ public class ExecutionContext {
this.embedded = other.embedded;
this.checkPrimaryKeys = other.checkPrimaryKeys;
this.insertIncrementally = other.insertIncrementally;
this.abortInCaseOfInconsistency = other.abortInCaseOfInconsistency;
this.independentWorkingTables = other.independentWorkingTables;
this.upkDomain = other.upkDomain;
// don't share progressListenerRegistry, was: this.progressListenerRegistry = other.progressListenerRegistry;
@@ -562,6 +565,24 @@ public class ExecutionContext {
this.insertIncrementally = insertIncrementally;
}
/**
* @return if <code>true</code>, {@link Subsetter#execute(String, File)} throws an
* {@link InconsistentSubsettingResultException} if the result is inconsistent
* due to insufficient transaction isolation
*/
public boolean isAbortInCaseOfInconsistency() {
return abortInCaseOfInconsistency;
}
/**
* @param abortInCaseOfInconsitency if <code>true</code>, {@link Subsetter#execute(String, File)} throws an
* {@link InconsistentSubsettingResultException} if the result is inconsistent
* due to insufficient transaction isolation
*/
public void setAbortInCaseOfInconsistency(boolean abortInCaseOfInconsitency) {
this.abortInCaseOfInconsistency = abortInCaseOfInconsitency;
}
/**
* Is the subsetter embedded into an application?
*/
@@ -830,6 +851,9 @@ public class ExecutionContext {
// collects the rows using multiple insert operations with a limited number of rows per operation
private boolean insertIncrementally = false;
// abort the process if the result is inconsistent due to insufficient transaction isolation
private boolean abortInCaseOfInconsistency = false;
// schema in which the import-filter mapping tables will be created
private String importFilterMappingTableSchema = "";
@@ -939,6 +963,7 @@ public class ExecutionContext {
importFilterMappingTableSchema = commandLine.importFilterMappingTableSchema;
checkPrimaryKeys = commandLine.checkPrimaryKeys;
insertIncrementally = commandLine.insertIncrementally;
abortInCaseOfInconsistency = commandLine.abortInCaseOfInconsistency;
}
private Map<String, String> copy(Map<String, String> map) {
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@ public class JailerVersion {
/**
* The Jailer version.
*/
public static final String VERSION = "8.5.3.0";
public static final String VERSION = "8.8.0.2";
/**
* The Jailer working tables version.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,7 @@ import net.sf.jailer.configuration.DBMS;
import net.sf.jailer.database.BasicDataSource;
import net.sf.jailer.database.WorkingTableScope;
import net.sf.jailer.subsetting.ExportStatistic;
import net.sf.jailer.subsetting.InconsistentSubsettingResultException;
import net.sf.jailer.subsetting.ScriptFormat;
import net.sf.jailer.subsetting.SubsettingEngine;
@@ -118,6 +119,8 @@ public class Subsetter {
* @param exportScriptFile the export-script file (compressed if it ends with '.zip' or '.gz')
*
* @return export statistic
*
* @throws InconsistentSubsettingResultException if {@link ExecutionContext#isAbortInCaseOfInconsistency()} and the number of exported rows differs from that of the collected ones
*/
public ExportStatistic execute(String whereClause, File exportScriptFile) throws SQLException, IOException {
return execute(whereClause, exportScriptFile, null);
@@ -131,6 +134,8 @@ public class Subsetter {
* @param deleteScriptFile the delete-script file (compressed if it ends with '.zip' or '.gz'), optional
*
* @return export statistic
*
* @throws InconsistentSubsettingResultException if {@link ExecutionContext#isAbortInCaseOfInconsistency()} and the number of exported rows differs from that of the collected ones
*/
public ExportStatistic execute(String whereClause, File exportScriptFile, File deleteScriptFile) throws SQLException, IOException {
try {
@@ -643,6 +648,22 @@ public class Subsetter {
return executionContext.getSourceSchemaMapping();
}
/**
* If <code>true</code>, the Subsetter throws an
*
* @return if <code>true</code>, abort the process if the result is inconsistent due to insufficient transaction isolation
*/
public boolean isAbortInCaseOfInconsistency() {
return executionContext.isAbortInCaseOfInconsistency();
}
/**
* @param abortInCaseOfInconsitency if <code>true</code>, abort the process if the result is inconsistent due to insufficient transaction isolation
*/
public void setAbortInCaseOfInconsistency(boolean abortInCaseOfInconsitency) {
executionContext.setAbortInCaseOfInconsistency(abortInCaseOfInconsitency);
}
/**
* @return the size of extraction-model pool (default is 10)
*/
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,10 +26,10 @@ import net.sf.jailer.database.BasicDataSource;
import net.sf.jailer.subsetting.ScriptFormat;
/**
* Jailer API Example. <br>
* Jailer API Example. <br>
*
* Extracts some data from the "demo-scott" database
* and imports it into another database "demo-scott-subset".
* Extracts some data from the "demo-scott-1.4" database
* and imports it into another database "demo-scott-subset-1.4".
*/
public class APIExample {
@@ -40,9 +40,9 @@ public class APIExample {
private static Subsetter subsetter =
new Subsetter(
new BasicDataSource(
"org.h2.Driver", "jdbc:h2:demo-scott", "sa", "",
"org.h2.Driver", "jdbc:h2:" + new File("demo-scott-1.4").getAbsolutePath(), "sa", "",
POOL_SIZE,
new File("lib/h2-1.3.175.jar")),
new File("lib/h2-1.4.199.jar")),
null,
APIExample.class.getResource("Demo-Scott"),
APIExample.class.getResource("Demo-Scott.jm"),
@@ -52,9 +52,9 @@ public class APIExample {
private static Importer importer =
new Importer(
new BasicDataSource(
"org.h2.Driver", "jdbc:h2:demo-scott-subset", "sa", "",
"org.h2.Driver", "jdbc:h2:" + new File("demo-scott-subset-1.4").getAbsolutePath(), "sa", "",
10,
new File("lib/h2-1.3.175.jar")));
new File("lib/h2-1.4.199.jar")));
/**
* Exports data related with employee "SCOTT"
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -92,12 +92,39 @@ public class Configuration {
* The renderer.
*/
private HtmlDataModelRenderer renderer;
/**
* URL rewrite rule.
*/
public static class UrlRewriteRule {
private String pattern;
private String replacement;
public String getPattern() {
return pattern;
}
public void setPattern(String pattern) {
this.pattern = pattern;
}
public String getReplacement() {
return replacement;
}
public void setReplacement(String replacement) {
this.replacement = replacement;
}
}
/**
* All URL rewrite rules.
*/
private List<UrlRewriteRule> urlRewriteRules = new ArrayList<UrlRewriteRule>();
/**
* All {@link DBMS}s.
*/
private List<DBMS> dBMSConfigurations = new ArrayList<DBMS>();
/**
* If <code>true</code>, the UPK don't preserve order. This minimizes the size of the UPK.
*/
@@ -210,6 +237,21 @@ public class Configuration {
this.renderer = theRenderer;
}
/**
* @return the URL rewrite rules.
*/
@XmlElement(name = "urlRewriteRule")
public List<UrlRewriteRule> getUrlRewriteRules() {
return urlRewriteRules;
}
/**
* @param urlRewriteRules the URL rewrite rules.
*/
public void setUrlRewriteRules(List<UrlRewriteRule> urlRewriteRules) {
this.urlRewriteRules = urlRewriteRules;
}
/**
* @return the dBMSConfigurations
*/
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -306,6 +306,7 @@ public class DBMS {
private String indexInfoQuery = null;
private String identifierQuoteString = "\"";
private String explainCreateExplainTable = null;
private String explainPrepare = null;
private String explainQuery = null;
private String explainCleanup = null;
@@ -944,6 +945,14 @@ public class DBMS {
this.explainPrepare = explainPrepare;
}
public String getExplainCreateExplainTable() {
return explainCreateExplainTable;
}
public void setExplainCreateExplainTable(String explainCreateExplainTable) {
this.explainCreateExplainTable = explainCreateExplainTable;
}
public String getExplainQuery() {
return explainQuery;
}
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -159,7 +159,7 @@ public class DatabaseObjectRenderingDescription {
ImageIcon icon = icons.get(getIconURL());
if (icon == null) {
try {
icon = new ImageIcon(getClass().getResource(getIconURL()));
icon = new ImageIcon(DatabaseObjectRenderingDescription.class.getResource(getIconURL()));
} catch (Exception e) {
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ public class LocalDatabaseConfiguration {
private String password = "";
private String driver = "org.h2.Driver";
private String lib = "lib/h2-1.3.175.jar";
private String lib = "lib/h2-1.4.199.jar";
/**
* @return the localPKType
@@ -4,7 +4,7 @@
<!-- Configuration of the local database -->
<localDatabase>
<databaseFolder>local</databaseFolder>
<lib>lib/h2-1.3.175.jar</lib>
<lib>lib/h2-1.4.199.jar</lib>
<driver>org.h2.Driver</driver>
<urlPattern>jdbc:h2:%s;LOG=0;UNDO_LOG=0</urlPattern>
<localPKType>VARCHAR</localPKType>
@@ -47,6 +47,19 @@
<!-- additional SQL keywords -->
<additionalSQLKeywords>sensitive, datetime</additionalSQLKeywords>
<!-- IBM JDBC Connector -->
<urlRewriteRule>
<pattern>^jdbc:ibm:(.*)$</pattern>
<replacement>jdbc:$1</replacement>
</urlRewriteRule>
<!-- other rules
<urlRewriteRule>
<pattern></pattern>
<replacement></replacement>
</urlRewriteRule>
-->
<!-- for Oracle -->
<dbms>
<id>ORACLE</id>
@@ -353,7 +366,7 @@ union all
<dbms>
<id>MySQL</id>
<displayName>MySQL</displayName>
<urlPattern>jdbc:mysql.*|jdbc:mariadb.*</urlPattern>
<urlPattern>jdbc:mysql.*</urlPattern>
<sqlDialect>
<needsValuesKeywordForDeletes>false</needsValuesKeywordForDeletes>
<supportsInClauseForDeletes>true</supportsInClauseForDeletes>
@@ -366,6 +379,7 @@ union all
<value>true</value>
</entry>
</jdbcProperties>
<!-- <fetchSize>-2147483648</fetchSize> --> <!-- setFetchSize(Integer.MIN_VALUE) should enable result set streaming -->
<statisticRenovator>
<scriptFileName>script/mysql/update_statistics.sql</scriptFileName>
</statisticRenovator>
@@ -471,7 +485,186 @@ union all
<avoidLeftJoin>false</avoidLeftJoin>
<useInlineViewsInDataBrowser>true</useInlineViewsInDataBrowser>
<defaultSchemaQuery>Select DATABASE()</defaultSchemaQuery>
<estimatedRowCountQuery>select TABLE_NAME, CARDINALITY from INFORMATION_SCHEMA.STATISTICS where TABLE_SCHEMA = '%s'</estimatedRowCountQuery>
<estimatedRowCountQuery>select TABLE_NAME, max(CARDINALITY) from INFORMATION_SCHEMA.STATISTICS where TABLE_SCHEMA = '%s' group by TABLE_NAME</estimatedRowCountQuery>
<viewTextOrDDLQuery>SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA = '%1$s' and TABLE_NAME = '%2$s'</viewTextOrDDLQuery>
<virtualColumnsQuery>SELECT TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '${SCHEMA}' AND EXTRA LIKE '%VIRTUAL%'</virtualColumnsQuery>
<!--
<importedKeysQuery>SELECT PKCU.TABLE_SCHEMA, null, PKCU.TABLE_NAME, PKCU.COLUMN_NAME, KCU.TABLE_SCHEMA, null, KCU.TABLE_NAME, KCU.COLUMN_NAME, KCU.ORDINAL_POSITION, null, null, RC.CONSTRAINT_NAME, RC.UNIQUE_CONSTRAINT_NAME, null FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS RC JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU ON KCU.CONSTRAINT_CATALOG = RC.CONSTRAINT_CATALOG AND KCU.CONSTRAINT_SCHEMA = RC.CONSTRAINT_SCHEMA AND KCU.CONSTRAINT_NAME = RC.CONSTRAINT_NAME JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE PKCU ON PKCU.CONSTRAINT_CATALOG = RC.UNIQUE_CONSTRAINT_CATALOG AND PKCU.CONSTRAINT_SCHEMA = RC.UNIQUE_CONSTRAINT_SCHEMA AND PKCU.CONSTRAINT_NAME = RC.UNIQUE_CONSTRAINT_NAME AND PKCU.TABLE_NAME = RC.REFERENCED_TABLE_NAME AND PKCU.ORDINAL_POSITION = KCU.ORDINAL_POSITION WHERE PKCU.TABLE_SCHEMA = '${SCHEMA}' ORDER BY KCU.ORDINAL_POSITION</importedKeysQuery>
<primaryKeysQuery>SELECT null, KCU.TABLE_SCHEMA, KCU.TABLE_NAME, KCU.COLUMN_NAME, KCU.ORDINAL_POSITION, C.CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS C JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU ON KCU.CONSTRAINT_CATALOG = C.CONSTRAINT_CATALOG AND KCU.CONSTRAINT_SCHEMA = C.CONSTRAINT_SCHEMA AND KCU.TABLE_NAME = C.TABLE_NAME AND KCU.CONSTRAINT_NAME = C.CONSTRAINT_NAME WHERE C.CONSTRAINT_TYPE = 'PRIMARY KEY' AND KCU.TABLE_SCHEMA = '${SCHEMA}' ORDER BY KCU.ORDINAL_POSITION</primaryKeysQuery>
-->
<nullableContraint>NULL</nullableContraint>
<identifierQuoteString>`</identifierQuoteString>
<ddlQuery>SHOW CREATE ${type} `${schema}`.`${table}`</ddlQuery>
<explainPrepare></explainPrepare>
<explainQuery>explain %1$s</explainQuery>
<explainCleanup></explainCleanup>
<functionSourceQuery>SHOW CREATE FUNCTION %1$s.%2$s</functionSourceQuery>
<procedureSourceQuery>SHOW CREATE PROCEDURE %1$s.%2$s</procedureSourceQuery>
<constraintsQuery>
Select CNAME, TNAME, COLNAME, CTYPE, DETAIL From
(
Select concat('pk_', KCU.TABLE_NAME) CNAME, KCU.TABLE_NAME TNAME, KCU.COLUMN_NAME COLNAME, 'PK' CTYPE, null DETAIL, KCU.ORDINAL_POSITION POS, 1 TYPEPOS
From
INFORMATION_SCHEMA.TABLE_CONSTRAINTS C
join
INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU
ON KCU.CONSTRAINT_CATALOG = C.CONSTRAINT_CATALOG
AND KCU.CONSTRAINT_SCHEMA = C.CONSTRAINT_SCHEMA
AND KCU.TABLE_NAME = C.TABLE_NAME
AND KCU.CONSTRAINT_NAME = C.CONSTRAINT_NAME
where
C.CONSTRAINT_TYPE = 'PRIMARY KEY'
AND KCU.TABLE_SCHEMA = '%1$s'
union all
Select C.CONSTRAINT_NAME CNAME, KCU.TABLE_NAME TNAME, KCU.COLUMN_NAME COLNAME, 'Unique' CTYPE, null DETAIL, KCU.ORDINAL_POSITION POS, 2 TYPEPOS
From
INFORMATION_SCHEMA.TABLE_CONSTRAINTS C
join
INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU
ON KCU.CONSTRAINT_CATALOG = C.CONSTRAINT_CATALOG
AND KCU.CONSTRAINT_SCHEMA = C.CONSTRAINT_SCHEMA
AND KCU.TABLE_NAME = C.TABLE_NAME
AND KCU.CONSTRAINT_NAME = C.CONSTRAINT_NAME
where
C.CONSTRAINT_TYPE = 'UNIQUE'
AND KCU.TABLE_SCHEMA = '%1$s'
) pk order by TYPEPOS, CNAME, TNAME, POS, COLNAME
</constraintsQuery>
<objectRenderers>
<name>Triggers</name>
<iconURL>/net/sf/jailer/ui/resource/triggers.png</iconURL>
<itemDescription>
<iconURL>/net/sf/jailer/ui/resource/trigger.png</iconURL>
</itemDescription>
<listQuery>SHOW TRIGGERS FROM %1$s</listQuery>
</objectRenderers>
</dbms>
<!-- for MariaDB -->
<dbms>
<id>MariaDB</id>
<displayName>MariaDB</displayName>
<urlPattern>jdbc:mariadb.*</urlPattern>
<sqlDialect>
<needsValuesKeywordForDeletes>false</needsValuesKeywordForDeletes>
<supportsInClauseForDeletes>true</supportsInClauseForDeletes>
<supportsMultiRowInserts>true</supportsMultiRowInserts>
<upsertMode>FROM_DUAL</upsertMode>
</sqlDialect>
<jdbcProperties>
<entry>
<key>noDatetimeStringSync</key>
<value>true</value>
</entry>
</jdbcProperties>
<!-- <fetchSize>-2147483648</fetchSize> --> <!-- setFetchSize(Integer.MIN_VALUE) should enable result set streaming -->
<statisticRenovator>
<scriptFileName>script/mysql/update_statistics.sql</scriptFileName>
</statisticRenovator>
<typeReplacement>
<entry>
<key>TINYINT</key>
<value>INT</value>
</entry>
<entry>
<key>SMALLINT</key>
<value>INT</value>
</entry>
<entry>
<key>MEDIUMINT</key>
<value>INT</value>
</entry>
<entry>
<key>INT</key>
<value>BIGINT</value>
</entry>
<entry>
<key>INTEGER</key>
<value>BIGINT</value>
</entry>
<entry>
<key>tinyint</key>
<value>int</value>
</entry>
<entry>
<key>smallint</key>
<value>int</value>
</entry>
<entry>
<key>mediumint</key>
<value>int</value>
</entry>
<entry>
<key>int</key>
<value>bigint</value>
</entry>
<entry>
<key>integer</key>
<value>bigint</value>
</entry>
</typeReplacement>
<stringLiteralEscapeSequences>
<entry>
<key>\0</key>
<value>\0</value>
</entry>
<entry>
<key>'</key>
<value>\'</value>
</entry>
<entry>
<key>"</key>
<value>\"</value>
</entry>
<entry>
<key>\n</key>
<value>\n</value>
</entry>
<entry>
<key>\r</key>
<value>\r</value>
</entry>
<entry>
<key>\t</key>
<value>\t</value>
</entry>
<entry>
<key>\b</key>
<value>\b</value>
</entry>
<entry>
<key>\26</key>
<value>\Z</value>
</entry>
<entry>
<key>\\</key>
<value>\\</value>
</entry>
</stringLiteralEscapeSequences>
<sqlLimitSuffix>LIMIT 0, %s</sqlLimitSuffix>
<!-- NOLOGGING, TABLESPACE-spec., etc. -->
<tableProperties></tableProperties>
<limitTransactionSize>
<limit>30000</limit>
<statementSuffix>limit %1$s</statementSuffix>
</limitTransactionSize>
<identityInserts>false</identityInserts>
<emptyBLOBValue>BINARY ''</emptyBLOBValue>
<emptyCLOBValue>''</emptyCLOBValue>
<emptyNCLOBValue>''</emptyNCLOBValue>
<toBlob>0x%s</toBlob>
<toClob>'%s'</toClob>
<toNClob>'%s'</toNClob>
<embeddedLobSizeLimit>32000</embeddedLobSizeLimit>
<binaryPattern>x'%s'</binaryPattern>
<avoidLeftJoin>false</avoidLeftJoin>
<useInlineViewsInDataBrowser>true</useInlineViewsInDataBrowser>
<defaultSchemaQuery>Select DATABASE()</defaultSchemaQuery>
<estimatedRowCountQuery>select TABLE_NAME, max(CARDINALITY) from INFORMATION_SCHEMA.STATISTICS where TABLE_SCHEMA = '%s' group by TABLE_NAME</estimatedRowCountQuery>
<viewTextOrDDLQuery>SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA = '%1$s' and TABLE_NAME = '%2$s'</viewTextOrDDLQuery>
<virtualColumnsQuery>SELECT TABLE_NAME, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '${SCHEMA}' AND EXTRA LIKE '%VIRTUAL%'</virtualColumnsQuery>
@@ -596,6 +789,215 @@ union all
<procedureDetailNeedsSpecificName>true</procedureDetailNeedsSpecificName>
<functionSourceQuery>SELECT 'Source', cast(ROUTINE_DEFINITION as varchar) FROM SYSIBM.ROUTINES where ROUTINE_SCHEMA = '%1$s' and SPECIFIC_NAME = '%2$s' and ROUTINE_DEFINITION is not null</functionSourceQuery>
<procedureSourceQuery>SELECT 'Source', cast(ROUTINE_DEFINITION as varchar) FROM SYSIBM.ROUTINES where ROUTINE_SCHEMA = '%1$s' and SPECIFIC_NAME = '%2$s' and ROUTINE_DEFINITION is not null</procedureSourceQuery>
<explainCreateExplainTable>CALL SYSPROC.SYSINSTALLOBJECTS('EXPLAIN', 'C',CAST (NULL AS VARCHAR(128)), CAST (NULL AS VARCHAR(128)))</explainCreateExplainTable>
<explainPrepare>explain plan for %1$s</explainPrepare>
<explainQuery><![CDATA[
WITH tree(operator_ID, level, path, explain_time, cycle)
AS
(
SELECT 1 operator_id
, 0 level
, CAST('001' AS VARCHAR(1000)) path
, max(explain_time) explain_time
, 0
FROM SYSTOOLS.EXPLAIN_OPERATOR O
WHERE O.EXPLAIN_REQUESTER = SESSION_USER
UNION ALL
SELECT s.source_id
, level + 1
, tree.path || '/' || LPAD(CAST(s.source_id AS VARCHAR(3)), 3, '0') path
, tree.explain_time
, POSITION('/' || LPAD(CAST(s.source_id AS VARCHAR(3)), 3, '0') || '/' IN path USING OCTETS)
FROM tree
, SYSTOOLS.EXPLAIN_STREAM S
WHERE s.target_id = tree.operator_id
AND s.explain_time = tree.explain_time
AND S.Object_Name IS NULL
AND S.explain_requester = SESSION_USER
AND tree.cycle = 0
AND level < 100
)
SELECT *
FROM (
SELECT "Explain Plan"
FROM (
SELECT CAST( LPAD(id, MAX(LENGTH(id)) OVER(), ' ')
|| ' | '
|| RPAD(operation, MAX(LENGTH(operation)) OVER(), ' ')
|| ' | '
|| LPAD(rows, MAX(LENGTH(rows)) OVER(), ' ')
|| ' | '
-- Don't show ActualRows columns if there are no actuals available at all
|| CASE WHEN COUNT(ActualRows) OVER () > 1 -- the heading 'ActualRows' is always present, so "1" means no OTHER values
THEN LPAD(ActualRows, MAX(LENGTH(ActualRows)) OVER(), ' ') || ' | '
ELSE ''
END
|| LPAD(cost, MAX(LENGTH(cost)) OVER(), ' ')
AS VARCHAR(100)) "Explain Plan"
, path
FROM (
SELECT 'ID' ID
, 'Operation' Operation
, 'Rows' Rows
, 'ActualRows' ActualRows
, 'Cost' Cost
, '0' Path
FROM SYSIBM.SYSDUMMY1
-- TODO: UNION ALL yields duplicate. where do they come from?
UNION
SELECT CAST(tree.operator_id as VARCHAR(254)) ID
, CAST(LPAD(' ', tree.level, ' ')
|| CASE WHEN tree.cycle = 1
THEN '(cycle) '
ELSE ''
END
|| COALESCE (
TRIM(O.Operator_Type)
|| COALESCE(' (' || argument || ')', '')
|| ' '
|| COALESCE(S.Object_Name,'')
, ''
)
AS VARCHAR(254)) AS OPERATION
, COALESCE(CAST(rows AS VARCHAR(254)), '') Rows
, CAST(ActualRows as VARCHAR(254)) ActualRows -- note: no coalesce
, COALESCE(CAST(CAST(O.Total_Cost AS BIGINT) AS VARCHAR(254)), '') Cost
, path
FROM tree
LEFT JOIN ( SELECT i.source_id
, i.target_id
, CAST(CAST(ROUND(o.stream_count) AS BIGINT) AS VARCHAR(12))
|| ' of '
|| CAST (total_rows AS VARCHAR(12))
|| CASE WHEN total_rows > 0
AND ROUND(o.stream_count) <= total_rows THEN
' ('
|| LPAD(CAST (ROUND(ROUND(o.stream_count)/total_rows*100,2)
AS NUMERIC(5,2)), 6, ' ')
|| '%%)'
ELSE ''
END rows
, CASE WHEN act.actual_value is not null then
CAST(CAST(ROUND(act.actual_value) AS BIGINT) AS VARCHAR(12))
|| ' of '
|| CAST (total_rows AS VARCHAR(12))
|| CASE WHEN total_rows > 0 THEN
' ('
|| LPAD(CAST (ROUND(ROUND(act.actual_value)/total_rows*100,2)
AS NUMERIC(5,2)), 6, ' ')
|| '%%)'
ELSE NULL
END END ActualRows
, i.object_name
, i.explain_time
FROM (SELECT MAX(source_id) source_id
, target_id
, MIN(CAST(ROUND(stream_count,0) AS BIGINT)) total_rows
, CAST(LISTAGG(object_name) AS VARCHAR(50)) object_name
, explain_time
FROM SYSTOOLS.EXPLAIN_STREAM
WHERE explain_time = (SELECT MAX(explain_time)
FROM SYSTOOLS.EXPLAIN_OPERATOR
WHERE EXPLAIN_REQUESTER = SESSION_USER
)
GROUP BY target_id, explain_time
) I
LEFT JOIN SYSTOOLS.EXPLAIN_STREAM O
ON ( I.target_id=o.source_id
AND I.explain_time = o.explain_time
AND O.EXPLAIN_REQUESTER = SESSION_USER
)
LEFT JOIN SYSTOOLS.EXPLAIN_ACTUALS act
ON ( act.operator_id = i.target_id
AND act.explain_time = i.explain_time
AND act.explain_requester = SESSION_USER
AND act.ACTUAL_TYPE like 'CARDINALITY%%'
)
) s
ON ( s.target_id = tree.operator_id
AND s.explain_time = tree.explain_time
)
LEFT JOIN SYSTOOLS.EXPLAIN_OPERATOR O
ON ( o.operator_id = tree.operator_id
AND o.explain_time = tree.explain_time
AND o.explain_requester = SESSION_USER
)
LEFT JOIN (SELECT LISTAGG (CASE argument_type
WHEN 'UNIQUE' THEN
CASE WHEN argument_value = 'TRUE'
THEN 'UNIQUE'
ELSE NULL
END
WHEN 'TRUNCSRT' THEN
CASE WHEN argument_value = 'TRUE'
THEN 'TOP-N'
ELSE NULL
END
WHEN 'SCANDIR' THEN
CASE WHEN argument_value != 'FORWARD'
THEN argument_value
ELSE NULL
END
ELSE argument_value
END
, ' ') argument
, operator_id
, explain_time
FROM SYSTOOLS.EXPLAIN_ARGUMENT EA
WHERE argument_type IN ('AGGMODE' -- GRPBY
, 'UNIQUE', 'TRUNCSRT' -- SORT
, 'SCANDIR' -- IXSCAN, TBSCAN
, 'OUTERJN' -- JOINs
)
AND explain_requester = SESSION_USER
GROUP BY explain_time, operator_id
) A
ON ( a.operator_id = tree.operator_id
AND a.explain_time = tree.explain_time
)
) O
UNION ALL
VALUES ('', 'A')
, ('', 'Y')
UNION ALL
SELECT CAST (LPAD(CASE WHEN operator_id = LAG (operator_id)
OVER (PARTITION BY operator_id
ORDER BY pred_order
)
THEN ''
ELSE operator_id || ' - '
END
, MAX(LENGTH(operator_id )+4) OVER()
, ' ')
|| how_applied
|| ' '
|| predicate_text
AS VARCHAR(100)) "Predicate Information"
, 'P' || LPAD(id_order, 5, '0') || pred_order path
FROM (SELECT CAST(operator_id AS VARCHAR(254)) operator_id
, LPAD(trim(how_applied)
, MAX (LENGTH(TRIM(how_applied)))
OVER (PARTITION BY operator_id)
, ' '
) how_applied
, CAST(substr(predicate_text, 1, 80) AS VARCHAR(80)) predicate_text
, CASE how_applied WHEN 'START' THEN '1'
WHEN 'STOP' THEN '2'
WHEN 'SARG' THEN '3'
ELSE '9'
END pred_order
, operator_id id_order
FROM systools.explain_predicate p
WHERE explain_time = (SELECT MAX(explain_time)
FROM systools.explain_operator)
)
)
ORDER BY path
)]]>
</explainQuery>
<explainCleanup></explainCleanup>
<constraintsQuery>
Select CNAME, TNAME, COLNAME, CTYPE, DETAIL From
(
@@ -769,7 +1171,7 @@ Select CNAME, TNAME, COLNAME, CTYPE, DETAIL From
<dbms>
<id>POSTGRESQL</id>
<displayName>PostgreSQL</displayName>
<urlPattern>jdbc:postgres.*|jdbc:redshift.*</urlPattern>
<urlPattern>jdbc:postgres.*</urlPattern>
<sqlDialect>
<needsValuesKeywordForDeletes>true</needsValuesKeywordForDeletes>
<supportsInClauseForDeletes>true</supportsInClauseForDeletes>
@@ -915,7 +1317,158 @@ union all
<listQuery>select sequence_name, sequence_schema, sequence_catalog, data_type, numeric_precision, numeric_precision_radix, numeric_scale, start_value, minimum_value, maximum_value, increment, cycle_option from information_schema.sequences where sequence_schema = '%1$s'</listQuery>
</objectRenderers>
</dbms>
<!-- for Amazon Redshift -->
<dbms>
<id>Redshift</id>
<displayName>Redshift</displayName>
<urlPattern>jdbc:redshift.*</urlPattern>
<sqlDialect>
<needsValuesKeywordForDeletes>true</needsValuesKeywordForDeletes>
<supportsInClauseForDeletes>true</supportsInClauseForDeletes>
<supportsMultiRowInserts>true</supportsMultiRowInserts>
<upsertMode>DB2</upsertMode>
</sqlDialect>
<statisticRenovator>
<scriptFileName>script/postgres/update_statistics.sql</scriptFileName>
</statisticRenovator>
<typeReplacement>
<entry>
<key>DOUBLE</key>
<value>DOUBLE PRECISION</value>
</entry>
<entry>
<key>double</key>
<value>double precision</value>
</entry>
<entry>
<key>bigserial</key>
<value>int8</value>
</entry>
<entry>
<key>serial8</key>
<value>int8</value>
</entry>
<entry>
<key>serial</key>
<value>int4</value>
</entry>
<entry>
<key>serial4</key>
<value>int4</value>
</entry>
<entry>
<key>NVARCHAR</key>
<value>VARCHAR</value>
</entry>
<entry>
<key>nvarchar</key>
<value>varchar</value>
</entry>
</typeReplacement>
<sqlLimitSuffix>LIMIT %s</sqlLimitSuffix>
<fetchSize>1000</fetchSize>
<!-- NOLOGGING, TABLESPACE-spec., etc. -->
<tableProperties></tableProperties>
<sessionTemporaryTableManager>
<createIndexPrefix>CREATE INDEX </createIndexPrefix>
<createIndexSuffix></createIndexSuffix>
<createTablePrefix>CREATE TEMPORARY TABLE </createTablePrefix>
<createTableSuffix></createTableSuffix>
<dropTablePrefix>-- DROP TABLE </dropTablePrefix>
<indexTablePrefix></indexTablePrefix>
</sessionTemporaryTableManager>
<identityInserts>false</identityInserts>
<datePattern>''yyyy-MM-dd'''::date'</datePattern>
<timestampPattern>'to_timestamp('''yyyy-MM-dd HH.mm.ss'.${NANO}'', ''YYYY-MM-DD HH24.MI.SS.US'')'</timestampPattern>
<embeddedLobSizeLimit>3980</embeddedLobSizeLimit>
<binaryPattern>E'\\x%s'</binaryPattern>
<avoidLeftJoin>false</avoidLeftJoin>
<supportsSchemasInIndexDefinitions>false</supportsSchemasInIndexDefinitions>
<useInlineViewsInDataBrowser>true</useInlineViewsInDataBrowser>
<identifierQuoteString>"</identifierQuoteString>
<viewTextOrDDLQuery>SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA = '%1$s' and TABLE_NAME = '%2$s'</viewTextOrDDLQuery>
<estimatedRowCountQuery>
SELECT c.relname, c.reltuples::bigint AS estimate
FROM pg_class c
JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE n.nspname = '%s'
</estimatedRowCountQuery>
<explainPrepare></explainPrepare>
<explainQuery>explain %1$s</explainQuery>
<explainCleanup></explainCleanup>
<functionSourceQuery>
SELECT 'Function', p.proname || '(' || pg_catalog.pg_get_function_arguments(p.oid) || ') RETURNS ' || pg_catalog.pg_get_function_result(p.oid)
FROM pg_catalog.pg_proc p
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace
WHERE p.proname = '%2$s' AND n.nspname = '%1$s'
</functionSourceQuery>
<constraintsQuery>
Select CNAME, TNAME, COLNAME, CTYPE, DETAIL From
(
Select KCU.CONSTRAINT_NAME CNAME, KCU.TABLE_NAME TNAME, KCU.COLUMN_NAME COLNAME, 'PK' CTYPE, null DETAIL, KCU.ORDINAL_POSITION POS, 1 TYPEPOS
From
INFORMATION_SCHEMA.TABLE_CONSTRAINTS C
join
INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU
ON KCU.CONSTRAINT_CATALOG = C.CONSTRAINT_CATALOG
AND KCU.CONSTRAINT_SCHEMA = C.CONSTRAINT_SCHEMA
AND KCU.TABLE_NAME = C.TABLE_NAME
AND KCU.CONSTRAINT_NAME = C.CONSTRAINT_NAME
where
C.CONSTRAINT_TYPE = 'PRIMARY KEY'
AND KCU.TABLE_SCHEMA = '%1$s'
union all
Select C.CONSTRAINT_NAME CNAME, KCU.TABLE_NAME TNAME, KCU.COLUMN_NAME COLNAME, 'Unique' CTYPE, null DETAIL, KCU.ORDINAL_POSITION POS, 2 TYPEPOS
From
INFORMATION_SCHEMA.TABLE_CONSTRAINTS C
join
INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU
ON KCU.CONSTRAINT_CATALOG = C.CONSTRAINT_CATALOG
AND KCU.CONSTRAINT_SCHEMA = C.CONSTRAINT_SCHEMA
AND KCU.TABLE_NAME = C.TABLE_NAME
AND KCU.CONSTRAINT_NAME = C.CONSTRAINT_NAME
where
C.CONSTRAINT_TYPE = 'UNIQUE'
AND KCU.TABLE_SCHEMA = '%1$s'
union all
Select C.CONSTRAINT_NAME CNAME, C.TABLE_NAME TNAME, CU.COLUMN_NAME COLNAME, 'Check' CTYPE, CHECK_CLAUSE DETAIL, 1 POS, 3 TYPEPOS
From
INFORMATION_SCHEMA.CHECK_CONSTRAINTS CC
join
INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE CU
on CU.CONSTRAINT_CATALOG = CC.CONSTRAINT_CATALOG
and CU.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA
and CU.CONSTRAINT_NAME = CC.CONSTRAINT_NAME
join
INFORMATION_SCHEMA.TABLE_CONSTRAINTS C
on C.CONSTRAINT_CATALOG = CC.CONSTRAINT_CATALOG
and C.CONSTRAINT_SCHEMA = CC.CONSTRAINT_SCHEMA
and C.CONSTRAINT_NAME = CC.CONSTRAINT_NAME
and C.CONSTRAINT_TYPE = 'CHECK'
and C.TABLE_SCHEMA = '%1$s'
) pk order by TYPEPOS, CNAME, TNAME, POS, COLNAME
</constraintsQuery>
<objectRenderers>
<name>Triggers</name>
<iconURL>/net/sf/jailer/ui/resource/triggers.png</iconURL>
<itemDescription>
<iconURL>/net/sf/jailer/ui/resource/trigger.png</iconURL>
</itemDescription>
<listQuery>select trigger_name, event_manipulation,event_object_catalog,event_object_schema,event_object_table,action_order,action_condition,action_statement,action_orientation,action_timing,action_reference_old_table,action_reference_new_table,action_reference_old_row,action_reference_new_row,created FROM information_schema.triggers where trigger_schema = '%1$s'</listQuery>
</objectRenderers>
<objectRenderers>
<name>Sequences</name>
<iconURL>/net/sf/jailer/ui/resource/sequences.png</iconURL>
<itemDescription>
<iconURL>/net/sf/jailer/ui/resource/sequence.png</iconURL>
</itemDescription>
<listQuery>select sequence_name, sequence_schema, sequence_catalog, data_type, numeric_precision, numeric_precision_radix, numeric_scale, start_value, minimum_value, maximum_value, increment, cycle_option from information_schema.sequences where sequence_schema = '%1$s'</listQuery>
</objectRenderers>
</dbms>
<!-- for Cloudscape -->
<dbms>
<id>CLOADSCAPE</id>
@@ -17,6 +17,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -33,6 +34,7 @@ import javax.sql.DataSource;
import org.apache.log4j.Logger;
import net.sf.jailer.configuration.Configuration;
import net.sf.jailer.configuration.Configuration.UrlRewriteRule;
import net.sf.jailer.configuration.DBMS;
/**
@@ -231,40 +233,53 @@ public class BasicDataSource implements DataSource {
return perUrl.get(dbUrl);
}
DBMS defaultDBMS = DBMS.forDBMS(null);
List<DBMS> cs = Configuration.getInstance().getDBMS();
for (DBMS c: cs) {
if (Pattern.matches(c.getUrlPattern(), dbUrl)) {
boolean ok = true;
if (c.getTestQuery() != null) {
Connection connection = null;
Statement st = null;
try {
connection = getConnection(defaultDBMS, false);
st = connection.createStatement();
ResultSet rs = st.executeQuery(c.getTestQuery());
while (rs.next()) {
}
rs.close();
} catch (SQLException e) {
ok = false;
} finally {
if (st != null) {
try {
st.close();
} catch (SQLException e) {
List<DBMS> cs = Configuration.getInstance().getDBMS();
List<String> rwUrls = new ArrayList<String>();
rwUrls.add(dbUrl);
List<UrlRewriteRule> urlRewriteRules = Configuration.getInstance().getUrlRewriteRules();
if (urlRewriteRules != null) {
for (UrlRewriteRule rule: urlRewriteRules) {
String rwUrl = dbUrl.replaceAll(rule.getPattern(), rule.getReplacement());
if (!rwUrl.equals(dbUrl)) {
rwUrls.add(rwUrl);
}
}
}
for (String rwUrl: rwUrls) {
for (DBMS c: cs) {
if (Pattern.matches(c.getUrlPattern(), rwUrl)) {
boolean ok = true;
if (c.getTestQuery() != null) {
Connection connection = null;
Statement st = null;
try {
connection = getConnection(defaultDBMS, false);
st = connection.createStatement();
ResultSet rs = st.executeQuery(c.getTestQuery());
while (rs.next()) {
}
}
if (connection != null) {
try {
connection.close();
} catch (SQLException e) {
rs.close();
} catch (SQLException e) {
ok = false;
} finally {
if (st != null) {
try {
st.close();
} catch (SQLException e) {
}
}
if (connection != null) {
try {
connection.close();
} catch (SQLException e) {
}
}
}
}
}
if (ok) {
perUrl.put(dbUrl, c);
return c;
if (ok) {
perUrl.put(dbUrl, c);
return c;
}
}
}
}
@@ -274,6 +289,34 @@ public class BasicDataSource implements DataSource {
private final List<Connection> pool = Collections.synchronizedList(new LinkedList<Connection>());
public static boolean findDBMSNeedsConnection(String dbUrl) {
if (perUrl.containsKey(dbUrl)) {
return false;
}
List<DBMS> cs = Configuration.getInstance().getDBMS();
List<String> rwUrls = new ArrayList<String>();
rwUrls.add(dbUrl);
List<UrlRewriteRule> urlRewriteRules = Configuration.getInstance().getUrlRewriteRules();
if (urlRewriteRules != null) {
for (UrlRewriteRule rule: urlRewriteRules) {
String rwUrl = dbUrl.replaceAll(rule.getPattern(), rule.getReplacement());
if (!rwUrl.equals(dbUrl)) {
rwUrls.add(rwUrl);
}
}
}
for (String rwUrl: rwUrls) {
for (DBMS c: cs) {
if (Pattern.matches(c.getUrlPattern(), rwUrl)) {
if (c.getTestQuery() != null) {
return true;
}
}
}
}
return false;
}
/**
* Creates a new connection.
*
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@ public abstract class InlineViewBuilder implements Session.ResultSetReader {
*/
protected final String name;
private final StatementBuilder statementBuilder;
protected final StatementBuilder statementBuilder;
protected ResultSetMetaData resultSetMetaData = null;
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -104,6 +104,7 @@ public class PrimaryKeyValidator {
});
}
jobManager.executeJobs(jobs);
CancellationHandler.checkForCancellation(null);
throwIfErrorFound();
}
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -256,7 +256,11 @@ public class Session {
public synchronized Connection getConnection() throws SQLException {
@SuppressWarnings("resource")
Connection con = local? connection.get() : temporaryTableSession == null? connection.get() : temporaryTableSession;
if (con == null && Boolean.TRUE.equals(sharesConnection.get())) {
con = defaultConnection;
}
if (con == null) {
try {
con = dataSource.getConnection();
@@ -319,13 +323,21 @@ public class Session {
/**
* Closes current connection and opens a new one.
*/
public void reconnect() throws SQLException {
public void reconnect() {
Connection con = connection.get();
if (con != null) {
if (temporaryTableScope == WorkingTableScope.TRANSACTION_LOCAL) {
con.commit();
try {
con.commit();
} catch (SQLException e) {
// ignore
}
}
try {
con.close();
} catch (SQLException e) {
// ignore
}
con.close();
connection.set(null);
if (con == temporaryTableSession) {
temporaryTableSession = null;
@@ -334,9 +346,17 @@ public class Session {
}
if (temporaryTableSession != null) {
if (temporaryTableScope == WorkingTableScope.TRANSACTION_LOCAL) {
temporaryTableSession.commit();
try {
temporaryTableSession.commit();
} catch (SQLException e) {
// ignore
}
}
try {
temporaryTableSession.close();
} catch (SQLException e) {
// ignore
}
temporaryTableSession.close();
temporaryTableSession = null;
}
}
@@ -408,6 +428,17 @@ public class Session {
return schema;
}
/**
* Executes a SQL-Query (SELECT).
*
* @param sqlQuery the query in SQL
* @param reader the reader for the result
* @param withExplicitCommit if <code>true</code>, switch of autocommit and commit explicitly
*/
public long executeQuery(String sqlQuery, ResultSetReader reader, boolean withExplicitCommit) throws SQLException {
return executeQuery(sqlQuery, reader, null, null, 0, withExplicitCommit);
}
/**
* Executes a SQL-Query (SELECT).
*
@@ -415,9 +446,23 @@ public class Session {
* @param reader the reader for the result
*/
public long executeQuery(String sqlQuery, ResultSetReader reader) throws SQLException {
return executeQuery(sqlQuery, reader, null, null, 0);
return executeQuery(sqlQuery, reader, null, null, 0, false);
}
/**
* Executes a SQL-Query (SELECT).
*
* @param sqlQuery the query in SQL
* @param reader the reader for the result
* @param alternativeSQL query to be executed if sqlQuery fails
* @param limit row limit, 0 for unlimited
* @param context cancellation context
* @param withExplicitCommit if <code>true</code>, switch of autocommit and commit explicitly
*/
public long executeQuery(String sqlQuery, ResultSetReader reader, String alternativeSQL, Object context, int limit, boolean withExplicitCommit) throws SQLException {
return executeQuery(sqlQuery, reader, alternativeSQL, context, limit, 0, withExplicitCommit);
}
/**
* Executes a SQL-Query (SELECT).
*
@@ -428,7 +473,7 @@ public class Session {
* @param context cancellation context
*/
public long executeQuery(String sqlQuery, ResultSetReader reader, String alternativeSQL, Object context, int limit) throws SQLException {
return executeQuery(sqlQuery, reader, alternativeSQL, context, limit, 0);
return executeQuery(sqlQuery, reader, alternativeSQL, context, limit, 0, false);
}
/**
@@ -441,8 +486,26 @@ public class Session {
* @param limit row limit, 0 for unlimited
* @param context cancellation context
* @param timeout the timeout in sec
* @param withExplicitCommit if <code>true</code>, switch of autocommit and commit explicitly
*/
private long executeQuery(Connection theConnection, String sqlQuery, ResultSetReader reader, String alternativeSQL, Object context, int limit, int timeout) throws SQLException {
private long executeQuery(Connection theConnection, String sqlQuery, ResultSetReader reader, String alternativeSQL, Object context, int limit, int timeout, boolean withExplicitCommit) throws SQLException {
if (withExplicitCommit) {
synchronized (theConnection) {
if (theConnection.getAutoCommit()) {
try {
theConnection.setAutoCommit(false);
return executeQuery(theConnection, sqlQuery, reader, alternativeSQL, context, limit, timeout, false);
} finally {
try {
theConnection.commit();
} catch (SQLException e) {
_log.warn("commit failed", e);
}
theConnection.setAutoCommit(true);
}
}
}
}
long rc = 0;
CancellationHandler.checkForCancellation(context);
long startTime = System.currentTimeMillis();
@@ -511,13 +574,14 @@ public class Session {
* @param limit row limit, 0 for unlimited
* @param context cancellation context
* @param timeout the timeout in sec
* @param withExplicitCommit if <code>true</code>, switch of autocommit and commit explicitly
*/
public long executeQuery(String sqlQuery, ResultSetReader reader, String alternativeSQL, Object context, int limit, int timeout) throws SQLException {
public long executeQuery(String sqlQuery, ResultSetReader reader, String alternativeSQL, Object context, int limit, int timeout, boolean withExplicitCommit) throws SQLException {
if (getLogStatements()) {
_log.info(sqlQuery);
}
try {
return executeQuery(connectionFactory.getConnection(), sqlQuery, reader, alternativeSQL, context, limit, timeout);
return executeQuery(connectionFactory.getConnection(), sqlQuery, reader, alternativeSQL, context, limit, timeout, withExplicitCommit);
} catch (SQLException e) {
CancellationHandler.checkForCancellation(context);
if (!silent) {
@@ -535,8 +599,9 @@ public class Session {
*
* @param sqlFile file containing a query in SQL
* @param reader the reader for the result
* @param withExplicitCommit if <code>true</code>, switch of autocommit and commit explicitly
*/
public void executeQuery(File sqlFile, ResultSetReader reader) throws SQLException {
public void executeQuery(File sqlFile, ResultSetReader reader, boolean withExplicitCommit) throws SQLException {
StringBuffer result = new StringBuffer();
try {
BufferedReader in = new BufferedReader(new FileReader(sqlFile));
@@ -551,7 +616,7 @@ public class Session {
throw new RuntimeException("Failed to load content of file", e);
}
executeQuery(result.toString(), reader);
executeQuery(result.toString(), reader, withExplicitCommit);
}
/**
@@ -879,9 +944,13 @@ public class Session {
synchronized (this) {
down = true;
}
_log.info("closing connection...");
_log.info("closing connections... (" + connections.size() + ")");
for (Connection con: connections) {
con.close();
try {
con.close();
} catch (Exception e) {
// ignore
}
}
closeTemporaryTableSession();
_log.info("connection closed");
@@ -967,7 +1036,7 @@ public class Session {
temporaryTableSession.close();
}
} catch(SQLException e) {
_log.error("can't close connection", e);
_log.warn("can't close connection", e);
}
temporaryTableSession = null;
}
@@ -1097,4 +1166,10 @@ public class Session {
return true;
}
private final static ThreadLocal<Boolean> sharesConnection = new ThreadLocal<Boolean>();
public static void setThreadSharesConnection() {
sharesConnection.set(true);
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -142,6 +142,13 @@ public class StatementBuilder {
return body.size();
}
/**
* Returns the items of the current statement.
*/
public List<String> getItems() {
return body;
}
/**
* Gets the maximal size of a body-list.
*/
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -467,35 +467,35 @@ public class DataModel {
} catch (Exception e) {
// ignore
}
// order columns
if (!columnOrderPrio.isEmpty()) {
final Map<Column, ColumnOrderPriority> prio = new IdentityHashMap<>();
String prefix = line.cells.get(0).trim().length() == 0? "" : (line.cells.get(0).trim() + ".");
for (Column column: columns) {
ColumnOrderPriority columnOrderPriority = columnOrderPrio.get(prefix + Quoting.normalizeIdentifier(column.name));
if (columnOrderPriority == null) {
columnOrderPriority = columnOrderPrio.get(Quoting.normalizeIdentifier(column.name));
}
prio.put(column, columnOrderPriority);
}
// order columns
if (!columnOrderPrio.isEmpty()) {
final Map<Column, ColumnOrderPriority> prio = new IdentityHashMap<>();
String prefix = line.cells.get(0).trim().length() == 0? "" : (line.cells.get(0).trim() + ".");
for (Column column: columns) {
ColumnOrderPriority columnOrderPriority = columnOrderPrio.get(prefix + Quoting.normalizeIdentifier(column.name));
if (columnOrderPriority == null) {
columnOrderPriority = columnOrderPrio.get(Quoting.normalizeIdentifier(column.name));
}
Collections.sort(columns, new Comparator<Column>() {
@Override
public int compare(Column a, Column b) {
ColumnOrderPriority prioA = prio.get(a);
ColumnOrderPriority prioB = prio.get(b);
if (prioA != prioB) {
if (prioA == ColumnOrderPriority.HI) {
return -1;
} else if (prioA == ColumnOrderPriority.LO) {
return 1;
} else {
return prioB == ColumnOrderPriority.HI? 1 : -1;
}
}
return 0;
}
});
prio.put(column, columnOrderPriority);
}
Collections.sort(columns, new Comparator<Column>() {
@Override
public int compare(Column a, Column b) {
ColumnOrderPriority prioA = prio.get(a);
ColumnOrderPriority prioB = prio.get(b);
if (prioA != prioB) {
if (prioA == ColumnOrderPriority.HI) {
return -1;
} else if (prioA == ColumnOrderPriority.LO) {
return 1;
} else {
return prioB == ColumnOrderPriority.HI? 1 : -1;
}
}
return 0;
}
});
}
Table table = tables.get(SqlUtil.mappedSchema(sourceSchemaMapping, line.cells.get(0)));
if (table != null) {
@@ -885,7 +885,7 @@ public class DataModel {
private static final long serialVersionUID = 4523935351640139649L;
public final Table table;
public NoPrimaryKeyException(Table table, String message) {
super("Table '" + table.getName() + "' " + message);
super((table == null? "Subject table " : ("Table '" + table.getName() + "' ")) + message);
this.table = table;
}
public NoPrimaryKeyException(Table table) {
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -205,7 +205,7 @@ public class PrimaryKeyFactory {
toIgnore.add(table);
}
}
executionContext.setUpkDomain(upkDomain);
}
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,6 +39,7 @@ import net.sf.jailer.database.TemporaryTableManager;
import net.sf.jailer.database.WorkingTableScope;
import net.sf.jailer.datamodel.Column;
import net.sf.jailer.datamodel.DataModel;
import net.sf.jailer.datamodel.PrimaryKey;
import net.sf.jailer.datamodel.RowIdSupport;
import net.sf.jailer.util.PrintUtil;
import net.sf.jailer.util.Quoting;
@@ -143,13 +144,17 @@ public class DDLCreator {
String template = "script" + File.separator + "ddl-template.sql";
String contraint = pkColumnConstraint(session);
Map<String, String> typeReplacement = targetDBMS(session).getTypeReplacement();
String universalPrimaryKey = rowIdSupport.getUniversalPrimaryKey().toSQL(null, contraint, typeReplacement);
PrimaryKey upk = rowIdSupport.getUniversalPrimaryKey();
if (upk.getColumns().isEmpty()) {
throw new DataModel.NoPrimaryKeyException(null);
}
String universalPrimaryKey = upk.toSQL(null, contraint, typeReplacement);
Map<String, String> arguments = new HashMap<String, String>();
arguments.put("upk", universalPrimaryKey);
arguments.put("upk-hash", "" + ((universalPrimaryKey + targetDBMS(session).getTableProperties()).hashCode()));
arguments.put("pre", rowIdSupport.getUniversalPrimaryKey().toSQL("PRE_", contraint, typeReplacement));
arguments.put("from", rowIdSupport.getUniversalPrimaryKey().toSQL("FROM_", contraint, typeReplacement));
arguments.put("to", rowIdSupport.getUniversalPrimaryKey().toSQL("TO_", contraint, typeReplacement));
arguments.put("pre", upk.toSQL("PRE_", contraint, typeReplacement));
arguments.put("from", upk.toSQL("FROM_", contraint, typeReplacement));
arguments.put("to", upk.toSQL("TO_", contraint, typeReplacement));
arguments.put("version", "" + JailerVersion.WORKING_TABLE_VERSION);
arguments.put("constraint", contraint);
@@ -187,15 +192,15 @@ public class DDLCreator {
Map<String, List<String>> listArguments = new HashMap<String, List<String>>();
if (indexType == 0) {
// full index
listArguments.put("column-list", Collections.singletonList(", " + rowIdSupport.getUniversalPrimaryKey().columnList(null)));
listArguments.put("column-list-from", Collections.singletonList(", " + rowIdSupport.getUniversalPrimaryKey().columnList("FROM_")));
listArguments.put("column-list-to", Collections.singletonList(", " + rowIdSupport.getUniversalPrimaryKey().columnList("TO_")));
listArguments.put("column-list", Collections.singletonList(", " + upk.columnList(null)));
listArguments.put("column-list-from", Collections.singletonList(", " + upk.columnList("FROM_")));
listArguments.put("column-list-to", Collections.singletonList(", " + upk.columnList("TO_")));
} else if (indexType == 1) {
// single column indexes
List<String> cl = new ArrayList<String>();
List<String> clFrom = new ArrayList<String>();
List<String> clTo = new ArrayList<String>();
for (Column c : rowIdSupport.getUniversalPrimaryKey().getColumns()) {
for (Column c : upk.getColumns()) {
cl.add(", " + c.name);
clFrom.add(", FROM_" + c.name);
clTo.add(", FROM_" + c.name);
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -568,4 +568,19 @@ public abstract class EntityGraph {
}
}
protected void addExportedCount(long count) {
Long cnt = (Long) getSession().getSessionProperty(EntityGraph.class, "ExportedCount");
if (cnt == null) {
cnt = count;
} else {
cnt += count;
}
getSession().setSessionProperty(EntityGraph.class, "ExportedCount", cnt);
}
public long getExportedCount() {
Long cnt = (Long) getSession().getSessionProperty(EntityGraph.class, "ExportedCount");
return cnt == null? 0 : cnt;
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -254,6 +254,7 @@ public class IntraDatabaseEntityGraph extends RemoteEntityGraph {
}
}
executionContext.getProgressListenerRegistry().fireExported(table, rc);
addExportedCount(rc);
}
/**
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -113,6 +113,15 @@ public class LocalEntityGraph extends EntityGraph {
return new CellContentConverter(resultSetMetaData, localSession, localSession.dbms);
}
@Override
public void close() throws SQLException {
if (DBMS.POSTGRESQL.equals(remoteSession.dbms) && statementBuilder.size() == 1) {
process("(Select " + statementBuilder.getItems().get(0) + " Union Select " + statementBuilder.getItems().get(0) + ") " + name);
} else {
super.close();
}
}
}
private abstract class LocalInlineViewBuilder extends InlineViewBuilder {
@@ -747,6 +756,7 @@ public class LocalEntityGraph extends EntityGraph {
orderBy,
reader);
executionContext.getProgressListenerRegistry().fireExported(table, rc);
addExportedCount(rc);
}
});
}
@@ -806,6 +816,7 @@ public class LocalEntityGraph extends EntityGraph {
sqlQuery + orderBy,
reader);
executionContext.getProgressListenerRegistry().fireExported(table, rc);
addExportedCount(rc);
}
});
}
@@ -879,6 +890,7 @@ public class LocalEntityGraph extends EntityGraph {
rc[0] += lrc;
if (fireProgressEvents) {
executionContext.getProgressListenerRegistry().fireExported(table, lrc);
addExportedCount(lrc);
}
}
});
@@ -1077,7 +1089,7 @@ public class LocalEntityGraph extends EntityGraph {
final int setId = getNextSetId();
final long[] rc = new long[1];
String selectEB =
"Select " + upkColumnList(association.destination, "EB", "") + " from " + dmlTableReference(ENTITY, localSession) + " EB " +
"Where " + (deletedEntitiesAreMarked? "EB.birthday>=0 and " : "") +
@@ -1088,12 +1100,14 @@ public class LocalEntityGraph extends EntityGraph {
@Override
protected void process(String inlineView) throws SQLException {
String sep = upkMatch(association.source).isEmpty()? "" : ", ";
String selectSource =
"Select distinct " + upkColumnList(association.destination, "EB", "") + ", " + pkList(association.source, sourceAlias, "") + " from " + inlineView + " " +
"Select distinct " + upkColumnList(association.destination, "EB", "") + sep + pkList(association.source, sourceAlias, "") + " from " + inlineView + " " +
"join " + quoting.requote(association.destination.getName()) + " " + destAlias + " on "+ pkEqualsEntityID(association.destination, destAlias, "EB", "", false) + " " +
"join " + quoting.requote(association.source.getName()) + " " + sourceAlias + " " + " on " + jc;
remoteSession.executeQuery(selectSource, new LocalInlineViewBuilder("EBA", upkColumnList(association.destination, null, "EB") + ", " + upkColumnList(association.source, "A"), true) {
remoteSession.executeQuery(selectSource, new LocalInlineViewBuilder("EBA", upkColumnList(association.destination, null, "EB") + sep + upkColumnList(association.source, "A"), true) {
@Override
protected void process(String inlineView) throws SQLException {
@@ -1114,7 +1128,7 @@ public class LocalEntityGraph extends EntityGraph {
"Select distinct " + setId + ", " + typeName(association.destination) + ", " + upkColumnList(association.destination, "EBA", "EB") +
" from " + inlineView + (deletedEntitiesAreMarked? " join " : " left join ") + dmlTableReference(ENTITY, localSession) + " EA" +
" on EA.r_entitygraph=" + graphID + " and EA.type=" + typeName(association.source) + "" +
" and " + eBAEqualsEA +
(eBAEqualsEA.length() > 0? " and " + eBAEqualsEA : "") +
" Where " + (deletedEntitiesAreMarked? "EA.birthday=-1" : "EA.type is null");
String remove = "Insert into " + dmlTableReference(ENTITY_SET_ELEMENT, localSession) +
@@ -1213,6 +1227,7 @@ public class LocalEntityGraph extends EntityGraph {
}
long rc = remoteSession.executeQuery(select, reader);
executionContext.getProgressListenerRegistry().fireExported(table, rc);
addExportedCount(rc);
}
});
}
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -527,8 +527,9 @@ public class RemoteEntityGraph extends EntityGraph {
pkEqualsEntityID(table, "T", "E") +
" Where E.birthday=0 and E.r_entitygraph=" + graphID + " and E.type=" + typeName(table) + "" +
orderBy,
reader);
reader, withExplicitCommit());
executionContext.getProgressListenerRegistry().fireExported(table, rc);
addExportedCount(rc);
}
/**
@@ -565,8 +566,9 @@ public class RemoteEntityGraph extends EntityGraph {
long rc = session.executeQuery(
sqlQuery + (orderByPK? orderBy : ""),
reader,
(!orderByPK? sqlQuery : null), null, 0);
(!orderByPK? sqlQuery : null), null, 0, withExplicitCommit());
executionContext.getProgressListenerRegistry().fireExported(table, rc);
addExportedCount(rc);
}
/**
@@ -604,6 +606,7 @@ public class RemoteEntityGraph extends EntityGraph {
Session.ResultSetReader reader = getTransformerFactory().create(table);
long rc = readEntities(table, orderByPK, reader);
executionContext.getProgressListenerRegistry().fireExported(table, rc);
addExportedCount(rc);
}
/**
@@ -631,7 +634,7 @@ public class RemoteEntityGraph extends EntityGraph {
String sqlQuery = "Select " + columnList + " From " + dmlTableReference(ENTITY, session) + " E join " + quoting.requote(table.getName()) + " T on " +
pkEqualsEntityID(table, "T", "E") +
" Where E.birthday>=0 and E.r_entitygraph=" + graphID + " and E.type=" + typeName(table) + "";
return session.executeQuery(sqlQuery, reader);
return session.executeQuery(sqlQuery, reader, withExplicitCommit());
}
/**
@@ -648,13 +651,17 @@ public class RemoteEntityGraph extends EntityGraph {
if (orderByPK) {
String sqlQueryWithOrderBy = sqlQuery +
(orderByPK? " order by " + rowIdSupport.getPrimaryKey(table).columnList("T.", quoting) : "");
rc = session.executeQuery(sqlQueryWithOrderBy, reader, sqlQuery, null, 0);
rc = session.executeQuery(sqlQueryWithOrderBy, reader, sqlQuery, null, 0, withExplicitCommit());
} else {
rc = session.executeQuery(sqlQuery, reader);
rc = session.executeQuery(sqlQuery, reader, withExplicitCommit());
}
return rc;
}
private boolean withExplicitCommit() {
return DBMS.POSTGRESQL.equals(session.dbms);
}
/**
* Updates columns of a table.
*
@@ -919,8 +926,9 @@ public class RemoteEntityGraph extends EntityGraph {
" and D.from_type=" + typeName(association.source) + " and assoc=" + association.getId() +
" and D.r_entitygraph=" + graphID;
}
long rc = session.executeQuery(select, reader);
long rc = session.executeQuery(select, reader, withExplicitCommit());
executionContext.getProgressListenerRegistry().fireExported(table, rc);
addExportedCount(rc);
}
/**
@@ -960,7 +968,7 @@ public class RemoteEntityGraph extends EntityGraph {
" Where (traversed is null or traversed <> 1)" +
" and D.from_type=" + typeName(table) + "" +
" and D.r_entitygraph=" + graphID;
session.executeQuery(select, reader);
session.executeQuery(select, reader, withExplicitCommit());
}
/**
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -449,6 +449,10 @@ public class ExtractionModel {
if (dmf.size() > 0) {
return dmf.get(0).cells.get(0);
}
List<CsvFile.Line> csv = new CsvFile(new File(fileName), "export modus").getLines();
if (csv.isEmpty()) {
throw new RuntimeException(fileName + "' is not a valid Jailer extraction model");
}
return null;
}
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -412,7 +412,12 @@ public class JDBCMetaDataBasedModelElementFinder implements ModelElementFinder {
Map<String, Map<Integer, Column>> pkColumns = new HashMap<String, Map<Integer, Column>>();
for (String tableName: tableNames) {
Table tmp = new Table(tableName, null, false, false);
resultSet = getPrimaryKeys(session, metaData, quoting.unquote(tmp.getOriginalSchema(quoting.quote(introspectionSchema))), quoting.unquote(tmp.getUnqualifiedName()), true);
resultSet = null;
try {
resultSet = getPrimaryKeys(session, metaData, quoting.unquote(tmp.getOriginalSchema(quoting.quote(introspectionSchema))), quoting.unquote(tmp.getUnqualifiedName()), true);
} catch (Exception e) {
_log.warn("can't get PK for " + tableName, e);
}
Map<Integer, Column> pk = pkColumns.get(tableName);
if (pk == null) {
pk = new HashMap<Integer, Column>();
@@ -420,7 +425,7 @@ public class JDBCMetaDataBasedModelElementFinder implements ModelElementFinder {
}
boolean hasPK = false;
int nextKeySeq = 0;
while (resultSet.next()) {
while (resultSet != null && resultSet.next()) {
hasPK = true;
int keySeq = resultSet.getInt(5);
if (DBMS.SQLITE.equals(session.dbms)) {
@@ -434,7 +439,9 @@ public class JDBCMetaDataBasedModelElementFinder implements ModelElementFinder {
hasPK = findUniqueIndexBasedKey(metaData, quoting, session, tmp, pk, tableTypes.get(tableName));
}
_log.info((hasPK? "" : "no ") + "primary key found for table " + tableName);
resultSet.close();
if (resultSet != null) {
resultSet.close();
}
CancellationHandler.checkForCancellation(null);
}
for (String tableName: tableNames) {
@@ -1478,3 +1485,4 @@ public class JDBCMetaDataBasedModelElementFinder implements ModelElementFinder {
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -143,8 +143,9 @@ public class MemorizedResultSet implements ResultSet {
Object c;
if (columnIndex > row.length) {
c = null;
} else {
c = row[columnIndex - 1];
}
c = row[columnIndex - 1];
wasNull = c == null;
return c;
}
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -174,7 +174,7 @@ public class MetaDataCache {
while (rs.next()) {
Object[] row = new Object[numCol];
for (int i = 1; i < numCol; ++i) {
for (int i = 1; i <= numCol; ++i) {
if (i >= 22 && DBMS.MSSQL.equals(session.dbms)) {
row[i - 1] = null;
} else {
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,6 +47,7 @@ import net.sf.jailer.datamodel.Table;
import net.sf.jailer.importfilter.ImportFilterManager;
import net.sf.jailer.util.CsvFile;
import net.sf.jailer.util.CsvFile.Line;
import net.sf.jailer.util.PrintUtil;
import net.sf.jailer.util.Quoting;
import net.sf.jailer.util.SqlUtil;
@@ -154,11 +155,11 @@ public class ModelBuilder {
for (Line line: source.getLines()) {
String key = line.cells.get(keyColumn);
destLines.remove(key);
result.append(line.toString() + "\n");
result.append(line.toString() + PrintUtil.LINE_SEPARATOR);
}
for (Line line: destLines.values()) {
result.append(line.toString() + "\n");
result.append(line.toString() + PrintUtil.LINE_SEPARATOR);
}
writeFile(destFile, header + result.toString());
@@ -210,7 +211,11 @@ public class ModelBuilder {
StringBuilder columnsDefinition = new StringBuilder();
CsvFile excludeTablesCSV = getExcludeTablesCSV(executionContext);
Map<String, Table> allTablesSet = new TreeMap<String, Table>();
for (Table table: allTables) {
allTablesSet.put(table.getName(), table);
}
for (Table table: allTablesSet.values()) {
if (!isJailerTable(table, quoting) &&
!excludeTablesCSV.contains(new String[] { table.getName()}) &&
!excludeTablesCSV.contains(new String[] { table.getName().toUpperCase() })) {
@@ -223,7 +228,7 @@ public class ModelBuilder {
columnsDefinition.append(CsvFile.encodeCell(c.toSQL(null) + (c.isIdentityColumn? " identity" : "") + (c.isVirtual? " virtual" : "") + (c.isNullable? " null" : "")) + "; ");
knownIdentifiers.putColumnName(table.getName(), c.name);
}
columnsDefinition.append("\n");
columnsDefinition.append(PrintUtil.LINE_SEPARATOR);
}
}
}
@@ -256,7 +261,7 @@ public class ModelBuilder {
String warning = "Table '" + table.getName() + "' has no primary key";
if (table.primaryKey.getColumns().size() == 0) {
warnings.append(warning + "\n");
warnings.append(warning + PrintUtil.LINE_SEPARATOR);
} else {
warning += ", taking manually defined key.";
}
@@ -266,7 +271,7 @@ public class ModelBuilder {
for (Column pk: table.primaryKey.getColumns()) {
tableDefinitions += CsvFile.encodeCell(pk.toString()) + ";";
}
tableDefinitions += " ;" + CsvFile.encodeCell(table.getAuthor()) + ";\n";
tableDefinitions += " ;" + CsvFile.encodeCell(table.getAuthor()) + ";" + PrintUtil.LINE_SEPARATOR;
}
}
@@ -306,7 +311,6 @@ public class ModelBuilder {
}
}
String associationDefinition = "";
Set<String> names = new HashSet<String>();
for (Table table: dataModel.getTables()) {
for (Association association: table.associations) {
@@ -315,6 +319,9 @@ public class ModelBuilder {
}
}
}
Map<String, String> assocLines = new TreeMap<String, String>();
for (Association association: associationsToWrite) {
String firstInsert = " ";
if (association.isInsertSourceBeforeDestination()) {
@@ -350,15 +357,19 @@ public class ModelBuilder {
}
}
names.add(name);
associationDefinition += CsvFile.encodeCell(association.source.getName()) + "; " + CsvFile.encodeCell(association.destination.getName()) + "; " + firstInsert + "; " + card + "; " + CsvFile.encodeCell(association.getJoinCondition()) +
"; " + CsvFile.encodeCell(name) + "; " + CsvFile.encodeCell(association.getAuthor()) + ";\n";
assocLines.put(name, CsvFile.encodeCell(association.source.getName()) + "; " + CsvFile.encodeCell(association.destination.getName()) + "; " + firstInsert + "; " + card + "; " + CsvFile.encodeCell(association.getJoinCondition()) +
"; " + CsvFile.encodeCell(name) + "; " + CsvFile.encodeCell(association.getAuthor()));
}
resetAssociationFile(associationDefinition, executionContext);
StringBuilder associationDefinition = new StringBuilder();
for (String line: assocLines.values()) {
associationDefinition.append(line + PrintUtil.LINE_SEPARATOR);
}
resetAssociationFile(associationDefinition.toString(), executionContext);
}
private static String ASSOC_HEADER = "# generated by Jailer\n\n" +
"# Table A; Table B; first-insert; cardinality (opt); join-condition; name; author\n";
private static String ASSOC_HEADER = "# Table A; Table B; First-insert; Cardinality (opt); Join-condition; Name; Author" + PrintUtil.LINE_SEPARATOR;
private static void resetAssociationFile(String associationDefinition, ExecutionContext executionContext) throws IOException {
writeFile(getModelBuilderAssociationsFilename(executionContext),
@@ -366,8 +377,7 @@ public class ModelBuilder {
associationDefinition);
}
private static String TABLE_HEADER = "# generated by Jailer\n\n" +
"# Name; upsert; primary key; ; author\n";
private static String TABLE_HEADER = "# Name; Upsert; Primary Key; ; Author" + PrintUtil.LINE_SEPARATOR;
private static void resetTableFile(String tableDefinitions, ExecutionContext executionContext) throws IOException {
writeFile(getModelBuilderTablesFilename(executionContext),
@@ -375,8 +385,7 @@ public class ModelBuilder {
tableDefinitions);
}
private static String COLUMN_HEADER = "# generated by Jailer\n\n" +
"# Table; columns\n";
private static String COLUMN_HEADER = "# Table; Columns" + PrintUtil.LINE_SEPARATOR;
private static void resetColumnsFile(String columnsDefinitions, ExecutionContext executionContext) throws IOException {
writeFile(getModelBuilderColumnsFilename(executionContext),
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2007 - 2019 the original author or authors.
* Copyright 2007 - 2019 Ralf Wisser.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

Some files were not shown because too many files have changed in this diff Show More