diff --git a/pom.xml b/pom.xml index fbbfa22..d67d1a8 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 de.jlo.talendcomp jlo-talendcomp-tabletransfer - 12.1 + 13.0 Table Transfer Components Jan Lolling @@ -25,7 +25,7 @@ org.postgresql postgresql - 42.4.2 + 42.5.1 test diff --git a/src/main/java/de/jlo/datamodel/generator/SQLCodeGenerator.java b/src/main/java/de/jlo/datamodel/generator/SQLCodeGenerator.java index be92726..968088d 100755 --- a/src/main/java/de/jlo/datamodel/generator/SQLCodeGenerator.java +++ b/src/main/java/de/jlo/datamodel/generator/SQLCodeGenerator.java @@ -74,11 +74,26 @@ public SQLCodeGenerator() { keywordList.add("database"); keywordList.add("table"); keywordList.add("schema"); + keywordList.add("order"); + keywordList.add("limit"); + keywordList.add("length"); + keywordList.add("from"); + keywordList.add("where"); + keywordList.add("insert"); + keywordList.add("update"); + keywordList.add("delete"); + keywordList.add("having"); + keywordList.add("group"); + keywordList.add("with"); + keywordList.add("column"); } public void addKeyword(String word) { - if (keywordList.contains(word) == false) { - keywordList.add(word); + if (word != null && word.trim().isEmpty() == false) { + word = word.trim(); + if (keywordList.contains(word) == false) { + keywordList.add(word); + } } } diff --git a/src/main/java/de/jlo/talendcomp/tabletransfer/TableTransfer.java b/src/main/java/de/jlo/talendcomp/tabletransfer/TableTransfer.java index 2ec0350..e36e969 100644 --- a/src/main/java/de/jlo/talendcomp/tabletransfer/TableTransfer.java +++ b/src/main/java/de/jlo/talendcomp/tabletransfer/TableTransfer.java @@ -1994,21 +1994,31 @@ protected void setupKeywords(Connection conn, SQLCodeGenerator codeGen) throws S if (numKeyWords != null && numKeyWords.trim().isEmpty() == false) { String[] words = numKeyWords.split(","); for (String w : words) { - codeGen.addKeyword(w.trim()); + codeGen.addKeyword(w); } } String sqlKeyWords = dbmd.getSQLKeywords(); if (sqlKeyWords != null && sqlKeyWords.trim().isEmpty() == false) { String[] words = sqlKeyWords.split(","); for (String w : words) { - codeGen.addKeyword(w.trim()); + codeGen.addKeyword(w); } } String stringKeyWords = dbmd.getStringFunctions(); if (stringKeyWords != null && stringKeyWords.trim().isEmpty() == false) { String[] words = sqlKeyWords.split(","); for (String w : words) { - codeGen.addKeyword(w.trim()); + codeGen.addKeyword(w); + } + } + } + + public void setKeywords(String keywords) throws SQLException { + if (keywords != null && keywords.trim().isEmpty() == false) { + String[] array = keywords.split(",;|"); + for (String keyword : array) { + getTargetCodeGenerator().addKeyword(keyword); + getSourceCodeGenerator().addKeyword(keyword); } } } diff --git a/talend_component/tMysqlTableTransfer/jlo-talendcomp-tabletransfer-12.1.jar b/talend_component/tDB2TableTransfer/jlo-talendcomp-tabletransfer-13.0.jar similarity index 66% rename from talend_component/tMysqlTableTransfer/jlo-talendcomp-tabletransfer-12.1.jar rename to talend_component/tDB2TableTransfer/jlo-talendcomp-tabletransfer-13.0.jar index 313350b..e75845d 100644 Binary files a/talend_component/tMysqlTableTransfer/jlo-talendcomp-tabletransfer-12.1.jar and b/talend_component/tDB2TableTransfer/jlo-talendcomp-tabletransfer-13.0.jar differ diff --git a/talend_component/tDB2TableTransfer/tDB2TableTransfer_begin.javajet b/talend_component/tDB2TableTransfer/tDB2TableTransfer_begin.javajet index fb5dcf4..1066d9c 100644 --- a/talend_component/tDB2TableTransfer/tDB2TableTransfer_begin.javajet +++ b/talend_component/tDB2TableTransfer/tDB2TableTransfer_begin.javajet @@ -74,14 +74,13 @@ valueRangeColumn = "null"; } boolean onlyUpdate = "true".equals(ElementParameterParser.getValue(node, "__ONLY_UPDATE_NO_INSERT__")); - boolean log4jEnabled = "true".equals(org.talend.core.model.process.ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__")) && - "JOBLET".equals(node.getComponent().getComponentType().toString()) == false; + String keywordList = ElementParameterParser.getObjectValue(node, "__ADDITIONAL_KEYWORDS__"); + if (keywordList == null && keywordList.trim().isEmpty()) { + keywordList = "null"; + } %> de.jlo.talendcomp.tabletransfer.TableTransfer <%=cid%> = new de.jlo.talendcomp.tabletransfer.TableTransfer(); -<% if (log4jEnabled) { %> - <%=cid%>.setLogger(log); -<% } %> <%=cid%>.setDoCommit(<%=doCommit%>); <%=cid%>.setRunOnlyUpdates(<%=onlyUpdate%>); <% if (typeMap != null) { @@ -114,6 +113,7 @@ <% } %> <%=cid%>.setKeepDataModels(<%=reuseModel%>, jobName + "_" + <%=cid%>); <%=cid%>.setupDataModels(); + <%=cid%>.setKeywords(<%=keywordList%>); <% if (useQuery) { %> // use our own query as source String <%=cid%>_query = <%=sourceQuery%>; diff --git a/talend_component/tDB2TableTransfer/tDB2TableTransfer_java.xml b/talend_component/tDB2TableTransfer/tDB2TableTransfer_java.xml index a4c6d91..f254dd4 100644 --- a/talend_component/tDB2TableTransfer/tDB2TableTransfer_java.xml +++ b/talend_component/tDB2TableTransfer/tDB2TableTransfer_java.xml @@ -1,7 +1,7 @@ -
+
@@ -157,16 +157,17 @@ + false - - Release: 12.1 build at: 20220822 + + Release: 13.0 build at: 20221128 - + diff --git a/talend_component/tDB2TableTransfer/tDB2TableTransfer_messages.properties b/talend_component/tDB2TableTransfer/tDB2TableTransfer_messages.properties index d3522d2..eabb62c 100644 --- a/talend_component/tDB2TableTransfer/tDB2TableTransfer_messages.properties +++ b/talend_component/tDB2TableTransfer/tDB2TableTransfer_messages.properties @@ -68,4 +68,5 @@ TRIM_TEXT_VALUES.NAME=Trim text values ENABLE_CHECK_CONNECTION.NAME=Enable check target connection while idle CHECK_CONNECTION_STATEMENT.NAME=Statement to simply test the connection (must be something very cheap!) ONLY_UPDATE_NO_INSERT.NAME=Only Update, No Insert -REMOVE_NONE_UTF8_CHARACTERS.NAME=Remove none-UTF8 characters in char typed field content read from source \ No newline at end of file +REMOVE_NONE_UTF8_CHARACTERS.NAME=Remove none-UTF8 characters in char typed field content read from source +ADDITIONAL_KEYWORDS.NAME=Additional SQL Keywords (comma separated list) \ No newline at end of file diff --git a/talend_component/tEXATableTransfer/jlo-talendcomp-tabletransfer-13.0.jar b/talend_component/tEXATableTransfer/jlo-talendcomp-tabletransfer-13.0.jar new file mode 100644 index 0000000..4439efa Binary files /dev/null and b/talend_component/tEXATableTransfer/jlo-talendcomp-tabletransfer-13.0.jar differ diff --git a/talend_component/tEXATableTransfer/tEXATableTransfer_begin.javajet b/talend_component/tEXATableTransfer/tEXATableTransfer_begin.javajet index 218d6dd..7284ac4 100644 --- a/talend_component/tEXATableTransfer/tEXATableTransfer_begin.javajet +++ b/talend_component/tEXATableTransfer/tEXATableTransfer_begin.javajet @@ -65,13 +65,12 @@ valueRangeColumn = "null"; } boolean onlyUpdate = "true".equals(ElementParameterParser.getValue(node, "__ONLY_UPDATE_NO_INSERT__")); - boolean log4jEnabled = "true".equals(org.talend.core.model.process.ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__")) && - "JOBLET".equals(node.getComponent().getComponentType().toString()) == false; + String keywordList = ElementParameterParser.getObjectValue(node, "__ADDITIONAL_KEYWORDS__"); + if (keywordList == null && keywordList.trim().isEmpty()) { + keywordList = "null"; + } %> de.jlo.talendcomp.tabletransfer.TableTransfer <%=cid%> = new de.jlo.talendcomp.tabletransfer.TableTransfer(); -<% if (log4jEnabled) { %> - <%=cid%>.setLogger(log); -<% } %> <%=cid%>.setDoCommit(<%=doCommit%>); <%=cid%>.setRunOnlyUpdates(<%=onlyUpdate%>); <% if (typeMap != null) { @@ -106,6 +105,7 @@ <% } %> <%=cid%>.setKeepDataModels(<%=reuseModel%>, jobName + "_" + <%=cid%>); <%=cid%>.setupDataModels(); + <%=cid%>.setKeywords(<%=keywordList%>); <% if (useQuery) { %> // use our own query as source String <%=cid%>_query = <%=sourceQuery%>; diff --git a/talend_component/tEXATableTransfer/tEXATableTransfer_java.xml b/talend_component/tEXATableTransfer/tEXATableTransfer_java.xml index 39ee17c..e65d91b 100644 --- a/talend_component/tEXATableTransfer/tEXATableTransfer_java.xml +++ b/talend_component/tEXATableTransfer/tEXATableTransfer_java.xml @@ -1,7 +1,7 @@ -
+
@@ -151,16 +151,17 @@ + false - - Release: 12.1 build at: 20220822 + + Release: 13.0 build at: 20221128 - + diff --git a/talend_component/tEXATableTransfer/tEXATableTransfer_messages.properties b/talend_component/tEXATableTransfer/tEXATableTransfer_messages.properties index 16c9abd..e29840c 100644 --- a/talend_component/tEXATableTransfer/tEXATableTransfer_messages.properties +++ b/talend_component/tEXATableTransfer/tEXATableTransfer_messages.properties @@ -67,4 +67,5 @@ TRIM_TEXT_VALUES.NAME=Trim text values ENABLE_CHECK_CONNECTION.NAME=Enable check target connection while idle CHECK_CONNECTION_STATEMENT.NAME=Statement to simply test the connection (must be something very cheap!) ONLY_UPDATE_NO_INSERT.NAME=Only Update, No Insert -REMOVE_NONE_UTF8_CHARACTERS.NAME=Remove none-UTF8 characters in char typed field content read from source \ No newline at end of file +REMOVE_NONE_UTF8_CHARACTERS.NAME=Remove none-UTF8 characters in char typed field content read from source +ADDITIONAL_KEYWORDS.NAME=Additional SQL Keywords (comma separated list) \ No newline at end of file diff --git a/talend_component/tDB2TableTransfer/jlo-talendcomp-tabletransfer-12.1.jar b/talend_component/tMysqlTableTransfer/jlo-talendcomp-tabletransfer-13.0.jar similarity index 66% rename from talend_component/tDB2TableTransfer/jlo-talendcomp-tabletransfer-12.1.jar rename to talend_component/tMysqlTableTransfer/jlo-talendcomp-tabletransfer-13.0.jar index 3edc012..d9e17ad 100644 Binary files a/talend_component/tDB2TableTransfer/jlo-talendcomp-tabletransfer-12.1.jar and b/talend_component/tMysqlTableTransfer/jlo-talendcomp-tabletransfer-13.0.jar differ diff --git a/talend_component/tMysqlTableTransfer/tMysqlTableTransfer_begin.javajet b/talend_component/tMysqlTableTransfer/tMysqlTableTransfer_begin.javajet index d31551d..f9cf9b7 100644 --- a/talend_component/tMysqlTableTransfer/tMysqlTableTransfer_begin.javajet +++ b/talend_component/tMysqlTableTransfer/tMysqlTableTransfer_begin.javajet @@ -65,14 +65,13 @@ } boolean onlyUpdate = "true".equals(ElementParameterParser.getValue(node, "__ONLY_UPDATE_NO_INSERT__")); String onConflict = ElementParameterParser.getValue(node, "__ON_CONFLICT__"); - boolean log4jEnabled = "true".equals(org.talend.core.model.process.ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__")) && - "JOBLET".equals(node.getComponent().getComponentType().toString()) == false; + String keywordList = ElementParameterParser.getObjectValue(node, "__ADDITIONAL_KEYWORDS__"); + if (keywordList == null && keywordList.trim().isEmpty()) { + keywordList = "null"; + } %> de.jlo.talendcomp.tabletransfer.MysqlTableTransfer <%=cid%> = new de.jlo.talendcomp.tabletransfer.MysqlTableTransfer(); -<% if (log4jEnabled) { %> - <%=cid%>.setLogger(log); -<% } %> <%=cid%>.setDoCommit(<%=doCommit%>); <%=cid%>.setRunOnlyUpdates(<%=onlyUpdate%>); <% if (onlyUpdate == false) { @@ -115,6 +114,7 @@ <% } %> <%=cid%>.setKeepDataModels(<%=reuseModel%>, jobName + "_" + <%=cid%>); <%=cid%>.setupDataModels(); + <%=cid%>.setKeywords(<%=keywordList%>); <% if (useQuery) { %> // use our own query as source String <%=cid%>_query = <%=sourceQuery%>; diff --git a/talend_component/tMysqlTableTransfer/tMysqlTableTransfer_java.xml b/talend_component/tMysqlTableTransfer/tMysqlTableTransfer_java.xml index 57c5846..327edaf 100644 --- a/talend_component/tMysqlTableTransfer/tMysqlTableTransfer_java.xml +++ b/talend_component/tMysqlTableTransfer/tMysqlTableTransfer_java.xml @@ -1,7 +1,7 @@ -
+
@@ -162,16 +162,17 @@ + false - - Release: 12.1 build at: 20220822 + + Release: 13.0 build at: 20221128 - + diff --git a/talend_component/tMysqlTableTransfer/tMysqlTableTransfer_messages.properties b/talend_component/tMysqlTableTransfer/tMysqlTableTransfer_messages.properties index 36c113b..4538660 100644 --- a/talend_component/tMysqlTableTransfer/tMysqlTableTransfer_messages.properties +++ b/talend_component/tMysqlTableTransfer/tMysqlTableTransfer_messages.properties @@ -78,4 +78,5 @@ STRICT_SOURCE_FIELD_MAPPING.NAME=Strict field mapping for source fields TRIM_TEXT_VALUES.NAME=Trim text values ENABLE_CHECK_CONNECTION.NAME=Enable check target connection while idle CHECK_CONNECTION_STATEMENT.NAME=Statement to simply test the connection (must be something very cheap!) -REMOVE_NONE_UTF8_CHARACTERS.NAME=Remove none-UTF8 characters in char typed field content read from source \ No newline at end of file +REMOVE_NONE_UTF8_CHARACTERS.NAME=Remove none-UTF8 characters in char typed field content read from source +ADDITIONAL_KEYWORDS.NAME=Additional SQL Keywords (comma separated list) \ No newline at end of file diff --git a/talend_component/tEXATableTransfer/jlo-talendcomp-tabletransfer-12.1.jar b/talend_component/tOracleTableTransfer/jlo-talendcomp-tabletransfer-13.0.jar similarity index 66% rename from talend_component/tEXATableTransfer/jlo-talendcomp-tabletransfer-12.1.jar rename to talend_component/tOracleTableTransfer/jlo-talendcomp-tabletransfer-13.0.jar index 65c09ac..59b57bd 100644 Binary files a/talend_component/tEXATableTransfer/jlo-talendcomp-tabletransfer-12.1.jar and b/talend_component/tOracleTableTransfer/jlo-talendcomp-tabletransfer-13.0.jar differ diff --git a/talend_component/tOracleTableTransfer/tOracleTableTransfer_begin.javajet b/talend_component/tOracleTableTransfer/tOracleTableTransfer_begin.javajet index 5266d26..a04e1d1 100644 --- a/talend_component/tOracleTableTransfer/tOracleTableTransfer_begin.javajet +++ b/talend_component/tOracleTableTransfer/tOracleTableTransfer_begin.javajet @@ -65,14 +65,13 @@ valueRangeColumn = "null"; } boolean onlyUpdate = "true".equals(ElementParameterParser.getValue(node, "__ONLY_UPDATE_NO_INSERT__")); - boolean log4jEnabled = "true".equals(org.talend.core.model.process.ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__")) && - "JOBLET".equals(node.getComponent().getComponentType().toString()) == false; + String keywordList = ElementParameterParser.getObjectValue(node, "__ADDITIONAL_KEYWORDS__"); + if (keywordList == null && keywordList.trim().isEmpty()) { + keywordList = "null"; + } %> de.jlo.talendcomp.tabletransfer.TableTransfer <%=cid%> = new de.jlo.talendcomp.tabletransfer.TableTransfer(); -<% if (log4jEnabled) { %> - <%=cid%>.setLogger(log); -<% } %> <%=cid%>.setDoCommit(<%=doCommit%>); <%=cid%>.setRunOnlyUpdates(<%=onlyUpdate%>); <% if (typeMap != null) { @@ -105,6 +104,7 @@ <% } %> <%=cid%>.setKeepDataModels(<%=reuseModel%>, jobName + "_" + <%=cid%>); <%=cid%>.setupDataModels(); + <%=cid%>.setKeywords(<%=keywordList%>); <% if (useQuery) { %> // use our own query as source String <%=cid%>_query = <%=sourceQuery%>; diff --git a/talend_component/tOracleTableTransfer/tOracleTableTransfer_java.xml b/talend_component/tOracleTableTransfer/tOracleTableTransfer_java.xml index 4e8559b..91cfbf1 100644 --- a/talend_component/tOracleTableTransfer/tOracleTableTransfer_java.xml +++ b/talend_component/tOracleTableTransfer/tOracleTableTransfer_java.xml @@ -1,7 +1,7 @@ -
+
@@ -151,16 +151,17 @@ + false - - Release: 12.1 build at: 20220822 + + Release: 13.0 build at: 20221128 - + diff --git a/talend_component/tOracleTableTransfer/tOracleTableTransfer_messages.properties b/talend_component/tOracleTableTransfer/tOracleTableTransfer_messages.properties index 8164689..d30578f 100644 --- a/talend_component/tOracleTableTransfer/tOracleTableTransfer_messages.properties +++ b/talend_component/tOracleTableTransfer/tOracleTableTransfer_messages.properties @@ -66,4 +66,5 @@ TRIM_TEXT_VALUES.NAME=Trim text values ENABLE_CHECK_CONNECTION.NAME=Enable check target connection while idle CHECK_CONNECTION_STATEMENT.NAME=Statement to simply test the connection (must be something very cheap!) ONLY_UPDATE_NO_INSERT.NAME=Only Update, No Insert -REMOVE_NONE_UTF8_CHARACTERS.NAME=Remove none-UTF8 characters in char typed field content read from source \ No newline at end of file +REMOVE_NONE_UTF8_CHARACTERS.NAME=Remove none-UTF8 characters in char typed field content read from source +ADDITIONAL_KEYWORDS.NAME=Additional SQL Keywords (comma separated list) \ No newline at end of file diff --git a/talend_component/tPostgresqlTableTransfer/jlo-talendcomp-tabletransfer-12.1.jar b/talend_component/tPostgresqlTableTransfer/jlo-talendcomp-tabletransfer-12.1.jar deleted file mode 100644 index 51b00eb..0000000 Binary files a/talend_component/tPostgresqlTableTransfer/jlo-talendcomp-tabletransfer-12.1.jar and /dev/null differ diff --git a/talend_component/tOracleTableTransfer/jlo-talendcomp-tabletransfer-12.1.jar b/talend_component/tPostgresqlTableTransfer/jlo-talendcomp-tabletransfer-13.0.jar similarity index 66% rename from talend_component/tOracleTableTransfer/jlo-talendcomp-tabletransfer-12.1.jar rename to talend_component/tPostgresqlTableTransfer/jlo-talendcomp-tabletransfer-13.0.jar index e62299f..59b57bd 100644 Binary files a/talend_component/tOracleTableTransfer/jlo-talendcomp-tabletransfer-12.1.jar and b/talend_component/tPostgresqlTableTransfer/jlo-talendcomp-tabletransfer-13.0.jar differ diff --git a/talend_component/tPostgresqlTableTransfer/tPostgresqlTableTransfer_begin.javajet b/talend_component/tPostgresqlTableTransfer/tPostgresqlTableTransfer_begin.javajet index 0c8aee2..5c0f17a 100644 --- a/talend_component/tPostgresqlTableTransfer/tPostgresqlTableTransfer_begin.javajet +++ b/talend_component/tPostgresqlTableTransfer/tPostgresqlTableTransfer_begin.javajet @@ -64,14 +64,13 @@ } boolean onlyUpdate = "true".equals(ElementParameterParser.getValue(node, "__ONLY_UPDATE_NO_INSERT__")); String onConflict = ElementParameterParser.getValue(node, "__ON_CONFLICT__"); - boolean log4jEnabled = "true".equals(org.talend.core.model.process.ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__")) && - "JOBLET".equals(node.getComponent().getComponentType().toString()) == false; + String keywordList = ElementParameterParser.getObjectValue(node, "__ADDITIONAL_KEYWORDS__"); + if (keywordList == null && keywordList.trim().isEmpty()) { + keywordList = "null"; + } %> de.jlo.talendcomp.tabletransfer.PostgresqlTableTransfer <%=cid%> = new de.jlo.talendcomp.tabletransfer.PostgresqlTableTransfer(); -<% if (log4jEnabled) { %> - <%=cid%>.setLogger(log); -<% } %> <%=cid%>.setDoCommit(<%=doCommit%>); <%=cid%>.setRunOnlyUpdates(<%=onlyUpdate%>); <% if (onlyUpdate == false) { @@ -114,6 +113,7 @@ <% } %> <%=cid%>.setKeepDataModels(<%=reuseModel%>, jobName + "_" + <%=cid%>); <%=cid%>.setupDataModels(); + <%=cid%>.setKeywords(<%=keywordList%>); <% if (useQuery) { %> // use our own query as source String <%=cid%>_query = <%=sourceQuery%>; diff --git a/talend_component/tPostgresqlTableTransfer/tPostgresqlTableTransfer_java.xml b/talend_component/tPostgresqlTableTransfer/tPostgresqlTableTransfer_java.xml index 3c2319a..b62c734 100644 --- a/talend_component/tPostgresqlTableTransfer/tPostgresqlTableTransfer_java.xml +++ b/talend_component/tPostgresqlTableTransfer/tPostgresqlTableTransfer_java.xml @@ -1,7 +1,7 @@ -
+
@@ -159,16 +159,17 @@ + false - - Release: 12.1 build at: 20220822 + + Release: 13.0 build at: 20221128 - + diff --git a/talend_component/tPostgresqlTableTransfer/tPostgresqlTableTransfer_messages.properties b/talend_component/tPostgresqlTableTransfer/tPostgresqlTableTransfer_messages.properties index 00c8d83..64590c3 100644 --- a/talend_component/tPostgresqlTableTransfer/tPostgresqlTableTransfer_messages.properties +++ b/talend_component/tPostgresqlTableTransfer/tPostgresqlTableTransfer_messages.properties @@ -74,4 +74,5 @@ TRIM_TEXT_VALUES.NAME=Trim text values ENABLE_CHECK_CONNECTION.NAME=Enable check target connection while idle CHECK_CONNECTION_STATEMENT.NAME=Statement to simply test the connection (must be something very cheap!) ONLY_UPDATE_NO_INSERT.NAME=Only Update, No Insert -REMOVE_NONE_UTF8_CHARACTERS.NAME=Remove none-UTF8 characters in char typed field content read from source \ No newline at end of file +REMOVE_NONE_UTF8_CHARACTERS.NAME=Remove none-UTF8 characters in char typed field content read from source +ADDITIONAL_KEYWORDS.NAME=Additional SQL Keywords (comma separated list) \ No newline at end of file