Merge branch 'maintenance/5.6'

This commit is contained in:
CHEN Bin
2014-09-23 08:09:58 +08:00
77 changed files with 23 additions and 225 deletions

View File

@@ -5,11 +5,9 @@ imports="
org.talend.core.model.process.ElementParameterParser
"
%>
<%@ include file="../templates/Log4j/Log4jDBConnUtil.javajet"%>
<%
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
INode node = (INode)codeGenArgument.getArgument();
String cid = node.getUniqueName();
log4jCodeGenerateUtil.infoComponentStart(node);
%>
int nb_line_<%=cid%> = 0;

View File

@@ -14,5 +14,4 @@ String cid = node.getUniqueName();
globalMap.put("<%=cid %>_NB_LINE",nb_line_<%=cid%>);
<%
log4jCodeGenerateUtil.retrieveRecordsCount(node);
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -68,9 +68,6 @@ if ( previousNode != null && ("INSERT").equals(dataAction)) {
java.sql.ResultSet rs_<%=cid %> = pstmt_<%=previousCID %>.getGeneratedKeys();
if(rs_<%=cid %>.next()) {
<%=outgoingConn.getName() %>.last_insert_id = rs_<%=cid %>.getInt(1);
<%if(isLog4jEnabled){%>
log.trace("<%=cid%> - Last insert id:"+<%=outgoingConn.getName() %>.last_insert_id);
<%}%>
}
nb_line_<%=cid%>++;
<%

View File

@@ -27,7 +27,6 @@ skeleton="../templates/db_output_bulk.skeleton"
String fileName = ElementParameterParser.getValue(node, "__FILENAME__");
boolean includeHeader = "true".equals(ElementParameterParser.getValue(node, "__INCLUDEHEADER__"));
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jCodeGenerateUtil.infoComponentStart(node);
List<IMetadataColumn> columnList = getColumnList(node);
%>
String file_<%=cid %> = <%=ElementParameterParser.getValue(node, "__FILENAME__") %>;
@@ -131,6 +130,5 @@ skeleton="../templates/db_output_bulk.skeleton"
{
log4jCodeGenerateUtil.close(node);
}
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -168,7 +168,6 @@ try {
whetherReject_<%=cid%> = true;
<%
if (("true").equals(dieOnError)) {
log4jCodeGenerateUtil.logError(node,"fatal");
%>
throw(e);
<%

View File

@@ -1932,7 +1932,6 @@ class ManagerFactory {
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
INode node = (INode)codeGenArgument.getArgument();
List<IMetadataColumn> columnList = null;
log4jCodeGenerateUtil.infoComponentStart(node);
List<IMetadataTable> metadatas = node.getMetadataList();
if(metadatas != null && metadatas.size() > 0) {
IMetadataTable metadata = metadatas.get(0);
@@ -2136,11 +2135,9 @@ if(columnList != null && columnList.size() > 0) {
globalMap.put("<%=cid%>_QUERY", "<%=manager.getCreateTableSQL(columnList)%>");
} catch(java.lang.Exception e) {
globalMap.put("<%=cid%>_ERROR_MESSAGE",e.getMessage());
<%log4jCodeGenerateUtil.logError(node,"fatal");%>
throw new RuntimeException("Creating table failed", e);
}
<%
}
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -39,7 +39,6 @@ String timeformat = ElementParameterParser.getValue(node, "__TIME_FORMAT__");
String timestampformat = ElementParameterParser.getValue(node, "__TIMESTAMP_FORMAT__");
boolean useExistingConnection = ("true").equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
boolean removeLoadPending = ("true").equals(ElementParameterParser.getValue(node,"__REMOVE_LODA_PENDING__"));
log4jCodeGenerateUtil.infoComponentStart(node);
List<IMetadataColumn> columnList = getColumnList(node);
List<Column> stmtStructure = null;
Manager manager = null;
@@ -202,7 +201,6 @@ Character field_separator_<%=cid %> = (<%=field_separator%>).charAt(0);
%>
int keyCount_<%=cid%> = <%=keyCount%>;
if(keyCount_<%=cid%> == 0) {
<%log4jCodeGenerateUtil.logInfo(node,"fatal",cid+" - For bulk update, Schema must have a key at least.");%>
throw new RuntimeException("For bulk update, Schema must have a key at least.");
}
String tmpTableName_<%=cid%> = tableName_<%=cid%>;

View File

@@ -30,7 +30,6 @@ String sEncoding = ElementParameterParser.getValue(node, "__ENCODING__");
String securityMode = ElementParameterParser.getValue(node, "__SECURITY_MODE__");
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jFileUtil.componentStartInfo(node);
String passwordFieldName = "";
if (useProxy) {

View File

@@ -49,7 +49,6 @@ if (("true").equals(useExistingConn)) {
}
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jFileUtil.componentStartInfo(node);
String passwordFieldName = "";
//The following part support the socks proxy for FTP and SFTP (Socks V4 or V5, they are all OK).

View File

@@ -89,5 +89,4 @@ globalMap.put("<%=cid %>_NB_FILE",nb_file_<%=cid%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Deleted files count: " + nb_file_<%=cid%> + ".");
log.info("<%=cid%> - Done.");
<%}%>

View File

@@ -81,9 +81,6 @@
globalMap.put("<%=cid %>_CURRENT_STATUS", "File deleted.");
} catch (com.jcraft.jsch.SftpException e_<%=cid %>) {
globalMap.put("<%=cid %>_CURRENT_STATUS", "Deleting file action error");
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - " + e_<%=cid %>.getMessage());
<%}%>
throw e_<%=cid %>;
}
nb_file_<%=cid%>++;
@@ -161,9 +158,6 @@
}
}catch(com.enterprisedt.net.ftp.FTPException e_<%=cid %>){
globalMap.put("<%=cid %>_CURRENT_STATUS", "Deleting file action error");
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - Deleting file action error.");
<%}%>
throw e_<%=cid %>;
}
ftp_<%=cid %>.chdir(root<%=cid %>);
@@ -174,9 +168,6 @@
<%
if(("true").equals(dieOnError)){
%>
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - " + e_<%=cid %>.getMessage());
<%}%>
throw(e_<%=cid %>);
<%
}else{

View File

@@ -37,7 +37,6 @@ String useExistingConn = ElementParameterParser.getValue(node, "__USE_EXISTING_C
boolean sftp = false;
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jFileUtil.componentStartInfo(node);
if (("true").equals(useExistingConn)) {
List<? extends INode> nodeList = node.getProcess().getGeneratingNodes();

View File

@@ -72,6 +72,3 @@ if (sftp && !("true").equals(useExistingConn)) {
}
}
%>
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Done.");
<%}%>

View File

@@ -49,7 +49,6 @@ if (("true").equals(useExistingConn)) {
sftp = ("true").equals(ElementParameterParser.getValue(node, "__SFTP__"));
}
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jFileUtil.componentStartInfo(node);
String passwordFieldName = "";
%>

View File

@@ -77,5 +77,4 @@ globalMap.put("<%=cid %>_NB_FILE",nb_file_<%=cid%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Listed files count: " + nb_file_<%=cid%> + ".");
log.info("<%=cid%> - Done.");
<%}%>

View File

@@ -53,7 +53,6 @@ if (("true").equals(useExistingConn)) {
}
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jFileUtil.componentStartInfo(node);
String passwordFieldName = "";
if (useProxy) {

View File

@@ -90,6 +90,3 @@ if (sftp && !bUseExistingConn) { // *** sftp *** //
}
%>
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Done.");
<%}%>

View File

@@ -45,7 +45,6 @@ boolean sftp = false;
boolean ftps = false;
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jFileUtil.componentStartInfo(node);
String passwordFieldName = "";
if ("true".equals(useExistingConn)) {
@@ -235,7 +234,6 @@ if (sftp) { // *** sftp *** //
);
<%if(isLog4jEnabled){%>
log.debug("<%=cid%> - Downloaded file " + (count +1) + " : '" + remoteFileName + "' successfully.");
log4jSb_<%=cid%>.delete(0,log4jSb_<%=cid%>.length());
<%}%>
msg_<%=cid%>.add("file [" + remoteFileName + "] downloaded successfully.");
<%if (bPrintMsg) {%>
@@ -248,9 +246,6 @@ if (sftp) { // *** sftp *** //
msg_<%=cid%>.add("file [" + remoteFileName + "] downloaded unsuccessfully.");
globalMap.put("<%=cid %>_CURRENT_STATUS", "File transfer fail.");
}
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - " + e.getMessage());
<%}%>
throw e;
}
count++;
@@ -454,7 +449,6 @@ if (sftp) { // *** sftp *** //
ftpClient.get(fout, remoteFileName);
<%if(isLog4jEnabled){%>
log.debug("<%=cid%> - Downloaded file " + (count +1) + " : '" + remoteFileName + "' successfully.");
log4jSb_<%=cid%>.delete(0,log4jSb_<%=cid%>.length());
<%}%>
msg_<%=cid%>.add("file [" + remoteFileName + "] downloaded successfully.");
<%if (bPrintMsg) {%>
@@ -468,7 +462,6 @@ if (sftp) { // *** sftp *** //
ftpClient.get(localFileName, remoteFileName);
<%if(isLog4jEnabled){%>
log.debug("<%=cid%> - Downloaded file " + (count +1) + " : '" + remoteFileName + "' successfully.");
log4jSb_<%=cid%>.delete(0,log4jSb_<%=cid%>.length());
<%}%>
msg_<%=cid%>.add("file [" + remoteFileName + "] downloaded successfully.");
<%if (bPrintMsg) {%>
@@ -485,7 +478,6 @@ if (sftp) { // *** sftp *** //
ftpClient.get(localFileName, remoteFileName);
<%if(isLog4jEnabled){%>
log.debug("<%=cid%> - Downloaded file " + (count +1) + " : '" + remoteFileName + "' successfully.");
log4jSb_<%=cid%>.delete(0,log4jSb_<%=cid%>.length());
<%}%>
msg_<%=cid%>.add("file [" + remoteFileName + "] downloaded successfully.");
<%if (bPrintMsg) {%>
@@ -502,7 +494,6 @@ if (sftp) { // *** sftp *** //
ftpClient.get(localFileName, remoteFileName);
<%if(isLog4jEnabled){%>
log.debug("<%=cid%> - Downloaded file " + (count +1) + " : '" + remoteFileName + "' successfully.");
log4jSb_<%=cid%>.delete(0,log4jSb_<%=cid%>.length());
<%}%>
msg_<%=cid%>.add("file [" + remoteFileName + "] downloaded successfully.");
<%if (bPrintMsg) {%>
@@ -527,9 +518,6 @@ if (sftp) { // *** sftp *** //
} catch (com.enterprisedt.net.ftp.FTPException e) {
msg_<%=cid%>.add("file [" + remoteFileName + "] downloaded unsuccessfully.");
globalMap.put("<%=cid %>_CURRENT_STATUS", "File transfer fail.");
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - " + e.getMessage());
<%}%>
throw e;
}
count++;
@@ -670,7 +658,6 @@ if (sftp) { // *** sftp *** //
ftpClient.download(remoteFileName, localFile);
<%if(isLog4jEnabled){%>
log.debug("<%=cid%> - Downloaded file " + (count +1) + " : '" + remoteFileName + "' successfully.");
log4jSb_<%=cid%>.delete(0,log4jSb_<%=cid%>.length());
<%}%>
count++;
}

View File

@@ -127,6 +127,5 @@ nb_file_<%=cid%> = getter_<%=cid %>.count;
globalMap.put("<%=cid %>_NB_FILE",nb_file_<%=cid%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Downloaded files count: " + nb_file_<%=cid%> + ".");
log.info("<%=cid%> - Done.");
<%}%>

View File

@@ -64,9 +64,6 @@ if ("true".equals(useExistingConn)) {
getter_<%=cid %>.chdir(root_<%=cid %>);
} catch(java.lang.Exception e) {
<%if ("true".equals(dieOnError)){%>
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - " + e.getMessage());
<%}%>
throw(e);
<%}else{%>
<%if(isLog4jEnabled){%>

View File

@@ -38,7 +38,6 @@ boolean sftp = false;
boolean ftps = false;
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jFileUtil.componentStartInfo(node);
String passwordFieldName = "";
if (("true").equals(useExistingConn)) {

View File

@@ -133,6 +133,5 @@ if(sftp){ // *** sftp *** //
globalMap.put("<%=cid %>_NB_FILE",nb_file_<%=cid%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Uploaded files count: " + nb_file_<%=cid%> + ".");
log.info("<%=cid%> - Done.");
<%}%>

View File

@@ -117,9 +117,6 @@ try{
<%
if(("true").equals(dieOnError)){
%>
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - File permission denied: "+<%=remotedir%>+"/"+listings<%=cid %>[m<%=cid %>].getName());
<%}%>
throw(e_<%=cid%>);
<%
}else{
@@ -132,9 +129,6 @@ try{
}
%>
}catch(java.lang.Exception e_<%=cid%>){
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - File '" + listings<%=cid %>[m<%=cid %>].getAbsolutePath() + "' not found?");
<%}%>
if(!(e_<%=cid%> instanceof com.jcraft.jsch.SftpException)) {
msg_<%=cid%>.add("file " + listings<%=cid %>[m<%=cid %>].getAbsolutePath() + " not found?");
@@ -159,9 +153,6 @@ try{
globalMap.put("<%=cid %>_CURRENT_STATUS", "File rename OK.");
}catch(com.jcraft.jsch.SftpException e_<%=cid%>){
globalMap.put("<%=cid %>_CURRENT_STATUS", "File rename fail.");
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - File rename fail.");
<%}%>
throw e_<%=cid%>;
}
}
@@ -313,9 +304,6 @@ try{
nb_file_<%=cid%>++;
}
}catch(com.enterprisedt.net.ftp.FTPException e_<%=cid%>){
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - File " + listings<%=cid %>[m<%=cid %>].getAbsolutePath() + " not found?");
<%}%>
msg_<%=cid%>.add("file " + listings<%=cid %>[m<%=cid %>].getAbsolutePath() + " not found?");
@@ -444,9 +432,6 @@ try{
globalMap.put("<%=cid %>_CURRENT_STATUS", "File rename OK.");
}catch(it.sauronsoftware.ftp4j.FTPException e_<%=cid%>){
globalMap.put("<%=cid %>_CURRENT_STATUS", "File rename fail.");
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - File rename fail.");
<%}%>
throw e_<%=cid%>;
}
}
@@ -457,9 +442,6 @@ try{
<%
if(("true").equals(dieOnError)){
%>
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - " + e_<%=cid%>.getMessage());
<%}%>
throw(e_<%=cid%>);
<%
}else{

View File

@@ -49,7 +49,6 @@ if (("true").equals(useExistingConn)) {
}
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jFileUtil.componentStartInfo(node);
String passwordFieldName = "";
//The following part support the socks proxy for FTP and SFTP (Socks V4 or V5, they are all OK).

View File

@@ -88,5 +88,4 @@ globalMap.put("<%=cid %>_NB_FILE",nb_file_<%=cid%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Renamed files count: " + nb_file_<%=cid%> + ".");
log.info("<%=cid%> - Done.");
<%}%>

View File

@@ -44,9 +44,6 @@ try{
globalMap.put("<%=cid %>_CURRENT_STATUS", "File rename OK.");
}catch(com.jcraft.jsch.SftpException se){
globalMap.put("<%=cid %>_CURRENT_STATUS", "File rename fail.");
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - File rename fail.");
<%}%>
throw se;
}
nb_file_<%=cid%>++;
@@ -131,9 +128,6 @@ try{
}
}catch(com.enterprisedt.net.ftp.FTPException e){
globalMap.put("<%=cid %>_CURRENT_STATUS", "File rename fail.");
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - File rename fail.");
<%}%>
throw e;
}
@@ -142,9 +136,6 @@ try{
<%
if(("true").equals(dieOnError)){
%>
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - " + e.getMessage());
<%}%>
throw(e);
<%
}else{

View File

@@ -49,7 +49,6 @@ if (("true").equals(useExistingConn)) {
}
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jFileUtil.componentStartInfo(node);
String passwordFieldName = "";
//The following part support the socks proxy for FTP and SFTP (Socks V4 or V5, they are all OK).

View File

@@ -90,5 +90,4 @@ globalMap.put("<%=cid %>_NB_FILE",nb_file_<%=cid%>);
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Truncated files count: " + nb_file_<%=cid%> + ".");
log.info("<%=cid%> - Done.");
<%}%>

View File

@@ -64,9 +64,6 @@
<%}%>
} catch (com.jcraft.jsch.SftpException se) {
globalMap.put("<%=cid %>_CURRENT_STATUS", "File truncate fail.");
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - Truncated '" + filePath<%=cid%> + "' fail.");
<%}%>
throw se;
}
nb_file_<%=cid%>++;
@@ -110,9 +107,6 @@
}
}catch(com.enterprisedt.net.ftp.FTPException e){
globalMap.put("<%=cid %>_CURRENT_STATUS", "File truncate fail.");
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - " + e.getMessage());
<%}%>
throw e;
}
ftp_<%=cid %>.chdir(root<%=cid %>);

View File

@@ -22,7 +22,6 @@ String table = ElementParameterParser.getValue(node, "__TABLE__");
String dbSchema = ElementParameterParser.getValue(node, "__SCHEMA_DB__");
String dataAction = ElementParameterParser.getValue(node,"__DATA_ACTION__");
boolean convertToUppercase = false; // not active this function
log4jCodeGenerateUtil.infoComponentStart(node);
boolean useExistingConnection = "true".equalsIgnoreCase(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
%>
String tableName_<%=cid%> = null;
@@ -162,7 +161,6 @@ if((columnList != null && columnList.size() > 0) || "CLEAR".equals(tableAction)
%>
int keyCount_<%=cid%> = <%=keyCount%>;
if(keyCount_<%=cid%> == 0) {
<%log4jCodeGenerateUtil.logInfo(node,"fatal",cid+" - For bulk update, Schema must have a key at least.");%>
throw new RuntimeException("For bulk update, Schema must have a key at least.");
}
tmpTableName_<%=cid%> = tableName_<%=cid%>;
@@ -226,5 +224,4 @@ if((columnList != null && columnList.size() > 0) || "CLEAR".equals(tableAction)
if(!useExistingConnection) {
log4jCodeGenerateUtil.close(node);
}
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -88,7 +88,6 @@ skeleton="../templates/db_output_bulk.skeleton"
gploadExePath = "\"gpload\"";
}
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jCodeGenerateUtil.infoComponentStart(node);
log4jCodeGenerateUtil.initDbDebugRowBuffer();
%>
@@ -115,9 +114,6 @@ skeleton="../templates/db_output_bulk.skeleton"
boolean missConfiguration_<%=cid%> = true;
String missConfigurationMsg_<%=cid%> = "<%=missConfigurationMsg%>";
if (missConfiguration_<%=cid%>) {
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - " + missConfigurationMsg_<%=cid%>+".");
<%}%>
throw new java.lang.Exception(missConfigurationMsg_<%=cid%>);
}
<%
@@ -179,9 +175,6 @@ skeleton="../templates/db_output_bulk.skeleton"
<%}%>
}catch(java.sql.SQLException e){
if(<%=dieOnError%>){
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - Table '" + tableName4Load_<%=cid%> + "' already exists. process terminated.");
<%}%>
throw new RuntimeException ("Table '" + tableName4Load_<%=cid%> + "' already exists. process terminated.");
}else{
<%if(isLog4jEnabled){%>
@@ -205,9 +198,6 @@ skeleton="../templates/db_output_bulk.skeleton"
<%}%>
}catch(java.sql.SQLException e){
if(<%=dieOnError%>){
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - Table '" + tableName4Load_<%=cid%> + "' already exists. process terminated.");
<%}%>
throw new RuntimeException ("Table '" + tableName4Load_<%=cid%> + "' already exists. process terminated.");
}else{
<%if(isLog4jEnabled){%>
@@ -256,9 +246,6 @@ skeleton="../templates/db_output_bulk.skeleton"
<%}%>
}catch(java.sql.SQLException e){
if(<%=dieOnError%>){
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - Failure to create table '" + tableName4Load_<%=cid%> + "'. process terminated.");
<%}%>
throw new RuntimeException ("Failure to create table '" + tableName4Load_<%=cid%> + "'. process terminated.");
}else{
<%if(isLog4jEnabled){%>
@@ -285,9 +272,6 @@ skeleton="../templates/db_output_bulk.skeleton"
<%}%>
}catch(java.sql.SQLException e){
if(<%=dieOnError%>){
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - Failure to drop table '" + tableName4Load_<%=cid%> + "'. process terminated.");
<%}%>
throw new RuntimeException ("Failure to drop table '" + tableName4Load_<%=cid%> + "'. process terminated.");
}else{
<%if(isLog4jEnabled){%>
@@ -309,9 +293,6 @@ skeleton="../templates/db_output_bulk.skeleton"
<%}%>
}catch(java.sql.SQLException e){
if(<%=dieOnError%>){
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - Failure to create table '" + tableName4Load_<%=cid%> + "'. process terminated.");
<%}%>
throw new RuntimeException ("Failure to create table '" + tableName4Load_<%=cid%> + "'. process terminated.");
}else{
<%if(isLog4jEnabled){%>
@@ -353,9 +334,6 @@ skeleton="../templates/db_output_bulk.skeleton"
stmtClear_<%=cid%>.close();
}catch(java.sql.SQLException e){
if(<%=dieOnError%>){
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - Failure to clear table '" + tableName4Load_<%=cid%> + "'. process terminated.");
<%}%>
throw new RuntimeException ("Failure to clear table '" + tableName4Load_<%=cid%> + "'. process terminated.");
}else{
<%if(isLog4jEnabled){%>
@@ -508,7 +486,6 @@ skeleton="../templates/db_output_bulk.skeleton"
}
}
catch (java.lang.Exception e) {
<%log4jCodeGenerateUtil.logError(node,"fatal");%>
globalMap.put("<%=cid%>_GPLOAD_ERROR",e.getMessage());
throw new RuntimeException(e.getMessage(),e.getCause());
}

View File

@@ -70,11 +70,6 @@ skeleton="../templates/db_output_bulk.skeleton"
log.info("<%=cid%> - Loaded records count:"+insertedCount_<%=cid%> + ".");
<%}
}
if(isLog4jEnabled){
%>
log.info("<%=cid%> - Done.");
<%
}
%>
globalMap.put("<%=cid%>_GPLOAD_OUTPUT", gploadOutput_<%=cid%>.toString());
globalMap.put("<%=cid%>_NB_LINE", insertedCount_<%=cid%>);

View File

@@ -31,7 +31,6 @@ imports="
boolean useParquet = "true".equals(ElementParameterParser.getValue(node,"__USE_PARQUET__"));
log4jCodeGenerateUtil.infoComponentStart(node);
boolean isExecutedThroughWebHCat = "MICROSOFT_HD_INSIGHT".equals(ElementParameterParser.getValue(node, "__DISTRIBUTION__"));
if("true".equals(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"))) {
isExecutedThroughWebHCat = false;

View File

@@ -66,9 +66,6 @@ imports="
}
%>
<%if(isLog4jEnabled){%>
log.info("<%=cid%> - Done.");
<%}%>
String currentClientPathSeparator_<%=cid%> = (String)globalMap.get("current_client_path_separator");
if(currentClientPathSeparator_<%=cid%>!=null) {

View File

@@ -187,9 +187,6 @@ if(isExecutedThroughWebHCat) {
<%
if (("true").equals(dieOnError)) {
%>
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - " + e.getMessage());
<%}%>
throw(e);
<%
} else {

View File

@@ -18,7 +18,6 @@ skeleton="../templates/db_output_bulk.skeleton"
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
INode node = (INode)codeGenArgument.getArgument();
String cid = node.getUniqueName();
log4jCodeGenerateUtil.infoComponentStart(node);
String action = ElementParameterParser.getValue(node, "__DATA_ACTION__");
String field_separator = ElementParameterParser.getValue(node, "__FIELDS_TERMINATED_BY__");
String file = ElementParameterParser.getValue(node, "__DATA__");
@@ -208,13 +207,6 @@ if(columnList != null && columnList.size() > 0) {
java.io.File dbLoadDirectory_<%=cid%> = new java.io.File (<%=informixDir%>+"/bin");
boolean dbloadExist_<%=cid%> = dbLoadDirectory_<%=cid%>.exists();
if(!dbloadExist_<%=cid%>){
<%
if(isLog4jEnabled){
%>
log.fatal("<%=cid%> - '"+dbLoadDirectory_<%=cid%>+"' is not exist.");
<%
}
%>
throw new RuntimeException(dbLoadDirectory_<%=cid%>+"' is not exist!");
}
<%

View File

@@ -21,7 +21,6 @@
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
INode node = (INode)codeGenArgument.getArgument();
String cid = node.getUniqueName();
log4jCodeGenerateUtil.infoComponentStart(node);
String host = ElementParameterParser.getValue(node, "__SERVER__");
String batchRow=ElementParameterParser.getValue(node,"__BATCHROW__");
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
@@ -504,7 +503,6 @@
boolean deletedOK = f.delete();
if (!deletedOK ){
<%log4jCodeGenerateUtil.logInfo(node,"fatal",cid+" - Failed to delete \" + sqlFileAndPath_"+ cid+"+\".");%>
throw new IllegalArgumentException("Failed to delete " + sqlFileAndPath_<%=cid %>);
}
<%
@@ -520,7 +518,6 @@
deletedOK = f.delete();
if (!deletedOK ){
<%log4jCodeGenerateUtil.logInfo(node,"fatal",cid+" - Failed to delete \" + executableFilePath_"+ cid+"+\".");%>
throw new IllegalArgumentException("Failed to delete " + executableFilePath_<%=cid %>);
}
<%
@@ -537,4 +534,3 @@
<%
}
%>
<%log4jCodeGenerateUtil.infoComponentEnd(node);%>

View File

@@ -22,7 +22,6 @@ imports="
String tableName = ElementParameterParser.getValue(node,"__TABLE_NAME__");
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jCodeGenerateUtil.infoComponentStart(node);
%>
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");
java.sql.Statement stmt2_<%=cid%> = null;

View File

@@ -15,7 +15,6 @@ boolean dieOnError = "true".equals(ElementParameterParser.getValue(node, "__DIE_
}
}catch(Exception e_<%=cid%>){
<%if(dieOnError){%>
<%log4jCodeGenerateUtil.logError(node,"fatal","e_"+cid);%>
throw(e_<%=cid%>);
<%}else{%>
<%log4jCodeGenerateUtil.logError(node,"error","e_"+cid);%>
@@ -28,7 +27,6 @@ boolean dieOnError = "true".equals(ElementParameterParser.getValue(node, "__DIE_
}
}catch(Exception e2_<%=cid%>){
<%if(dieOnError){%>
<%log4jCodeGenerateUtil.logError(node,"fatal","e2_"+cid);%>
throw(e2_<%=cid%>);
<%}else{%>
<%log4jCodeGenerateUtil.logError(node,"error","e2_"+cid);%>
@@ -39,5 +37,4 @@ boolean dieOnError = "true".equals(ElementParameterParser.getValue(node, "__DIE_
globalMap.put("<%=cid%>_NB_COLUMN", nb_column_<%=cid%>);
<%
log4jCodeGenerateUtil.logInfo(node,"info",cid+" - Retrieved columns count:\"+nb_column_"+cid+" + \" .");
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -17,7 +17,6 @@ imports="
boolean close = ("true").equals(ElementParameterParser.getValue(node,"__CLOSE__"));
String conn = "conn_" + connection;
log4jCodeGenerateUtil.infoComponentStart(node);
%>
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn %>");
<%
@@ -62,5 +61,4 @@ if(conn_<%=cid%> != null && !conn_<%=cid%>.isClosed()) {
}
%>
}
<%log4jCodeGenerateUtil.infoComponentEnd(node);%>

View File

@@ -25,7 +25,6 @@ imports="
String criteria = ElementParameterParser.getValue(node,"__CRITERIA__");
boolean isInclude = ("INCLUDE").equals(criteria);
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jCodeGenerateUtil.infoComponentStart(node);
%>
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");
<%
@@ -160,7 +159,6 @@ if(useFilter){
if(isLog4jEnabled){
%>
log.debug("<%=cid%> - Retrieving the table "+nb_table_<%=cid %>+".");
log.trace("<%=cid%> - Name of table "+nb_table_<%=cid%>+":"+currentTableName_<%=cid %>+"。");
<%
}
%>

View File

@@ -16,5 +16,4 @@ stmt2_<%=cid%>.close();
globalMap.put("<%=cid%>_NB_TABLE", nb_table_<%=cid%>);
<%
log4jCodeGenerateUtil.logInfo(node,"info",cid+" - Retrieved tables count:\"+nb_table_"+cid+" + \" .");
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -44,7 +44,6 @@ int deletedCount_<%=cid%>=0;
if(("EXPORT").equals(action)) {
%>
<%
log4jCodeGenerateUtil.infoComponentStart(node);
String bcp_utility = ElementParameterParser.getValue(node, "__BCP_UTILITY__");
String server = ElementParameterParser.getValue(node, "__SERVER__");
String query_statement = ElementParameterParser.getValue(node, "__QUERY__");
@@ -171,7 +170,6 @@ if(("EXPORT").equals(action)) {
error_<%=cid%>.interrupt();
<%
log4jCodeGenerateUtil.logInfo(node,"info",cid+" - Excute '\"+ command_" + cid + "+\"' successfully.");
log4jCodeGenerateUtil.infoComponentEnd(node);
} else {
List<IMetadataColumn> columnList = getColumnList(node);
%>
@@ -224,7 +222,6 @@ if(("EXPORT").equals(action)) {
%>
int keyCount_<%=cid%> = <%=keyCount%>;
if(keyCount_<%=cid%> == 0) {
<%log4jCodeGenerateUtil.logInfo(node,"fatal",cid+" - For bulk update, Schema must have a key at least.");%>
throw new RuntimeException("For bulk update, Schema must have a key at least.");
}
String tmpTableName_<%=cid%> = tableName_<%=cid%>;
@@ -281,6 +278,5 @@ if(("EXPORT").equals(action)) {
}
<%
}
log4jCodeGenerateUtil.infoComponentEnd(node);
}
%>

View File

@@ -12,7 +12,6 @@ INode node = (INode)codeGenArgument.getArgument();
String cid = node.getUniqueName();
String connection = ElementParameterParser.getValue(node, "__CONNECTION__");
String conn = "conn_" + connection;
log4jCodeGenerateUtil.infoComponentStart(node);
%>
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");
<%

View File

@@ -15,5 +15,4 @@ pstmt_<%=cid %>.close();
globalMap.put("<%=cid %>_NB_LINE",nb_line_<%=cid%>);
<%
log4jCodeGenerateUtil.retrieveRecordsCount(node);
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -17,7 +17,6 @@ imports="
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
INode node = (INode)codeGenArgument.getArgument();
String cid = node.getUniqueName();
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
String incomingConnName = null;
Set<String> incomingColumns = new HashSet<String>();
List<? extends IConnection> incomingConns = node.getIncomingConnections();
@@ -54,9 +53,6 @@ if(outgoingConns != null && outgoingConns.size() > 0) {
java.sql.ResultSet rs_<%=cid %> = pstmt_<%=cid %>.executeQuery();
if(rs_<%=cid %>.next()) {
<%=outgoingConn.getName() %>.last_insert_id = rs_<%=cid %>.getInt(1);
<%if(isLog4jEnabled){%>
log.trace("<%=cid%> - Last insert id:"+<%=outgoingConn.getName() %>.last_insert_id);
<%}%>
}
nb_line_<%=cid%>++;
<%

View File

@@ -20,7 +20,6 @@ imports="
String whereClause = ElementParameterParser.getValue(node,"__WHERE_CLAUSE__");
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jCodeGenerateUtil.infoComponentStart(node);
%>
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");
<%log4jCodeGenerateUtil.useExistConnection(node);%>

View File

@@ -16,5 +16,4 @@ stmt2_<%=cid%>.close();
globalMap.put("<%=cid%>_NB_TABLE", nb_table_<%=cid%>);
<%
log4jCodeGenerateUtil.logInfo(node,"info",cid+" - Retrieved tables count:\"+nb_table_"+cid+" + \" .");
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -49,7 +49,6 @@ String userName = ElementParameterParser.getValue(node, "__USER__");
boolean convertToUppercase = false; // not active this function
boolean useExistingConnection = "true".equalsIgnoreCase(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
log4jCodeGenerateUtil.infoComponentStart(node);
List<IMetadataColumn> columnList = getColumnList(node);
boolean containNULL = "true".equalsIgnoreCase(ElementParameterParser.getValue(node,"__RECORDS_CONTAIN_NULL_VALUE__"));
@@ -142,7 +141,6 @@ if(("UPDATE").equals(dataAction)) {
%>
int keyCount_<%=cid%> = <%=keyCount%>;
if(keyCount_<%=cid%> == 0) {
<%log4jCodeGenerateUtil.logInfo(node,"fatal",cid+" - For bulk update, Schema must have a key at least.");%>
throw new RuntimeException("For bulk update, Schema must have a key at least.");
}
tableName_<%=cid%> = "tmp_<%=cid%>" + "_" + pid + Thread.currentThread().getId();
@@ -284,5 +282,4 @@ if(("UPDATE").equals(dataAction)) {
if(!useExistingConnection) {
log4jCodeGenerateUtil.close(node);
}
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -20,7 +20,6 @@ imports="
String table = ElementParameterParser.getValue(node,"__TABLE_NAME__");
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jCodeGenerateUtil.infoComponentStart(node);
%>
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");
<%log4jCodeGenerateUtil.useExistConnection(node);%>

View File

@@ -16,5 +16,4 @@ stmt2_<%=cid%>.close();
globalMap.put("<%=cid%>_NB_COLUMN", nb_column_<%=cid%>);
<%
log4jCodeGenerateUtil.logInfo(node,"info",cid+" - Retrieved columns count:\"+nb_column_"+cid+" + \" .");
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -16,7 +16,6 @@ imports="
String conn = "conn_" + connection;
log4jCodeGenerateUtil.infoComponentStart(node);
%>
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");

View File

@@ -16,5 +16,4 @@ pstmt_<%=cid %>.close();
globalMap.put("<%=cid %>_NB_LINE",nb_line_<%=cid%>);
<%
log4jCodeGenerateUtil.retrieveRecordsCount(node);
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -16,7 +16,6 @@ imports="
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
INode node = (INode)codeGenArgument.getArgument();
String cid = node.getUniqueName();
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
String inputConnName = null;
Set<String> inputCols = new HashSet<String>();
if (node.getIncomingConnections()!=null) {
@@ -54,22 +53,13 @@ if(rs_<%=cid %>.next()){
if(type.equals("id_Long")){
%>
<%=conn.getName() %>.last_insert_id = rs_<%=cid %>.getLong(1);
<%if(isLog4jEnabled){%>
log.trace("<%=cid%> - Last insert id:"+<%=conn.getName() %>.last_insert_id);
<%}%>
<%
}else if(type.equals("id_Integer")){
%>
<%=conn.getName() %>.last_insert_id = rs_<%=cid %>.getInt(1);
<%if(isLog4jEnabled){%>
log.trace("<%=cid%> - Last insert id:"+<%=conn.getName() %>.last_insert_id);
<%}%>
<%
}else{
%>
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - Data type of \"last_insert_id\": <%=type.substring(3)%> is not supported,please choose Integer or Long!");
<%}%>
throw new RuntimeException("Data type of \"last_insert_id\": <%=type.substring(3)%> is not supported,please choose Integer or Long!");
<%
}

View File

@@ -17,7 +17,6 @@ imports="
boolean close = ("true").equals(ElementParameterParser.getValue(node,"__CLOSE__"));
String conn = "conn_" + connection;
log4jCodeGenerateUtil.infoComponentStart(node);
%>
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");
@@ -64,5 +63,4 @@ if(conn_<%=cid%> != null && !conn_<%=cid%>.isClosed()) {
}
%>
}
<%log4jCodeGenerateUtil.infoComponentEnd(node);%>

View File

@@ -20,7 +20,6 @@ imports="
String whereClause = ElementParameterParser.getValue(node,"__WHERE_CLAUSE__");
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jCodeGenerateUtil.infoComponentStart(node);
%>
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");
<%log4jCodeGenerateUtil.useExistConnection(node);%>

View File

@@ -16,5 +16,4 @@ stmt2_<%=cid%>.close();
globalMap.put("<%=cid%>_NB_TABLE", nb_table_<%=cid%>);
<%
log4jCodeGenerateUtil.logInfo(node,"info",cid+" - Retrieved tables count:\"+nb_table_"+cid+" + \" .");
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -18,7 +18,6 @@ skeleton="../templates/db_output_bulk.skeleton"
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
INode node = (INode)codeGenArgument.getArgument();
String cid = node.getUniqueName();
log4jCodeGenerateUtil.infoComponentStart(node);
String table = ElementParameterParser.getValue(node, "__TABLE__");
String file = ElementParameterParser.getValue(node,"__FILENAME__");
@@ -111,5 +110,4 @@ String skiprows = ElementParameterParser.getValue(node, "__SKIPROWS__");
if(!useExistingConnection) {
log4jCodeGenerateUtil.close(node);
}
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -62,7 +62,6 @@ if(thousandsSeparator.length() > 2){
noThousandsSeparator = true;
}
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jCodeGenerateUtil.infoComponentStart(node);
%>
<%
@@ -77,7 +76,6 @@ if(("UPDATE").equals(data_action)) {
%>
int keyCount_<%=cid%> = <%=keyCount%>;
if(keyCount_<%=cid%> == 0) {
<%log4jCodeGenerateUtil.logInfo(node,"fatal",cid+" - For bulk update, Schema must have a key at least.");%>
throw new RuntimeException("For bulk update, Schema must have a key at least.");
}
<%
@@ -704,7 +702,6 @@ normal_<%=cid %>.interrupt();
error_<%=cid %>.interrupt();
if ("true".equals((String)globalMap.get("<%=cid%>_SQLLOAD_ERROR"))) {
<%log4jCodeGenerateUtil.logInfo(node,"fatal","SQL load error!");%>
throw new TalendException(new java.lang.Exception() , "<%=cid%>" , globalMap);
}
<%

View File

@@ -17,7 +17,6 @@ imports="
boolean close = ("true").equals(ElementParameterParser.getValue(node,"__CLOSE__"));
String conn = "conn_" + connection;
log4jCodeGenerateUtil.infoComponentStart(node);
%>
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");
@@ -64,5 +63,4 @@ if(conn_<%=cid%> != null && !conn_<%=cid%>.isClosed()) {
}
%>
}
<%log4jCodeGenerateUtil.infoComponentEnd(node);%>

View File

@@ -168,7 +168,6 @@ try {
whetherReject_<%=cid%> = true;
<%
if (("true").equals(dieOnError)) {
log4jCodeGenerateUtil.logError(node,"fatal");
%>
throw(e);
<%

View File

@@ -20,7 +20,6 @@ imports="
String whereClause = ElementParameterParser.getValue(node,"__WHERE_CLAUSE__");
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jCodeGenerateUtil.infoComponentStart(node);
%>
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");
<%log4jCodeGenerateUtil.useExistConnection(node);%>

View File

@@ -16,5 +16,4 @@ stmt2_<%=cid%>.close();
globalMap.put("<%=cid%>_NB_TABLE", nb_table_<%=cid%>);
<%
log4jCodeGenerateUtil.logInfo(node,"info",cid+" - Retrieved tables count:\"+nb_table_"+cid+" + \" .");
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -37,7 +37,6 @@ boolean explicitIDs = ("true").equals(ElementParameterParser.getValue(node, "__E
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
String logLevel= ElementParameterParser.getValue(node, "__LOG_LEVEL__");
String logFile= ElementParameterParser.getValue(node, "__LOG_FILE__");
log4jCodeGenerateUtil.infoComponentStart(node);
%>
String tableName_<%=cid%> = null;
String dbschema_<%=cid%> = null;
@@ -265,5 +264,4 @@ if((columnList != null && columnList.size() > 0) || "CLEAR".equals(tableAction))
if(!useExistingConnection) {
log4jCodeGenerateUtil.close(node);
}
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -24,7 +24,6 @@ String dataAction = ElementParameterParser.getValue(node,"__DATA_ACTION__");
boolean standardConformingString= ("true").equals(ElementParameterParser.getValue(node,"__STANDARD_CONFORMING_STRING__"));
boolean convertToUppercase = false; // not active this function
boolean useExistingConnection = "true".equalsIgnoreCase(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
log4jCodeGenerateUtil.infoComponentStart(node);
%>
int deletedCount_<%=cid%>=0;
String tableName_<%=cid%> = null;
@@ -173,7 +172,6 @@ if(("UPDATE").equals(dataAction)) {
%>
int keyCount_<%=cid%> = <%=keyCount%>;
if(keyCount_<%=cid%> == 0) {
<%log4jCodeGenerateUtil.logInfo(node,"fatal",cid+" - For bulk update, Schema must have a key at least.");%>
throw new RuntimeException("For bulk update, Schema must have a key at least.");
}
tmpTableName_<%=cid%> = tableName_<%=cid%>;
@@ -252,6 +250,5 @@ if(("UPDATE").equals(dataAction)) {
if(!useExistingConnection) {
log4jCodeGenerateUtil.close(node);
}
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -219,7 +219,6 @@ if(("UPDATE").equals(dataAction)) {
%>
int keyCount_<%=cid%> = <%=keyCount%>;
if(keyCount_<%=cid%> == 0) {
<%log4jCodeGenerateUtil.logInfo(node,"fatal",cid+" - For bulk update, Schema must have a key at least.");%>
throw new RuntimeException("For bulk update, Schema must have a key at least.");
}
@@ -302,6 +301,5 @@ if(("UPDATE").equals(dataAction)) {
if(!useExistingConnection) {
log4jCodeGenerateUtil.close(node);
}
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -44,7 +44,6 @@ String dbschema = ElementParameterParser.getValue(node, "__DB_SCHEMA__");
String dbproperties = ElementParameterParser.getValue(node, "__PROPERTIES__");
boolean convertToUppercase = false; // not active this function
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
log4jCodeGenerateUtil.infoComponentStart(node);
%>
int deletedCount_<%=cid%>=0;
String dbschema_<%=cid%>= <%=dbschema%>;
@@ -61,7 +60,6 @@ if(("UPDATE").equals(dataAction)) {
%>
int keyCount_<%=cid%> = <%=keyCount%>;
if(keyCount_<%=cid%> == 0) {
<%log4jCodeGenerateUtil.logInfo(node,"fatal",cid+" - For bulk update, Schema must have a key at least.");%>
throw new RuntimeException("For bulk update, Schema must have a key at least.");
}
<%
@@ -278,6 +276,5 @@ error_<%=cid%>.interrupt();
log.info("<%=cid%> - Excute command: '" + command_<%=cid %> + "' has finished.");
<%
}
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -40,7 +40,6 @@ String fileName = ElementParameterParser.getValue(node, "__FILENAME__") ;
String dbVersion = ElementParameterParser.getValue(node, "__DB_VERSION__") ;
boolean isIncludeHeader = ("true").equals(ElementParameterParser.getValue(node,"__INCLUDEHEADER__"));
log4jCodeGenerateUtil.infoComponentStart(node);
List<IMetadataColumn> columnList = getColumnList(node);
@@ -229,5 +228,4 @@ if(!useExistingConn){
}
<%
}
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -41,7 +41,6 @@ boolean exitOnNoRows = ("true").equals(ElementParameterParser.getValue(node, "__
boolean hasNullString = !null_string.matches("\"\"");
boolean convertToUppercase = false; // not active this function
boolean useExistingConnection = "true".equalsIgnoreCase(ElementParameterParser.getValue(node,"__USE_EXISTING_CONNECTION__"));
log4jCodeGenerateUtil.infoComponentStart(node);
List<IMetadataColumn> columnList = getColumnList(node);
String db_version = ElementParameterParser.getValue(node, "__DB_VERSION__");
%>
@@ -130,7 +129,6 @@ if(("UPDATE").equals(dataAction)) {
%>
int keyCount_<%=cid%> = <%=keyCount%>;
if(keyCount_<%=cid%> == 0) {
<%log4jCodeGenerateUtil.logInfo(node,"fatal",cid+" - For bulk update, Schema must have a key at least.");%>
throw new RuntimeException("For bulk update, Schema must have a key at least.");
}
tableName_<%=cid%> = "tmp_<%=cid%>" + pid + Thread.currentThread().getId();
@@ -204,9 +202,6 @@ if(("INSERT").equals(dataAction) || columnList != null && columnList.size() > 0)
stmt_accept_reject_<%=cid %>.close();
if(<%=exitOnNoRows%> && copyNumber_<%=cid%> <= 0){
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - No record was loaded into component <%=cid %>." );
<%}%>
throw new RuntimeException("No record was loaded into component <%=cid %>");
}else{
<%if(isLog4jEnabled){%>
@@ -239,9 +234,6 @@ if(("INSERT").equals(dataAction) || columnList != null && columnList.size() > 0)
}
stmt_<%=cid %>.close();
if(<%=exitOnNoRows%> && nbLineBeforeLoad_<%=cid %> >= nbLineAfterLoad_<%=cid %>){
<%if(isLog4jEnabled){%>
log.fatal("<%=cid%> - No record was loaded in component <%=cid %>.");
<%}%>
throw new RuntimeException("No record was loaded in component <%=cid %>");
}else{
<%if(isLog4jEnabled){%>
@@ -290,7 +282,6 @@ if(("UPDATE").equals(dataAction) && columnList != null && columnList.size() > 0)
if(!useExistingConnection) {
log4jCodeGenerateUtil.close(node);
}
log4jCodeGenerateUtil.infoComponentEnd(node);
%>
}

View File

@@ -43,7 +43,6 @@ imports="
java.sql.Connection conn_<%=cid%> = null;
<%@ include file="../Log4j/Log4jDBConnUtil.javajet"%>
<%
log4jCodeGenerateUtil.infoComponentStart(node);
if(isUseSharedConnection){
%>
<%connUtil.useShareConnection(node);%>
@@ -79,5 +78,4 @@ imports="
}
<%
connUtil.afterComponentProcess(node);
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -23,4 +23,3 @@ imports="
<%log4jCodeGenerateUtil.close();%>
}
<%log4jCodeGenerateUtil.infoComponentEnd(node);%>

View File

@@ -17,7 +17,6 @@ imports="
boolean close = ("true").equals(ElementParameterParser.getValue(node,"__CLOSE__"));
String conn = "conn_" + connection;
log4jCodeGenerateUtil.infoComponentStart(node);
%>
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");
if(conn_<%=cid%> != null && !conn_<%=cid%>.isClosed())
@@ -32,4 +31,3 @@ if(conn_<%=cid%> != null && !conn_<%=cid%>.isClosed())
}
<% }%>
}
<%log4jCodeGenerateUtil.infoComponentEnd(node);%>

View File

@@ -17,7 +17,6 @@ imports="
boolean close = ("true").equals(ElementParameterParser.getValue(node,"__CLOSE__"));
String conn = "conn_" + connection;
log4jCodeGenerateUtil.infoComponentStart(node);
%>
java.sql.Connection conn_<%=cid%> = (java.sql.Connection)globalMap.get("<%=conn%>");
@@ -40,4 +39,3 @@ if(conn_<%=cid%> != null && !conn_<%=cid%>.isClosed()) {
}
%>
}
<%log4jCodeGenerateUtil.infoComponentEnd(node);%>

View File

@@ -22,7 +22,6 @@ imports="
boolean usePrepareStatement = "true".equals(ElementParameterParser.getValue(node,"__USE_PREPAREDSTATEMENT__"));
dbRowBeginUtil.beforeComponentProcess(node);
log4jCodeGenerateUtil = dbRowBeginUtil.log4jCodeGenerateUtil;
log4jCodeGenerateUtil.infoComponentStart(node);
%>
java.sql.Connection conn_<%=cid%> = null;
String query_<%=cid %> = "";

View File

@@ -49,5 +49,4 @@ imports="
}
log4jCodeGenerateUtil.close(node);
}
log4jCodeGenerateUtil.infoComponentEnd(node);
%>

View File

@@ -165,7 +165,6 @@ try {
whetherReject_<%=cid%> = true;
<%
if (("true").equals(dieOnError)) {
log4jCodeGenerateUtil.logError(node,"fatal");
%>
throw(e);
<%

View File

@@ -23,8 +23,10 @@ import org.talend.core.model.metadata.ColumnNameChanged;
import org.talend.core.model.metadata.IMetadataTable;
import org.talend.core.model.metadata.MetadataToolHelper;
import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.metadata.builder.connection.SalesforceSchemaConnection;
import org.talend.core.model.metadata.builder.connection.XmlFileConnection;
import org.talend.core.model.metadata.designerproperties.PropertyConstants.CDCTypeMode;
import org.talend.core.model.metadata.designerproperties.RepositoryToComponentProperty;
import org.talend.core.model.process.EParameterFieldType;
import org.talend.core.model.process.IElementParameter;
@@ -135,11 +137,32 @@ public class RepositoryChangeMetadataCommand extends ChangeMetadataCommand {
// repositorySchemaTypeParameter.setShow(false);
// }
// Xstream Cdc Type Mode
boolean isXstreamCdcTypeMode = false;
if (connection != null && connection instanceof DatabaseConnection) {
String cdcTypeMode = ((DatabaseConnection) connection).getCdcTypeMode();
if (CDCTypeMode.XSTREAM_MODE == CDCTypeMode.indexOf(cdcTypeMode)) {
isXstreamCdcTypeMode = true;
}
}
node.getElementParameter(EParameterName.UPDATE_COMPONENTS.getName()).setValue(true);
if (newOutputMetadata != null) {
Map<String, String> addMap = newOutputMetadata.getAdditionalProperties();
if (addMap.get(TaggedValueHelper.SYSTEMTABLENAME) != null && node.getComponent().getName().equals("tAS400CDC")) {
setDBTableFieldValue(node, addMap.get(TaggedValueHelper.SYSTEMTABLENAME), oldOutputMetadata.getTableName());
} else if (isXstreamCdcTypeMode) {
oldOutputMetadata.getListColumns().clear();
newOutputMetadata.getListColumns().clear();
IElementParameter elementParameter = node.getElementParameter(propName);
if (elementParameter != null) {
IElementParameter schemaTypeParam = elementParameter.getParentParameter().getChildParameters()
.get(EParameterName.SCHEMA_TYPE.getName());
if (schemaTypeParam != null) {
schemaTypeParam.setValue(EmfComponent.BUILTIN);
}
}
setDBTableFieldValue(node, newOutputMetadata.getTableName(), oldOutputMetadata.getTableName());
} else {
setDBTableFieldValue(node, newOutputMetadata.getTableName(), oldOutputMetadata.getTableName());
}