Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ============================================================================
- //
- // Copyright (c) 2006-2015, Talend Inc.
- //
- // This source code has been automatically generated by_Talend Open Studio for Data Integration
- // / Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- package bi.fact_snimek_dochazky_0_1;
- import routines.Numeric;
- import routines.DataOperation;
- import routines.TalendDataGenerator;
- import routines.TalendStringUtil;
- import routines.TalendString;
- import routines.StringHandling;
- import routines.Relational;
- import routines.TalendDate;
- import routines.Mathematical;
- import routines.system.*;
- import routines.system.api.*;
- import java.text.ParseException;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import java.util.List;
- import java.math.BigDecimal;
- import java.io.ByteArrayOutputStream;
- import java.io.ByteArrayInputStream;
- import java.io.DataInputStream;
- import java.io.DataOutputStream;
- import java.io.ObjectOutputStream;
- import java.io.ObjectInputStream;
- import java.io.IOException;
- import java.util.Comparator;
- @SuppressWarnings("unused")
- /**
- * Job: FACT_snimek_dochazky Purpose: <br>
- * Description: <br>
- * @author user@talend.com
- * @version 7.1.1.20181026_1147
- * @status
- */
- public class FACT_snimek_dochazky implements TalendJob {
- protected static void logIgnoredError(String message, Throwable cause) {
- System.err.println(message);
- if (cause != null) {
- cause.printStackTrace();
- }
- }
- public final Object obj = new Object();
- // for transmiting parameters purpose
- private Object valueObject = null;
- public Object getValueObject() {
- return this.valueObject;
- }
- public void setValueObject(Object valueObject) {
- this.valueObject = valueObject;
- }
- private final static String defaultCharset = java.nio.charset.Charset
- .defaultCharset().name();
- private final static String utf8Charset = "UTF-8";
- // contains type for every context property
- public class PropertiesWithType extends java.util.Properties {
- private static final long serialVersionUID = 1L;
- private java.util.Map<String, String> propertyTypes = new java.util.HashMap<>();
- public PropertiesWithType(java.util.Properties properties) {
- super(properties);
- }
- public PropertiesWithType() {
- super();
- }
- public void setContextType(String key, String type) {
- propertyTypes.put(key, type);
- }
- public String getContextType(String key) {
- return propertyTypes.get(key);
- }
- }
- // create and load default properties
- private java.util.Properties defaultProps = new java.util.Properties();
- // create application properties with default
- public class ContextProperties extends PropertiesWithType {
- private static final long serialVersionUID = 1L;
- public ContextProperties(java.util.Properties properties) {
- super(properties);
- }
- public ContextProperties() {
- super();
- }
- public void synchronizeContext() {
- }
- }
- private ContextProperties context = new ContextProperties();
- public ContextProperties getContext() {
- return this.context;
- }
- private final String jobVersion = "0.1";
- private final String jobName = "FACT_snimek_dochazky";
- private final String projectName = "BI";
- public Integer errorCode = null;
- private String currentComponent = "";
- private final java.util.Map<String, Object> globalMap = new java.util.HashMap<String, Object>();
- private final static java.util.Map<String, Object> junitGlobalMap = new java.util.HashMap<String, Object>();
- private final java.util.Map<String, Long> start_Hash = new java.util.HashMap<String, Long>();
- private final java.util.Map<String, Long> end_Hash = new java.util.HashMap<String, Long>();
- private final java.util.Map<String, Boolean> ok_Hash = new java.util.HashMap<String, Boolean>();
- public final java.util.List<String[]> globalBuffer = new java.util.ArrayList<String[]>();
- private RunStat runStat = new RunStat();
- // OSGi DataSource
- private final static String KEY_DB_DATASOURCES = "KEY_DB_DATASOURCES";
- private final static String KEY_DB_DATASOURCES_RAW = "KEY_DB_DATASOURCES_RAW";
- public void setDataSources(
- java.util.Map<String, javax.sql.DataSource> dataSources) {
- java.util.Map<String, routines.system.TalendDataSource> talendDataSources = new java.util.HashMap<String, routines.system.TalendDataSource>();
- for (java.util.Map.Entry<String, javax.sql.DataSource> dataSourceEntry : dataSources
- .entrySet()) {
- talendDataSources.put(
- dataSourceEntry.getKey(),
- new routines.system.TalendDataSource(dataSourceEntry
- .getValue()));
- }
- globalMap.put(KEY_DB_DATASOURCES, talendDataSources);
- globalMap
- .put(KEY_DB_DATASOURCES_RAW,
- new java.util.HashMap<String, javax.sql.DataSource>(
- dataSources));
- }
- private final java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
- private final java.io.PrintStream errorMessagePS = new java.io.PrintStream(
- new java.io.BufferedOutputStream(baos));
- public String getExceptionStackTrace() {
- if ("failure".equals(this.getStatus())) {
- errorMessagePS.flush();
- return baos.toString();
- }
- return null;
- }
- private Exception exception;
- public Exception getException() {
- if ("failure".equals(this.getStatus())) {
- return this.exception;
- }
- return null;
- }
- private class TalendException extends Exception {
- private static final long serialVersionUID = 1L;
- private java.util.Map<String, Object> globalMap = null;
- private Exception e = null;
- private String currentComponent = null;
- private String virtualComponentName = null;
- public void setVirtualComponentName(String virtualComponentName) {
- this.virtualComponentName = virtualComponentName;
- }
- private TalendException(Exception e, String errorComponent,
- final java.util.Map<String, Object> globalMap) {
- this.currentComponent = errorComponent;
- this.globalMap = globalMap;
- this.e = e;
- }
- public Exception getException() {
- return this.e;
- }
- public String getCurrentComponent() {
- return this.currentComponent;
- }
- public String getExceptionCauseMessage(Exception e) {
- Throwable cause = e;
- String message = null;
- int i = 10;
- while (null != cause && 0 < i--) {
- message = cause.getMessage();
- if (null == message) {
- cause = cause.getCause();
- } else {
- break;
- }
- }
- if (null == message) {
- message = e.getClass().getName();
- }
- return message;
- }
- @Override
- public void printStackTrace() {
- if (!(e instanceof TalendException || e instanceof TDieException)) {
- if (virtualComponentName != null
- && currentComponent.indexOf(virtualComponentName + "_") == 0) {
- globalMap.put(virtualComponentName + "_ERROR_MESSAGE",
- getExceptionCauseMessage(e));
- }
- globalMap.put(currentComponent + "_ERROR_MESSAGE",
- getExceptionCauseMessage(e));
- System.err.println("Exception in component " + currentComponent
- + " (" + jobName + ")");
- }
- if (!(e instanceof TDieException)) {
- if (e instanceof TalendException) {
- e.printStackTrace();
- } else {
- e.printStackTrace();
- e.printStackTrace(errorMessagePS);
- FACT_snimek_dochazky.this.exception = e;
- }
- }
- if (!(e instanceof TalendException)) {
- try {
- for (java.lang.reflect.Method m : this.getClass()
- .getEnclosingClass().getMethods()) {
- if (m.getName().compareTo(currentComponent + "_error") == 0) {
- m.invoke(FACT_snimek_dochazky.this, new Object[] {
- e, currentComponent, globalMap });
- break;
- }
- }
- if (!(e instanceof TDieException)) {
- }
- } catch (Exception e) {
- this.e.printStackTrace();
- }
- }
- }
- }
- public void tDBInput_1_error(Exception exception, String errorComponent,
- final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_1_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tMap_1_error(Exception exception, String errorComponent,
- final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_1_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tMap_2_error(Exception exception, String errorComponent,
- final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_6_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tDBOutput_1_error(Exception exception, String errorComponent,
- final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_6_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tDBInput_2_error(Exception exception, String errorComponent,
- final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_2_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tDBInput_3_error(Exception exception, String errorComponent,
- final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_3_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tDBInput_4_error(Exception exception, String errorComponent,
- final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_4_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tDBInput_5_error(Exception exception, String errorComponent,
- final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_5_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tDBInput_6_error(Exception exception, String errorComponent,
- final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_6_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tDBInput_7_error(Exception exception, String errorComponent,
- final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_7_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tDBInput_8_error(Exception exception, String errorComponent,
- final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_8_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tDBInput_9_error(Exception exception, String errorComponent,
- final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_9_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tDBInput_10_error(Exception exception, String errorComponent,
- final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_10_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tAdvancedHash_zamestnanec_error(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_1_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tAdvancedHash_row2_error(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_2_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tAdvancedHash_row11_error(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_3_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tAdvancedHash_row3_error(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_4_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tAdvancedHash_row5_error(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_5_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tAdvancedHash_row6_error(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_7_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tAdvancedHash_row7_error(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_8_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tAdvancedHash_row8_error(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_9_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tAdvancedHash_row9_error(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_10_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tAggregateRow_1_AGGOUT_error(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- tAggregateRow_1_AGGIN_error(exception, errorComponent, globalMap);
- }
- public void tAggregateRow_1_AGGIN_error(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- end_Hash.put(errorComponent, System.currentTimeMillis());
- status = "failure";
- tDBInput_6_onSubJobError(exception, errorComponent, globalMap);
- }
- public void tDBInput_1_onSubJobError(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
- .currentThread().getId() + "", "FATAL", "",
- exception.getMessage(),
- ResumeUtil.getExceptionStackTrace(exception), "");
- }
- public void tDBInput_2_onSubJobError(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
- .currentThread().getId() + "", "FATAL", "",
- exception.getMessage(),
- ResumeUtil.getExceptionStackTrace(exception), "");
- }
- public void tDBInput_3_onSubJobError(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
- .currentThread().getId() + "", "FATAL", "",
- exception.getMessage(),
- ResumeUtil.getExceptionStackTrace(exception), "");
- }
- public void tDBInput_4_onSubJobError(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
- .currentThread().getId() + "", "FATAL", "",
- exception.getMessage(),
- ResumeUtil.getExceptionStackTrace(exception), "");
- }
- public void tDBInput_5_onSubJobError(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
- .currentThread().getId() + "", "FATAL", "",
- exception.getMessage(),
- ResumeUtil.getExceptionStackTrace(exception), "");
- }
- public void tDBInput_6_onSubJobError(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
- .currentThread().getId() + "", "FATAL", "",
- exception.getMessage(),
- ResumeUtil.getExceptionStackTrace(exception), "");
- }
- public void tDBInput_7_onSubJobError(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
- .currentThread().getId() + "", "FATAL", "",
- exception.getMessage(),
- ResumeUtil.getExceptionStackTrace(exception), "");
- }
- public void tDBInput_8_onSubJobError(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
- .currentThread().getId() + "", "FATAL", "",
- exception.getMessage(),
- ResumeUtil.getExceptionStackTrace(exception), "");
- }
- public void tDBInput_9_onSubJobError(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
- .currentThread().getId() + "", "FATAL", "",
- exception.getMessage(),
- ResumeUtil.getExceptionStackTrace(exception), "");
- }
- public void tDBInput_10_onSubJobError(Exception exception,
- String errorComponent, final java.util.Map<String, Object> globalMap)
- throws TalendException {
- resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
- .currentThread().getId() + "", "FATAL", "",
- exception.getMessage(),
- ResumeUtil.getExceptionStackTrace(exception), "");
- }
- public static class zamestnanecStruct implements
- routines.system.IPersistableComparableLookupRow<zamestnanecStruct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- protected static final int DEFAULT_HASHCODE = 1;
- protected static final int PRIME = 31;
- protected int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- public String loopKey;
- public int idzamestnanci;
- public int getIdzamestnanci() {
- return this.idzamestnanci;
- }
- public int idpracoviste;
- public int getIdpracoviste() {
- return this.idpracoviste;
- }
- public int cislo_zamestnance;
- public int getCislo_zamestnance() {
- return this.cislo_zamestnance;
- }
- public Integer osobni_priplatek;
- public Integer getOsobni_priplatek() {
- return this.osobni_priplatek;
- }
- public int hodinova_sazba;
- public int getHodinova_sazba() {
- return this.hodinova_sazba;
- }
- public String nazev_profese;
- public String getNazev_profese() {
- return this.nazev_profese;
- }
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime * result + (int) this.cislo_zamestnance;
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final zamestnanecStruct other = (zamestnanecStruct) obj;
- if (this.cislo_zamestnance != other.cislo_zamestnance)
- return false;
- return true;
- }
- public void copyDataTo(zamestnanecStruct other) {
- other.idzamestnanci = this.idzamestnanci;
- other.idpracoviste = this.idpracoviste;
- other.cislo_zamestnance = this.cislo_zamestnance;
- other.osobni_priplatek = this.osobni_priplatek;
- other.hodinova_sazba = this.hodinova_sazba;
- other.nazev_profese = this.nazev_profese;
- }
- public void copyKeysDataTo(zamestnanecStruct other) {
- other.cislo_zamestnance = this.cislo_zamestnance;
- }
- private Integer readInteger(DataInputStream dis, ObjectInputStream ois)
- throws IOException {
- Integer intReturn;
- int length = 0;
- length = dis.readByte();
- if (length == -1) {
- intReturn = null;
- } else {
- intReturn = dis.readInt();
- }
- return intReturn;
- }
- private void writeInteger(Integer intNum, DataOutputStream dos,
- ObjectOutputStream oos) throws IOException {
- if (intNum == null) {
- dos.writeByte(-1);
- } else {
- dos.writeByte(0);
- dos.writeInt(intNum);
- }
- }
- private String readString(DataInputStream dis, ObjectInputStream ois)
- throws IOException {
- String strReturn = null;
- int length = 0;
- length = dis.readInt();
- if (length == -1) {
- strReturn = null;
- } else {
- byte[] byteArray = new byte[length];
- dis.read(byteArray);
- strReturn = new String(byteArray, utf8Charset);
- }
- return strReturn;
- }
- private void writeString(String str, DataOutputStream dos,
- ObjectOutputStream oos) throws IOException {
- if (str == null) {
- dos.writeInt(-1);
- } else {
- byte[] byteArray = str.getBytes(utf8Charset);
- dos.writeInt(byteArray.length);
- dos.write(byteArray);
- }
- }
- public void readKeysData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.cislo_zamestnance = dis.readInt();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeKeysData(ObjectOutputStream dos) {
- try {
- // int
- dos.writeInt(this.cislo_zamestnance);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Fill Values data by reading ObjectInputStream.
- */
- public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
- try {
- int length = 0;
- this.idzamestnanci = dis.readInt();
- this.idpracoviste = dis.readInt();
- this.osobni_priplatek = readInteger(dis, ois);
- this.hodinova_sazba = dis.readInt();
- this.nazev_profese = readString(dis, ois);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Return a byte array which represents Values data.
- */
- public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
- try {
- dos.writeInt(this.idzamestnanci);
- dos.writeInt(this.idpracoviste);
- writeInteger(this.osobni_priplatek, dos, oos);
- dos.writeInt(this.hodinova_sazba);
- writeString(this.nazev_profese, dos, oos);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("idzamestnanci=" + String.valueOf(idzamestnanci));
- sb.append(",idpracoviste=" + String.valueOf(idpracoviste));
- sb.append(",cislo_zamestnance=" + String.valueOf(cislo_zamestnance));
- sb.append(",osobni_priplatek=" + String.valueOf(osobni_priplatek));
- sb.append(",hodinova_sazba=" + String.valueOf(hodinova_sazba));
- sb.append(",nazev_profese=" + nazev_profese);
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(zamestnanecStruct other) {
- int returnValue = -1;
- returnValue = checkNullsAndCompare(this.cislo_zamestnance,
- other.cislo_zamestnance);
- if (returnValue != 0) {
- return returnValue;
- }
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public static class row1Struct implements
- routines.system.IPersistableRow<row1Struct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- public int idzamestnanci;
- public int getIdzamestnanci() {
- return this.idzamestnanci;
- }
- public int cislo_zamestnance;
- public int getCislo_zamestnance() {
- return this.cislo_zamestnance;
- }
- public String zkratka;
- public String getZkratka() {
- return this.zkratka;
- }
- public String jmeno;
- public String getJmeno() {
- return this.jmeno;
- }
- public String prijmeni;
- public String getPrijmeni() {
- return this.prijmeni;
- }
- public String kontaktni_email;
- public String getKontaktni_email() {
- return this.kontaktni_email;
- }
- public String ulice;
- public String getUlice() {
- return this.ulice;
- }
- public String cp;
- public String getCp() {
- return this.cp;
- }
- public String psc;
- public String getPsc() {
- return this.psc;
- }
- public String mesto;
- public String getMesto() {
- return this.mesto;
- }
- private String readString(ObjectInputStream dis) throws IOException {
- String strReturn = null;
- int length = 0;
- length = dis.readInt();
- if (length == -1) {
- strReturn = null;
- } else {
- if (length > commonByteArray_BI_FACT_snimek_dochazky.length) {
- if (length < 1024
- && commonByteArray_BI_FACT_snimek_dochazky.length == 0) {
- commonByteArray_BI_FACT_snimek_dochazky = new byte[1024];
- } else {
- commonByteArray_BI_FACT_snimek_dochazky = new byte[2 * length];
- }
- }
- dis.readFully(commonByteArray_BI_FACT_snimek_dochazky, 0,
- length);
- strReturn = new String(commonByteArray_BI_FACT_snimek_dochazky,
- 0, length, utf8Charset);
- }
- return strReturn;
- }
- private void writeString(String str, ObjectOutputStream dos)
- throws IOException {
- if (str == null) {
- dos.writeInt(-1);
- } else {
- byte[] byteArray = str.getBytes(utf8Charset);
- dos.writeInt(byteArray.length);
- dos.write(byteArray);
- }
- }
- public void readData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.idzamestnanci = dis.readInt();
- this.cislo_zamestnance = dis.readInt();
- this.zkratka = readString(dis);
- this.jmeno = readString(dis);
- this.prijmeni = readString(dis);
- this.kontaktni_email = readString(dis);
- this.ulice = readString(dis);
- this.cp = readString(dis);
- this.psc = readString(dis);
- this.mesto = readString(dis);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeData(ObjectOutputStream dos) {
- try {
- // int
- dos.writeInt(this.idzamestnanci);
- // int
- dos.writeInt(this.cislo_zamestnance);
- // String
- writeString(this.zkratka, dos);
- // String
- writeString(this.jmeno, dos);
- // String
- writeString(this.prijmeni, dos);
- // String
- writeString(this.kontaktni_email, dos);
- // String
- writeString(this.ulice, dos);
- // String
- writeString(this.cp, dos);
- // String
- writeString(this.psc, dos);
- // String
- writeString(this.mesto, dos);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("idzamestnanci=" + String.valueOf(idzamestnanci));
- sb.append(",cislo_zamestnance=" + String.valueOf(cislo_zamestnance));
- sb.append(",zkratka=" + zkratka);
- sb.append(",jmeno=" + jmeno);
- sb.append(",prijmeni=" + prijmeni);
- sb.append(",kontaktni_email=" + kontaktni_email);
- sb.append(",ulice=" + ulice);
- sb.append(",cp=" + cp);
- sb.append(",psc=" + psc);
- sb.append(",mesto=" + mesto);
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(row1Struct other) {
- int returnValue = -1;
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public static class after_tDBInput_1Struct implements
- routines.system.IPersistableRow<after_tDBInput_1Struct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- protected static final int DEFAULT_HASHCODE = 1;
- protected static final int PRIME = 31;
- protected int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- public String loopKey;
- public int idzamestnanci;
- public int getIdzamestnanci() {
- return this.idzamestnanci;
- }
- public int cislo_zamestnance;
- public int getCislo_zamestnance() {
- return this.cislo_zamestnance;
- }
- public String zkratka;
- public String getZkratka() {
- return this.zkratka;
- }
- public String jmeno;
- public String getJmeno() {
- return this.jmeno;
- }
- public String prijmeni;
- public String getPrijmeni() {
- return this.prijmeni;
- }
- public String kontaktni_email;
- public String getKontaktni_email() {
- return this.kontaktni_email;
- }
- public String ulice;
- public String getUlice() {
- return this.ulice;
- }
- public String cp;
- public String getCp() {
- return this.cp;
- }
- public String psc;
- public String getPsc() {
- return this.psc;
- }
- public String mesto;
- public String getMesto() {
- return this.mesto;
- }
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime * result + (int) this.idzamestnanci;
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final after_tDBInput_1Struct other = (after_tDBInput_1Struct) obj;
- if (this.idzamestnanci != other.idzamestnanci)
- return false;
- return true;
- }
- public void copyDataTo(after_tDBInput_1Struct other) {
- other.idzamestnanci = this.idzamestnanci;
- other.cislo_zamestnance = this.cislo_zamestnance;
- other.zkratka = this.zkratka;
- other.jmeno = this.jmeno;
- other.prijmeni = this.prijmeni;
- other.kontaktni_email = this.kontaktni_email;
- other.ulice = this.ulice;
- other.cp = this.cp;
- other.psc = this.psc;
- other.mesto = this.mesto;
- }
- public void copyKeysDataTo(after_tDBInput_1Struct other) {
- other.idzamestnanci = this.idzamestnanci;
- }
- private String readString(ObjectInputStream dis) throws IOException {
- String strReturn = null;
- int length = 0;
- length = dis.readInt();
- if (length == -1) {
- strReturn = null;
- } else {
- if (length > commonByteArray_BI_FACT_snimek_dochazky.length) {
- if (length < 1024
- && commonByteArray_BI_FACT_snimek_dochazky.length == 0) {
- commonByteArray_BI_FACT_snimek_dochazky = new byte[1024];
- } else {
- commonByteArray_BI_FACT_snimek_dochazky = new byte[2 * length];
- }
- }
- dis.readFully(commonByteArray_BI_FACT_snimek_dochazky, 0,
- length);
- strReturn = new String(commonByteArray_BI_FACT_snimek_dochazky,
- 0, length, utf8Charset);
- }
- return strReturn;
- }
- private void writeString(String str, ObjectOutputStream dos)
- throws IOException {
- if (str == null) {
- dos.writeInt(-1);
- } else {
- byte[] byteArray = str.getBytes(utf8Charset);
- dos.writeInt(byteArray.length);
- dos.write(byteArray);
- }
- }
- public void readData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.idzamestnanci = dis.readInt();
- this.cislo_zamestnance = dis.readInt();
- this.zkratka = readString(dis);
- this.jmeno = readString(dis);
- this.prijmeni = readString(dis);
- this.kontaktni_email = readString(dis);
- this.ulice = readString(dis);
- this.cp = readString(dis);
- this.psc = readString(dis);
- this.mesto = readString(dis);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeData(ObjectOutputStream dos) {
- try {
- // int
- dos.writeInt(this.idzamestnanci);
- // int
- dos.writeInt(this.cislo_zamestnance);
- // String
- writeString(this.zkratka, dos);
- // String
- writeString(this.jmeno, dos);
- // String
- writeString(this.prijmeni, dos);
- // String
- writeString(this.kontaktni_email, dos);
- // String
- writeString(this.ulice, dos);
- // String
- writeString(this.cp, dos);
- // String
- writeString(this.psc, dos);
- // String
- writeString(this.mesto, dos);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("idzamestnanci=" + String.valueOf(idzamestnanci));
- sb.append(",cislo_zamestnance=" + String.valueOf(cislo_zamestnance));
- sb.append(",zkratka=" + zkratka);
- sb.append(",jmeno=" + jmeno);
- sb.append(",prijmeni=" + prijmeni);
- sb.append(",kontaktni_email=" + kontaktni_email);
- sb.append(",ulice=" + ulice);
- sb.append(",cp=" + cp);
- sb.append(",psc=" + psc);
- sb.append(",mesto=" + mesto);
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(after_tDBInput_1Struct other) {
- int returnValue = -1;
- returnValue = checkNullsAndCompare(this.idzamestnanci,
- other.idzamestnanci);
- if (returnValue != 0) {
- return returnValue;
- }
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public void tDBInput_1Process(final java.util.Map<String, Object> globalMap)
- throws TalendException {
- globalMap.put("tDBInput_1_SUBPROCESS_STATE", 0);
- final boolean execStat = this.execStat;
- String iterateId = "";
- String currentComponent = "";
- java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
- try {
- // TDI-39566 avoid throwing an useless Exception
- boolean resumeIt = true;
- if (globalResumeTicket == false && resumeEntryMethodName != null) {
- String currentMethodName = new java.lang.Exception()
- .getStackTrace()[0].getMethodName();
- resumeIt = resumeEntryMethodName.equals(currentMethodName);
- }
- if (resumeIt || globalResumeTicket) { // start the resume
- globalResumeTicket = true;
- tDBInput_2Process(globalMap);
- tDBInput_4Process(globalMap);
- row1Struct row1 = new row1Struct();
- zamestnanecStruct zamestnanec = new zamestnanecStruct();
- /**
- * [tAdvancedHash_zamestnanec begin ] start
- */
- ok_Hash.put("tAdvancedHash_zamestnanec", false);
- start_Hash.put("tAdvancedHash_zamestnanec",
- System.currentTimeMillis());
- currentComponent = "tAdvancedHash_zamestnanec";
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null) {
- runStat.updateStatOnConnection("zamestnanec"
- + iterateId, 0, 0);
- }
- }
- int tos_count_tAdvancedHash_zamestnanec = 0;
- // connection name:zamestnanec
- // source node:tMap_1 - inputs:(row1,row2,row3)
- // outputs:(zamestnanec,zamestnanec) | target
- // node:tAdvancedHash_zamestnanec - inputs:(zamestnanec)
- // outputs:()
- // linked node: tMap_2 -
- // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
- // outputs:(out2)
- org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_zamestnanec = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<zamestnanecStruct> tHash_Lookup_zamestnanec = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
- .<zamestnanecStruct> getLookup(matchingModeEnum_zamestnanec);
- globalMap.put("tHash_Lookup_zamestnanec",
- tHash_Lookup_zamestnanec);
- /**
- * [tAdvancedHash_zamestnanec begin ] stop
- */
- /**
- * [tMap_1 begin ] start
- */
- ok_Hash.put("tMap_1", false);
- start_Hash.put("tMap_1", System.currentTimeMillis());
- currentComponent = "tMap_1";
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null) {
- runStat.updateStatOnConnection("row1" + iterateId, 0, 0);
- }
- }
- int tos_count_tMap_1 = 0;
- // ###############################
- // # Lookup's keys initialization
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row2Struct> tHash_Lookup_row2 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row2Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row2Struct>) globalMap
- .get("tHash_Lookup_row2"));
- row2Struct row2HashKey = new row2Struct();
- row2Struct row2Default = new row2Struct();
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row3Struct> tHash_Lookup_row3 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row3Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row3Struct>) globalMap
- .get("tHash_Lookup_row3"));
- row3Struct row3HashKey = new row3Struct();
- row3Struct row3Default = new row3Struct();
- // ###############################
- // ###############################
- // # Vars initialization
- class Var__tMap_1__Struct {
- }
- Var__tMap_1__Struct Var__tMap_1 = new Var__tMap_1__Struct();
- // ###############################
- // ###############################
- // # Outputs initialization
- zamestnanecStruct zamestnanec_tmp = new zamestnanecStruct();
- // ###############################
- /**
- * [tMap_1 begin ] stop
- */
- /**
- * [tDBInput_1 begin ] start
- */
- ok_Hash.put("tDBInput_1", false);
- start_Hash.put("tDBInput_1", System.currentTimeMillis());
- currentComponent = "tDBInput_1";
- int tos_count_tDBInput_1 = 0;
- org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_1 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
- .getMSSqlGenerateTimestampUtil();
- java.util.List<String> talendToDBList_tDBInput_1 = new java.util.ArrayList();
- String[] talendToDBArray_tDBInput_1 = new String[] { "FLOAT",
- "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
- "DECIMAL IDENTITY", "REAL" };
- java.util.Collections.addAll(talendToDBList_tDBInput_1,
- talendToDBArray_tDBInput_1);
- int nb_line_tDBInput_1 = 0;
- java.sql.Connection conn_tDBInput_1 = null;
- String driverClass_tDBInput_1 = "net.sourceforge.jtds.jdbc.Driver";
- java.lang.Class.forName(driverClass_tDBInput_1);
- String dbUser_tDBInput_1 = "tym1";
- final String decryptedPassword_tDBInput_1 = routines.system.PasswordEncryptUtil
- .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
- String dbPwd_tDBInput_1 = decryptedPassword_tDBInput_1;
- String port_tDBInput_1 = "1433";
- String dbname_tDBInput_1 = "tym1";
- String url_tDBInput_1 = "jdbc:jtds:sqlserver://"
- + "158.196.160.60";
- if (!"".equals(port_tDBInput_1)) {
- url_tDBInput_1 += ":" + "1433";
- }
- if (!"".equals(dbname_tDBInput_1)) {
- url_tDBInput_1 += "//" + "tym1";
- }
- url_tDBInput_1 += ";appName=" + projectName + ";" + "";
- String dbschema_tDBInput_1 = "";
- conn_tDBInput_1 = java.sql.DriverManager.getConnection(
- url_tDBInput_1, dbUser_tDBInput_1, dbPwd_tDBInput_1);
- java.sql.Statement stmt_tDBInput_1 = conn_tDBInput_1
- .createStatement();
- String dbquery_tDBInput_1 = "SELECT DIM_zamestnanci.idzamestnanci,\n DIM_zamestnanci.cislo_zamestnance,\n DIM_zamestnanci.zkratka,\n DIM_zamestnanci"
- + ".jmeno,\n DIM_zamestnanci.prijmeni,\n DIM_zamestnanci.kontaktni_email,\n DIM_zamestnanci.ulice,\n DIM_zamestnanci.cp,\n "
- + "DIM_zamestnanci.psc,\n DIM_zamestnanci.mesto\nFROM DIM_zamestnanci";
- globalMap.put("tDBInput_1_QUERY", dbquery_tDBInput_1);
- java.sql.ResultSet rs_tDBInput_1 = null;
- try {
- rs_tDBInput_1 = stmt_tDBInput_1
- .executeQuery(dbquery_tDBInput_1);
- java.sql.ResultSetMetaData rsmd_tDBInput_1 = rs_tDBInput_1
- .getMetaData();
- int colQtyInRs_tDBInput_1 = rsmd_tDBInput_1
- .getColumnCount();
- String tmpContent_tDBInput_1 = null;
- while (rs_tDBInput_1.next()) {
- nb_line_tDBInput_1++;
- if (colQtyInRs_tDBInput_1 < 1) {
- row1.idzamestnanci = 0;
- } else {
- if (rs_tDBInput_1.getObject(1) != null) {
- row1.idzamestnanci = rs_tDBInput_1.getInt(1);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_1 < 2) {
- row1.cislo_zamestnance = 0;
- } else {
- if (rs_tDBInput_1.getObject(2) != null) {
- row1.cislo_zamestnance = rs_tDBInput_1
- .getInt(2);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_1 < 3) {
- row1.zkratka = null;
- } else {
- tmpContent_tDBInput_1 = rs_tDBInput_1.getString(3);
- if (tmpContent_tDBInput_1 != null) {
- if (talendToDBList_tDBInput_1
- .contains(rsmd_tDBInput_1
- .getColumnTypeName(3)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row1.zkratka = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_1);
- } else {
- row1.zkratka = tmpContent_tDBInput_1;
- }
- } else {
- row1.zkratka = null;
- }
- }
- if (colQtyInRs_tDBInput_1 < 4) {
- row1.jmeno = null;
- } else {
- tmpContent_tDBInput_1 = rs_tDBInput_1.getString(4);
- if (tmpContent_tDBInput_1 != null) {
- if (talendToDBList_tDBInput_1
- .contains(rsmd_tDBInput_1
- .getColumnTypeName(4)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row1.jmeno = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_1);
- } else {
- row1.jmeno = tmpContent_tDBInput_1;
- }
- } else {
- row1.jmeno = null;
- }
- }
- if (colQtyInRs_tDBInput_1 < 5) {
- row1.prijmeni = null;
- } else {
- tmpContent_tDBInput_1 = rs_tDBInput_1.getString(5);
- if (tmpContent_tDBInput_1 != null) {
- if (talendToDBList_tDBInput_1
- .contains(rsmd_tDBInput_1
- .getColumnTypeName(5)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row1.prijmeni = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_1);
- } else {
- row1.prijmeni = tmpContent_tDBInput_1;
- }
- } else {
- row1.prijmeni = null;
- }
- }
- if (colQtyInRs_tDBInput_1 < 6) {
- row1.kontaktni_email = null;
- } else {
- tmpContent_tDBInput_1 = rs_tDBInput_1.getString(6);
- if (tmpContent_tDBInput_1 != null) {
- if (talendToDBList_tDBInput_1
- .contains(rsmd_tDBInput_1
- .getColumnTypeName(6)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row1.kontaktni_email = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_1);
- } else {
- row1.kontaktni_email = tmpContent_tDBInput_1;
- }
- } else {
- row1.kontaktni_email = null;
- }
- }
- if (colQtyInRs_tDBInput_1 < 7) {
- row1.ulice = null;
- } else {
- tmpContent_tDBInput_1 = rs_tDBInput_1.getString(7);
- if (tmpContent_tDBInput_1 != null) {
- if (talendToDBList_tDBInput_1
- .contains(rsmd_tDBInput_1
- .getColumnTypeName(7)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row1.ulice = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_1);
- } else {
- row1.ulice = tmpContent_tDBInput_1;
- }
- } else {
- row1.ulice = null;
- }
- }
- if (colQtyInRs_tDBInput_1 < 8) {
- row1.cp = null;
- } else {
- tmpContent_tDBInput_1 = rs_tDBInput_1.getString(8);
- if (tmpContent_tDBInput_1 != null) {
- if (talendToDBList_tDBInput_1
- .contains(rsmd_tDBInput_1
- .getColumnTypeName(8)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row1.cp = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_1);
- } else {
- row1.cp = tmpContent_tDBInput_1;
- }
- } else {
- row1.cp = null;
- }
- }
- if (colQtyInRs_tDBInput_1 < 9) {
- row1.psc = null;
- } else {
- tmpContent_tDBInput_1 = rs_tDBInput_1.getString(9);
- if (tmpContent_tDBInput_1 != null) {
- if (talendToDBList_tDBInput_1
- .contains(rsmd_tDBInput_1
- .getColumnTypeName(9)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row1.psc = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_1);
- } else {
- row1.psc = tmpContent_tDBInput_1;
- }
- } else {
- row1.psc = null;
- }
- }
- if (colQtyInRs_tDBInput_1 < 10) {
- row1.mesto = null;
- } else {
- tmpContent_tDBInput_1 = rs_tDBInput_1.getString(10);
- if (tmpContent_tDBInput_1 != null) {
- if (talendToDBList_tDBInput_1
- .contains(rsmd_tDBInput_1
- .getColumnTypeName(10)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row1.mesto = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_1);
- } else {
- row1.mesto = tmpContent_tDBInput_1;
- }
- } else {
- row1.mesto = null;
- }
- }
- /**
- * [tDBInput_1 begin ] stop
- */
- /**
- * [tDBInput_1 main ] start
- */
- currentComponent = "tDBInput_1";
- tos_count_tDBInput_1++;
- /**
- * [tDBInput_1 main ] stop
- */
- /**
- * [tDBInput_1 process_data_begin ] start
- */
- currentComponent = "tDBInput_1";
- /**
- * [tDBInput_1 process_data_begin ] stop
- */
- /**
- * [tMap_1 main ] start
- */
- currentComponent = "tMap_1";
- // row1
- // row1
- if (execStat) {
- runStat.updateStatOnConnection("row1" + iterateId,
- 1, 1);
- }
- boolean hasCasePrimitiveKeyWithNull_tMap_1 = false;
- // ###############################
- // # Input tables (lookups)
- boolean rejectedInnerJoin_tMap_1 = false;
- boolean mainRowRejected_tMap_1 = false;
- // /////////////////////////////////////////////
- // Starting Lookup Table "row2"
- // /////////////////////////////////////////////
- boolean forceLooprow2 = false;
- row2Struct row2ObjectFromLookup = null;
- if (!rejectedInnerJoin_tMap_1) { // G_TM_M_020
- hasCasePrimitiveKeyWithNull_tMap_1 = false;
- Object exprKeyValue_row2__idzamestnanci = row1.cislo_zamestnance;
- if (exprKeyValue_row2__idzamestnanci == null) {
- hasCasePrimitiveKeyWithNull_tMap_1 = true;
- } else {
- row2HashKey.idzamestnanci = (int) (Integer) exprKeyValue_row2__idzamestnanci;
- }
- row2HashKey.hashCodeDirty = true;
- if (!hasCasePrimitiveKeyWithNull_tMap_1) { // G_TM_M_091
- tHash_Lookup_row2.lookup(row2HashKey);
- } // G_TM_M_091
- if (hasCasePrimitiveKeyWithNull_tMap_1
- || !tHash_Lookup_row2.hasNext()) { // G_TM_M_090
- rejectedInnerJoin_tMap_1 = true;
- } // G_TM_M_090
- } // G_TM_M_020
- if (tHash_Lookup_row2 != null
- && tHash_Lookup_row2.getCount(row2HashKey) > 1) { // G
- // 071
- // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row2' and it contains more one result from keys : row2.idzamestnanci = '"
- // + row2HashKey.idzamestnanci + "'");
- } // G 071
- row2Struct row2 = null;
- row2Struct fromLookup_row2 = null;
- row2 = row2Default;
- if (tHash_Lookup_row2 != null
- && tHash_Lookup_row2.hasNext()) { // G 099
- fromLookup_row2 = tHash_Lookup_row2.next();
- } // G 099
- if (fromLookup_row2 != null) {
- row2 = fromLookup_row2;
- }
- // /////////////////////////////////////////////
- // Starting Lookup Table "row3"
- // /////////////////////////////////////////////
- boolean forceLooprow3 = false;
- row3Struct row3ObjectFromLookup = null;
- if (!rejectedInnerJoin_tMap_1) { // G_TM_M_020
- hasCasePrimitiveKeyWithNull_tMap_1 = false;
- Object exprKeyValue_row3__idsazby = row2.idsazby;
- if (exprKeyValue_row3__idsazby == null) {
- hasCasePrimitiveKeyWithNull_tMap_1 = true;
- } else {
- row3HashKey.idsazby = (int) (Integer) exprKeyValue_row3__idsazby;
- }
- row3HashKey.hashCodeDirty = true;
- if (!hasCasePrimitiveKeyWithNull_tMap_1) { // G_TM_M_091
- tHash_Lookup_row3.lookup(row3HashKey);
- } // G_TM_M_091
- if (hasCasePrimitiveKeyWithNull_tMap_1
- || !tHash_Lookup_row3.hasNext()) { // G_TM_M_090
- rejectedInnerJoin_tMap_1 = true;
- } // G_TM_M_090
- } // G_TM_M_020
- if (tHash_Lookup_row3 != null
- && tHash_Lookup_row3.getCount(row3HashKey) > 1) { // G
- // 071
- // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row3' and it contains more one result from keys : row3.idsazby = '"
- // + row3HashKey.idsazby + "'");
- } // G 071
- row3Struct row3 = null;
- row3Struct fromLookup_row3 = null;
- row3 = row3Default;
- if (tHash_Lookup_row3 != null
- && tHash_Lookup_row3.hasNext()) { // G 099
- fromLookup_row3 = tHash_Lookup_row3.next();
- } // G 099
- if (fromLookup_row3 != null) {
- row3 = fromLookup_row3;
- }
- // ###############################
- { // start of Var scope
- // ###############################
- // # Vars tables
- Var__tMap_1__Struct Var = Var__tMap_1;// ###############################
- // ###############################
- // # Output tables
- zamestnanec = null;
- if (!rejectedInnerJoin_tMap_1) {
- // # Output table : 'zamestnanec'
- zamestnanec_tmp.idzamestnanci = row1.idzamestnanci;
- zamestnanec_tmp.idpracoviste = row2.idpracoviste;
- zamestnanec_tmp.cislo_zamestnance = row1.cislo_zamestnance;
- zamestnanec_tmp.osobni_priplatek = row2.osobni_priplatek;
- zamestnanec_tmp.hodinova_sazba = row3.hodinova_sazba;
- zamestnanec_tmp.nazev_profese = row3.nazev_profese;
- zamestnanec = zamestnanec_tmp;
- } // closing inner join bracket (2)
- // ###############################
- } // end of Var scope
- rejectedInnerJoin_tMap_1 = false;
- tos_count_tMap_1++;
- /**
- * [tMap_1 main ] stop
- */
- /**
- * [tMap_1 process_data_begin ] start
- */
- currentComponent = "tMap_1";
- /**
- * [tMap_1 process_data_begin ] stop
- */
- // Start of branch "zamestnanec"
- if (zamestnanec != null) {
- /**
- * [tAdvancedHash_zamestnanec main ] start
- */
- currentComponent = "tAdvancedHash_zamestnanec";
- // zamestnanec
- // zamestnanec
- if (execStat) {
- runStat.updateStatOnConnection("zamestnanec"
- + iterateId, 1, 1);
- }
- zamestnanecStruct zamestnanec_HashRow = new zamestnanecStruct();
- zamestnanec_HashRow.idzamestnanci = zamestnanec.idzamestnanci;
- zamestnanec_HashRow.idpracoviste = zamestnanec.idpracoviste;
- zamestnanec_HashRow.cislo_zamestnance = zamestnanec.cislo_zamestnance;
- zamestnanec_HashRow.osobni_priplatek = zamestnanec.osobni_priplatek;
- zamestnanec_HashRow.hodinova_sazba = zamestnanec.hodinova_sazba;
- zamestnanec_HashRow.nazev_profese = zamestnanec.nazev_profese;
- tHash_Lookup_zamestnanec.put(zamestnanec_HashRow);
- tos_count_tAdvancedHash_zamestnanec++;
- /**
- * [tAdvancedHash_zamestnanec main ] stop
- */
- /**
- * [tAdvancedHash_zamestnanec process_data_begin ]
- * start
- */
- currentComponent = "tAdvancedHash_zamestnanec";
- /**
- * [tAdvancedHash_zamestnanec process_data_begin ]
- * stop
- */
- /**
- * [tAdvancedHash_zamestnanec process_data_end ]
- * start
- */
- currentComponent = "tAdvancedHash_zamestnanec";
- /**
- * [tAdvancedHash_zamestnanec process_data_end ]
- * stop
- */
- } // End of branch "zamestnanec"
- /**
- * [tMap_1 process_data_end ] start
- */
- currentComponent = "tMap_1";
- /**
- * [tMap_1 process_data_end ] stop
- */
- /**
- * [tDBInput_1 process_data_end ] start
- */
- currentComponent = "tDBInput_1";
- /**
- * [tDBInput_1 process_data_end ] stop
- */
- /**
- * [tDBInput_1 end ] start
- */
- currentComponent = "tDBInput_1";
- }
- } finally {
- if (rs_tDBInput_1 != null) {
- rs_tDBInput_1.close();
- }
- if (stmt_tDBInput_1 != null) {
- stmt_tDBInput_1.close();
- }
- if (conn_tDBInput_1 != null && !conn_tDBInput_1.isClosed()) {
- conn_tDBInput_1.close();
- }
- }
- globalMap.put("tDBInput_1_NB_LINE", nb_line_tDBInput_1);
- ok_Hash.put("tDBInput_1", true);
- end_Hash.put("tDBInput_1", System.currentTimeMillis());
- /**
- * [tDBInput_1 end ] stop
- */
- /**
- * [tMap_1 end ] start
- */
- currentComponent = "tMap_1";
- // ###############################
- // # Lookup hashes releasing
- if (tHash_Lookup_row2 != null) {
- tHash_Lookup_row2.endGet();
- }
- globalMap.remove("tHash_Lookup_row2");
- if (tHash_Lookup_row3 != null) {
- tHash_Lookup_row3.endGet();
- }
- globalMap.remove("tHash_Lookup_row3");
- // ###############################
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null
- || !((Boolean) resourceMap.get("inIterateVComp"))) {
- runStat.updateStatOnConnection("row1" + iterateId, 2, 0);
- }
- }
- ok_Hash.put("tMap_1", true);
- end_Hash.put("tMap_1", System.currentTimeMillis());
- /**
- * [tMap_1 end ] stop
- */
- /**
- * [tAdvancedHash_zamestnanec end ] start
- */
- currentComponent = "tAdvancedHash_zamestnanec";
- tHash_Lookup_zamestnanec.endPut();
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null
- || !((Boolean) resourceMap.get("inIterateVComp"))) {
- runStat.updateStatOnConnection("zamestnanec"
- + iterateId, 2, 0);
- }
- }
- ok_Hash.put("tAdvancedHash_zamestnanec", true);
- end_Hash.put("tAdvancedHash_zamestnanec",
- System.currentTimeMillis());
- /**
- * [tAdvancedHash_zamestnanec end ] stop
- */
- }// end the resume
- } catch (java.lang.Exception e) {
- TalendException te = new TalendException(e, currentComponent,
- globalMap);
- throw te;
- } catch (java.lang.Error error) {
- runStat.stopThreadStat();
- throw error;
- } finally {
- // free memory for "tMap_1"
- globalMap.remove("tHash_Lookup_row2");
- // free memory for "tMap_1"
- globalMap.remove("tHash_Lookup_row3");
- try {
- /**
- * [tDBInput_1 finally ] start
- */
- currentComponent = "tDBInput_1";
- /**
- * [tDBInput_1 finally ] stop
- */
- /**
- * [tMap_1 finally ] start
- */
- currentComponent = "tMap_1";
- /**
- * [tMap_1 finally ] stop
- */
- /**
- * [tAdvancedHash_zamestnanec finally ] start
- */
- currentComponent = "tAdvancedHash_zamestnanec";
- /**
- * [tAdvancedHash_zamestnanec finally ] stop
- */
- } catch (java.lang.Exception e) {
- // ignore
- } catch (java.lang.Error error) {
- // ignore
- }
- resourceMap = null;
- }
- globalMap.put("tDBInput_1_SUBPROCESS_STATE", 1);
- }
- public static class row2Struct implements
- routines.system.IPersistableComparableLookupRow<row2Struct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- protected static final int DEFAULT_HASHCODE = 1;
- protected static final int PRIME = 31;
- protected int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- public String loopKey;
- public int idzamestnanci;
- public int getIdzamestnanci() {
- return this.idzamestnanci;
- }
- public int idsazby;
- public int getIdsazby() {
- return this.idsazby;
- }
- public int idpracoviste;
- public int getIdpracoviste() {
- return this.idpracoviste;
- }
- public String jmeno;
- public String getJmeno() {
- return this.jmeno;
- }
- public String prijmeni;
- public String getPrijmeni() {
- return this.prijmeni;
- }
- public String kontaktni_email;
- public String getKontaktni_email() {
- return this.kontaktni_email;
- }
- public String zkratka;
- public String getZkratka() {
- return this.zkratka;
- }
- public Integer osobni_priplatek;
- public Integer getOsobni_priplatek() {
- return this.osobni_priplatek;
- }
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime * result + (int) this.idzamestnanci;
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final row2Struct other = (row2Struct) obj;
- if (this.idzamestnanci != other.idzamestnanci)
- return false;
- return true;
- }
- public void copyDataTo(row2Struct other) {
- other.idzamestnanci = this.idzamestnanci;
- other.idsazby = this.idsazby;
- other.idpracoviste = this.idpracoviste;
- other.jmeno = this.jmeno;
- other.prijmeni = this.prijmeni;
- other.kontaktni_email = this.kontaktni_email;
- other.zkratka = this.zkratka;
- other.osobni_priplatek = this.osobni_priplatek;
- }
- public void copyKeysDataTo(row2Struct other) {
- other.idzamestnanci = this.idzamestnanci;
- }
- private String readString(DataInputStream dis, ObjectInputStream ois)
- throws IOException {
- String strReturn = null;
- int length = 0;
- length = dis.readInt();
- if (length == -1) {
- strReturn = null;
- } else {
- byte[] byteArray = new byte[length];
- dis.read(byteArray);
- strReturn = new String(byteArray, utf8Charset);
- }
- return strReturn;
- }
- private void writeString(String str, DataOutputStream dos,
- ObjectOutputStream oos) throws IOException {
- if (str == null) {
- dos.writeInt(-1);
- } else {
- byte[] byteArray = str.getBytes(utf8Charset);
- dos.writeInt(byteArray.length);
- dos.write(byteArray);
- }
- }
- private Integer readInteger(DataInputStream dis, ObjectInputStream ois)
- throws IOException {
- Integer intReturn;
- int length = 0;
- length = dis.readByte();
- if (length == -1) {
- intReturn = null;
- } else {
- intReturn = dis.readInt();
- }
- return intReturn;
- }
- private void writeInteger(Integer intNum, DataOutputStream dos,
- ObjectOutputStream oos) throws IOException {
- if (intNum == null) {
- dos.writeByte(-1);
- } else {
- dos.writeByte(0);
- dos.writeInt(intNum);
- }
- }
- public void readKeysData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.idzamestnanci = dis.readInt();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeKeysData(ObjectOutputStream dos) {
- try {
- // int
- dos.writeInt(this.idzamestnanci);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Fill Values data by reading ObjectInputStream.
- */
- public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
- try {
- int length = 0;
- this.idsazby = dis.readInt();
- this.idpracoviste = dis.readInt();
- this.jmeno = readString(dis, ois);
- this.prijmeni = readString(dis, ois);
- this.kontaktni_email = readString(dis, ois);
- this.zkratka = readString(dis, ois);
- this.osobni_priplatek = readInteger(dis, ois);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Return a byte array which represents Values data.
- */
- public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
- try {
- dos.writeInt(this.idsazby);
- dos.writeInt(this.idpracoviste);
- writeString(this.jmeno, dos, oos);
- writeString(this.prijmeni, dos, oos);
- writeString(this.kontaktni_email, dos, oos);
- writeString(this.zkratka, dos, oos);
- writeInteger(this.osobni_priplatek, dos, oos);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("idzamestnanci=" + String.valueOf(idzamestnanci));
- sb.append(",idsazby=" + String.valueOf(idsazby));
- sb.append(",idpracoviste=" + String.valueOf(idpracoviste));
- sb.append(",jmeno=" + jmeno);
- sb.append(",prijmeni=" + prijmeni);
- sb.append(",kontaktni_email=" + kontaktni_email);
- sb.append(",zkratka=" + zkratka);
- sb.append(",osobni_priplatek=" + String.valueOf(osobni_priplatek));
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(row2Struct other) {
- int returnValue = -1;
- returnValue = checkNullsAndCompare(this.idzamestnanci,
- other.idzamestnanci);
- if (returnValue != 0) {
- return returnValue;
- }
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public void tDBInput_2Process(final java.util.Map<String, Object> globalMap)
- throws TalendException {
- globalMap.put("tDBInput_2_SUBPROCESS_STATE", 0);
- final boolean execStat = this.execStat;
- String iterateId = "";
- String currentComponent = "";
- java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
- try {
- // TDI-39566 avoid throwing an useless Exception
- boolean resumeIt = true;
- if (globalResumeTicket == false && resumeEntryMethodName != null) {
- String currentMethodName = new java.lang.Exception()
- .getStackTrace()[0].getMethodName();
- resumeIt = resumeEntryMethodName.equals(currentMethodName);
- }
- if (resumeIt || globalResumeTicket) { // start the resume
- globalResumeTicket = true;
- row2Struct row2 = new row2Struct();
- /**
- * [tAdvancedHash_row2 begin ] start
- */
- ok_Hash.put("tAdvancedHash_row2", false);
- start_Hash
- .put("tAdvancedHash_row2", System.currentTimeMillis());
- currentComponent = "tAdvancedHash_row2";
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null) {
- runStat.updateStatOnConnection("row2" + iterateId, 0, 0);
- }
- }
- int tos_count_tAdvancedHash_row2 = 0;
- // connection name:row2
- // source node:tDBInput_2 - inputs:(after_tDBInput_1)
- // outputs:(row2,row2) | target node:tAdvancedHash_row2 -
- // inputs:(row2) outputs:()
- // linked node: tMap_1 - inputs:(row1,row2,row3)
- // outputs:(zamestnanec,zamestnanec)
- org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row2 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row2Struct> tHash_Lookup_row2 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
- .<row2Struct> getLookup(matchingModeEnum_row2);
- globalMap.put("tHash_Lookup_row2", tHash_Lookup_row2);
- /**
- * [tAdvancedHash_row2 begin ] stop
- */
- /**
- * [tDBInput_2 begin ] start
- */
- ok_Hash.put("tDBInput_2", false);
- start_Hash.put("tDBInput_2", System.currentTimeMillis());
- currentComponent = "tDBInput_2";
- int tos_count_tDBInput_2 = 0;
- org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_2 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
- .getMSSqlGenerateTimestampUtil();
- java.util.List<String> talendToDBList_tDBInput_2 = new java.util.ArrayList();
- String[] talendToDBArray_tDBInput_2 = new String[] { "FLOAT",
- "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
- "DECIMAL IDENTITY", "REAL" };
- java.util.Collections.addAll(talendToDBList_tDBInput_2,
- talendToDBArray_tDBInput_2);
- int nb_line_tDBInput_2 = 0;
- java.sql.Connection conn_tDBInput_2 = null;
- String driverClass_tDBInput_2 = "net.sourceforge.jtds.jdbc.Driver";
- java.lang.Class.forName(driverClass_tDBInput_2);
- String dbUser_tDBInput_2 = "tym1";
- final String decryptedPassword_tDBInput_2 = routines.system.PasswordEncryptUtil
- .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
- String dbPwd_tDBInput_2 = decryptedPassword_tDBInput_2;
- String port_tDBInput_2 = "1433";
- String dbname_tDBInput_2 = "bi_zdroj01";
- String url_tDBInput_2 = "jdbc:jtds:sqlserver://"
- + "158.196.160.60";
- if (!"".equals(port_tDBInput_2)) {
- url_tDBInput_2 += ":" + "1433";
- }
- if (!"".equals(dbname_tDBInput_2)) {
- url_tDBInput_2 += "//" + "bi_zdroj01";
- }
- url_tDBInput_2 += ";appName=" + projectName + ";" + "";
- String dbschema_tDBInput_2 = "";
- conn_tDBInput_2 = java.sql.DriverManager.getConnection(
- url_tDBInput_2, dbUser_tDBInput_2, dbPwd_tDBInput_2);
- java.sql.Statement stmt_tDBInput_2 = conn_tDBInput_2
- .createStatement();
- String dbquery_tDBInput_2 = "SELECT zamestnanci.idzamestnanci,\n zamestnanci.idsazby,\n zamestnanci.idpracoviste,\n zamestnanci.jmeno,\n zamestnanci"
- + ".prijmeni,\n zamestnanci.kontaktni_email,\n zamestnanci.zkratka,\n zamestnanci.osobni_priplatek\nFROM zamestnanci";
- globalMap.put("tDBInput_2_QUERY", dbquery_tDBInput_2);
- java.sql.ResultSet rs_tDBInput_2 = null;
- try {
- rs_tDBInput_2 = stmt_tDBInput_2
- .executeQuery(dbquery_tDBInput_2);
- java.sql.ResultSetMetaData rsmd_tDBInput_2 = rs_tDBInput_2
- .getMetaData();
- int colQtyInRs_tDBInput_2 = rsmd_tDBInput_2
- .getColumnCount();
- String tmpContent_tDBInput_2 = null;
- while (rs_tDBInput_2.next()) {
- nb_line_tDBInput_2++;
- if (colQtyInRs_tDBInput_2 < 1) {
- row2.idzamestnanci = 0;
- } else {
- if (rs_tDBInput_2.getObject(1) != null) {
- row2.idzamestnanci = rs_tDBInput_2.getInt(1);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_2 < 2) {
- row2.idsazby = 0;
- } else {
- if (rs_tDBInput_2.getObject(2) != null) {
- row2.idsazby = rs_tDBInput_2.getInt(2);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_2 < 3) {
- row2.idpracoviste = 0;
- } else {
- if (rs_tDBInput_2.getObject(3) != null) {
- row2.idpracoviste = rs_tDBInput_2.getInt(3);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_2 < 4) {
- row2.jmeno = null;
- } else {
- tmpContent_tDBInput_2 = rs_tDBInput_2.getString(4);
- if (tmpContent_tDBInput_2 != null) {
- if (talendToDBList_tDBInput_2
- .contains(rsmd_tDBInput_2
- .getColumnTypeName(4)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row2.jmeno = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_2);
- } else {
- row2.jmeno = tmpContent_tDBInput_2;
- }
- } else {
- row2.jmeno = null;
- }
- }
- if (colQtyInRs_tDBInput_2 < 5) {
- row2.prijmeni = null;
- } else {
- tmpContent_tDBInput_2 = rs_tDBInput_2.getString(5);
- if (tmpContent_tDBInput_2 != null) {
- if (talendToDBList_tDBInput_2
- .contains(rsmd_tDBInput_2
- .getColumnTypeName(5)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row2.prijmeni = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_2);
- } else {
- row2.prijmeni = tmpContent_tDBInput_2;
- }
- } else {
- row2.prijmeni = null;
- }
- }
- if (colQtyInRs_tDBInput_2 < 6) {
- row2.kontaktni_email = null;
- } else {
- tmpContent_tDBInput_2 = rs_tDBInput_2.getString(6);
- if (tmpContent_tDBInput_2 != null) {
- if (talendToDBList_tDBInput_2
- .contains(rsmd_tDBInput_2
- .getColumnTypeName(6)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row2.kontaktni_email = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_2);
- } else {
- row2.kontaktni_email = tmpContent_tDBInput_2;
- }
- } else {
- row2.kontaktni_email = null;
- }
- }
- if (colQtyInRs_tDBInput_2 < 7) {
- row2.zkratka = null;
- } else {
- tmpContent_tDBInput_2 = rs_tDBInput_2.getString(7);
- if (tmpContent_tDBInput_2 != null) {
- if (talendToDBList_tDBInput_2
- .contains(rsmd_tDBInput_2
- .getColumnTypeName(7)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row2.zkratka = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_2);
- } else {
- row2.zkratka = tmpContent_tDBInput_2;
- }
- } else {
- row2.zkratka = null;
- }
- }
- if (colQtyInRs_tDBInput_2 < 8) {
- row2.osobni_priplatek = null;
- } else {
- if (rs_tDBInput_2.getObject(8) != null) {
- row2.osobni_priplatek = rs_tDBInput_2.getInt(8);
- } else {
- row2.osobni_priplatek = null;
- }
- }
- /**
- * [tDBInput_2 begin ] stop
- */
- /**
- * [tDBInput_2 main ] start
- */
- currentComponent = "tDBInput_2";
- tos_count_tDBInput_2++;
- /**
- * [tDBInput_2 main ] stop
- */
- /**
- * [tDBInput_2 process_data_begin ] start
- */
- currentComponent = "tDBInput_2";
- /**
- * [tDBInput_2 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row2 main ] start
- */
- currentComponent = "tAdvancedHash_row2";
- // row2
- // row2
- if (execStat) {
- runStat.updateStatOnConnection("row2" + iterateId,
- 1, 1);
- }
- row2Struct row2_HashRow = new row2Struct();
- row2_HashRow.idzamestnanci = row2.idzamestnanci;
- row2_HashRow.idsazby = row2.idsazby;
- row2_HashRow.idpracoviste = row2.idpracoviste;
- row2_HashRow.jmeno = row2.jmeno;
- row2_HashRow.prijmeni = row2.prijmeni;
- row2_HashRow.kontaktni_email = row2.kontaktni_email;
- row2_HashRow.zkratka = row2.zkratka;
- row2_HashRow.osobni_priplatek = row2.osobni_priplatek;
- tHash_Lookup_row2.put(row2_HashRow);
- tos_count_tAdvancedHash_row2++;
- /**
- * [tAdvancedHash_row2 main ] stop
- */
- /**
- * [tAdvancedHash_row2 process_data_begin ] start
- */
- currentComponent = "tAdvancedHash_row2";
- /**
- * [tAdvancedHash_row2 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row2 process_data_end ] start
- */
- currentComponent = "tAdvancedHash_row2";
- /**
- * [tAdvancedHash_row2 process_data_end ] stop
- */
- /**
- * [tDBInput_2 process_data_end ] start
- */
- currentComponent = "tDBInput_2";
- /**
- * [tDBInput_2 process_data_end ] stop
- */
- /**
- * [tDBInput_2 end ] start
- */
- currentComponent = "tDBInput_2";
- }
- } finally {
- if (rs_tDBInput_2 != null) {
- rs_tDBInput_2.close();
- }
- if (stmt_tDBInput_2 != null) {
- stmt_tDBInput_2.close();
- }
- if (conn_tDBInput_2 != null && !conn_tDBInput_2.isClosed()) {
- conn_tDBInput_2.close();
- }
- }
- globalMap.put("tDBInput_2_NB_LINE", nb_line_tDBInput_2);
- ok_Hash.put("tDBInput_2", true);
- end_Hash.put("tDBInput_2", System.currentTimeMillis());
- /**
- * [tDBInput_2 end ] stop
- */
- /**
- * [tAdvancedHash_row2 end ] start
- */
- currentComponent = "tAdvancedHash_row2";
- tHash_Lookup_row2.endPut();
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null
- || !((Boolean) resourceMap.get("inIterateVComp"))) {
- runStat.updateStatOnConnection("row2" + iterateId, 2, 0);
- }
- }
- ok_Hash.put("tAdvancedHash_row2", true);
- end_Hash.put("tAdvancedHash_row2", System.currentTimeMillis());
- /**
- * [tAdvancedHash_row2 end ] stop
- */
- }// end the resume
- } catch (java.lang.Exception e) {
- TalendException te = new TalendException(e, currentComponent,
- globalMap);
- throw te;
- } catch (java.lang.Error error) {
- runStat.stopThreadStat();
- throw error;
- } finally {
- try {
- /**
- * [tDBInput_2 finally ] start
- */
- currentComponent = "tDBInput_2";
- /**
- * [tDBInput_2 finally ] stop
- */
- /**
- * [tAdvancedHash_row2 finally ] start
- */
- currentComponent = "tAdvancedHash_row2";
- /**
- * [tAdvancedHash_row2 finally ] stop
- */
- } catch (java.lang.Exception e) {
- // ignore
- } catch (java.lang.Error error) {
- // ignore
- }
- resourceMap = null;
- }
- globalMap.put("tDBInput_2_SUBPROCESS_STATE", 1);
- }
- public static class row11Struct implements
- routines.system.IPersistableComparableLookupRow<row11Struct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- protected static final int DEFAULT_HASHCODE = 1;
- protected static final int PRIME = 31;
- protected int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- public String loopKey;
- public int idodmeny;
- public int getIdodmeny() {
- return this.idodmeny;
- }
- public int idzamestnanci;
- public int getIdzamestnanci() {
- return this.idzamestnanci;
- }
- public short mesic;
- public short getMesic() {
- return this.mesic;
- }
- public short rok;
- public short getRok() {
- return this.rok;
- }
- public int odmena;
- public int getOdmena() {
- return this.odmena;
- }
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime * result + (int) this.idzamestnanci;
- result = prime * result + (int) this.mesic;
- result = prime * result + (int) this.rok;
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final row11Struct other = (row11Struct) obj;
- if (this.idzamestnanci != other.idzamestnanci)
- return false;
- if (this.mesic != other.mesic)
- return false;
- if (this.rok != other.rok)
- return false;
- return true;
- }
- public void copyDataTo(row11Struct other) {
- other.idodmeny = this.idodmeny;
- other.idzamestnanci = this.idzamestnanci;
- other.mesic = this.mesic;
- other.rok = this.rok;
- other.odmena = this.odmena;
- }
- public void copyKeysDataTo(row11Struct other) {
- other.idzamestnanci = this.idzamestnanci;
- other.mesic = this.mesic;
- other.rok = this.rok;
- }
- public void readKeysData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.idzamestnanci = dis.readInt();
- this.mesic = dis.readShort();
- this.rok = dis.readShort();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeKeysData(ObjectOutputStream dos) {
- try {
- // int
- dos.writeInt(this.idzamestnanci);
- // short
- dos.writeShort(this.mesic);
- // short
- dos.writeShort(this.rok);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Fill Values data by reading ObjectInputStream.
- */
- public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
- try {
- int length = 0;
- this.idodmeny = dis.readInt();
- this.odmena = dis.readInt();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Return a byte array which represents Values data.
- */
- public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
- try {
- dos.writeInt(this.idodmeny);
- dos.writeInt(this.odmena);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("idodmeny=" + String.valueOf(idodmeny));
- sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
- sb.append(",mesic=" + String.valueOf(mesic));
- sb.append(",rok=" + String.valueOf(rok));
- sb.append(",odmena=" + String.valueOf(odmena));
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(row11Struct other) {
- int returnValue = -1;
- returnValue = checkNullsAndCompare(this.idzamestnanci,
- other.idzamestnanci);
- if (returnValue != 0) {
- return returnValue;
- }
- returnValue = checkNullsAndCompare(this.mesic, other.mesic);
- if (returnValue != 0) {
- return returnValue;
- }
- returnValue = checkNullsAndCompare(this.rok, other.rok);
- if (returnValue != 0) {
- return returnValue;
- }
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public void tDBInput_3Process(final java.util.Map<String, Object> globalMap)
- throws TalendException {
- globalMap.put("tDBInput_3_SUBPROCESS_STATE", 0);
- final boolean execStat = this.execStat;
- String iterateId = "";
- String currentComponent = "";
- java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
- try {
- // TDI-39566 avoid throwing an useless Exception
- boolean resumeIt = true;
- if (globalResumeTicket == false && resumeEntryMethodName != null) {
- String currentMethodName = new java.lang.Exception()
- .getStackTrace()[0].getMethodName();
- resumeIt = resumeEntryMethodName.equals(currentMethodName);
- }
- if (resumeIt || globalResumeTicket) { // start the resume
- globalResumeTicket = true;
- row11Struct row11 = new row11Struct();
- /**
- * [tAdvancedHash_row11 begin ] start
- */
- ok_Hash.put("tAdvancedHash_row11", false);
- start_Hash.put("tAdvancedHash_row11",
- System.currentTimeMillis());
- currentComponent = "tAdvancedHash_row11";
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null) {
- runStat.updateStatOnConnection("row11" + iterateId, 0,
- 0);
- }
- }
- int tos_count_tAdvancedHash_row11 = 0;
- // connection name:row11
- // source node:tDBInput_3 - inputs:(after_tDBInput_6)
- // outputs:(row11,row11) | target node:tAdvancedHash_row11 -
- // inputs:(row11) outputs:()
- // linked node: tMap_2 -
- // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
- // outputs:(out2)
- org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row11 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row11Struct> tHash_Lookup_row11 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
- .<row11Struct> getLookup(matchingModeEnum_row11);
- globalMap.put("tHash_Lookup_row11", tHash_Lookup_row11);
- /**
- * [tAdvancedHash_row11 begin ] stop
- */
- /**
- * [tDBInput_3 begin ] start
- */
- ok_Hash.put("tDBInput_3", false);
- start_Hash.put("tDBInput_3", System.currentTimeMillis());
- currentComponent = "tDBInput_3";
- int tos_count_tDBInput_3 = 0;
- org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_3 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
- .getMSSqlGenerateTimestampUtil();
- java.util.List<String> talendToDBList_tDBInput_3 = new java.util.ArrayList();
- String[] talendToDBArray_tDBInput_3 = new String[] { "FLOAT",
- "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
- "DECIMAL IDENTITY", "REAL" };
- java.util.Collections.addAll(talendToDBList_tDBInput_3,
- talendToDBArray_tDBInput_3);
- int nb_line_tDBInput_3 = 0;
- java.sql.Connection conn_tDBInput_3 = null;
- String driverClass_tDBInput_3 = "net.sourceforge.jtds.jdbc.Driver";
- java.lang.Class.forName(driverClass_tDBInput_3);
- String dbUser_tDBInput_3 = "tym1";
- final String decryptedPassword_tDBInput_3 = routines.system.PasswordEncryptUtil
- .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
- String dbPwd_tDBInput_3 = decryptedPassword_tDBInput_3;
- String port_tDBInput_3 = "1433";
- String dbname_tDBInput_3 = "bi_zdroj01";
- String url_tDBInput_3 = "jdbc:jtds:sqlserver://"
- + "158.196.160.60";
- if (!"".equals(port_tDBInput_3)) {
- url_tDBInput_3 += ":" + "1433";
- }
- if (!"".equals(dbname_tDBInput_3)) {
- url_tDBInput_3 += "//" + "bi_zdroj01";
- }
- url_tDBInput_3 += ";appName=" + projectName + ";" + "";
- String dbschema_tDBInput_3 = "";
- conn_tDBInput_3 = java.sql.DriverManager.getConnection(
- url_tDBInput_3, dbUser_tDBInput_3, dbPwd_tDBInput_3);
- java.sql.Statement stmt_tDBInput_3 = conn_tDBInput_3
- .createStatement();
- String dbquery_tDBInput_3 = "SELECT odmeny.idodmeny,\n odmeny.idzamestnanci,\n odmeny.mesic,\n odmeny.rok,\n odmeny.odmena\nFROM odmeny";
- globalMap.put("tDBInput_3_QUERY", dbquery_tDBInput_3);
- java.sql.ResultSet rs_tDBInput_3 = null;
- try {
- rs_tDBInput_3 = stmt_tDBInput_3
- .executeQuery(dbquery_tDBInput_3);
- java.sql.ResultSetMetaData rsmd_tDBInput_3 = rs_tDBInput_3
- .getMetaData();
- int colQtyInRs_tDBInput_3 = rsmd_tDBInput_3
- .getColumnCount();
- String tmpContent_tDBInput_3 = null;
- while (rs_tDBInput_3.next()) {
- nb_line_tDBInput_3++;
- if (colQtyInRs_tDBInput_3 < 1) {
- row11.idodmeny = 0;
- } else {
- if (rs_tDBInput_3.getObject(1) != null) {
- row11.idodmeny = rs_tDBInput_3.getInt(1);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_3 < 2) {
- row11.idzamestnanci = 0;
- } else {
- if (rs_tDBInput_3.getObject(2) != null) {
- row11.idzamestnanci = rs_tDBInput_3.getInt(2);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_3 < 3) {
- row11.mesic = 0;
- } else {
- if (rs_tDBInput_3.getObject(3) != null) {
- row11.mesic = rs_tDBInput_3.getShort(3);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_3 < 4) {
- row11.rok = 0;
- } else {
- if (rs_tDBInput_3.getObject(4) != null) {
- row11.rok = rs_tDBInput_3.getShort(4);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_3 < 5) {
- row11.odmena = 0;
- } else {
- if (rs_tDBInput_3.getObject(5) != null) {
- row11.odmena = rs_tDBInput_3.getInt(5);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- /**
- * [tDBInput_3 begin ] stop
- */
- /**
- * [tDBInput_3 main ] start
- */
- currentComponent = "tDBInput_3";
- tos_count_tDBInput_3++;
- /**
- * [tDBInput_3 main ] stop
- */
- /**
- * [tDBInput_3 process_data_begin ] start
- */
- currentComponent = "tDBInput_3";
- /**
- * [tDBInput_3 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row11 main ] start
- */
- currentComponent = "tAdvancedHash_row11";
- // row11
- // row11
- if (execStat) {
- runStat.updateStatOnConnection("row11" + iterateId,
- 1, 1);
- }
- row11Struct row11_HashRow = new row11Struct();
- row11_HashRow.idodmeny = row11.idodmeny;
- row11_HashRow.idzamestnanci = row11.idzamestnanci;
- row11_HashRow.mesic = row11.mesic;
- row11_HashRow.rok = row11.rok;
- row11_HashRow.odmena = row11.odmena;
- tHash_Lookup_row11.put(row11_HashRow);
- tos_count_tAdvancedHash_row11++;
- /**
- * [tAdvancedHash_row11 main ] stop
- */
- /**
- * [tAdvancedHash_row11 process_data_begin ] start
- */
- currentComponent = "tAdvancedHash_row11";
- /**
- * [tAdvancedHash_row11 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row11 process_data_end ] start
- */
- currentComponent = "tAdvancedHash_row11";
- /**
- * [tAdvancedHash_row11 process_data_end ] stop
- */
- /**
- * [tDBInput_3 process_data_end ] start
- */
- currentComponent = "tDBInput_3";
- /**
- * [tDBInput_3 process_data_end ] stop
- */
- /**
- * [tDBInput_3 end ] start
- */
- currentComponent = "tDBInput_3";
- }
- } finally {
- if (rs_tDBInput_3 != null) {
- rs_tDBInput_3.close();
- }
- if (stmt_tDBInput_3 != null) {
- stmt_tDBInput_3.close();
- }
- if (conn_tDBInput_3 != null && !conn_tDBInput_3.isClosed()) {
- conn_tDBInput_3.close();
- }
- }
- globalMap.put("tDBInput_3_NB_LINE", nb_line_tDBInput_3);
- ok_Hash.put("tDBInput_3", true);
- end_Hash.put("tDBInput_3", System.currentTimeMillis());
- /**
- * [tDBInput_3 end ] stop
- */
- /**
- * [tAdvancedHash_row11 end ] start
- */
- currentComponent = "tAdvancedHash_row11";
- tHash_Lookup_row11.endPut();
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null
- || !((Boolean) resourceMap.get("inIterateVComp"))) {
- runStat.updateStatOnConnection("row11" + iterateId, 2,
- 0);
- }
- }
- ok_Hash.put("tAdvancedHash_row11", true);
- end_Hash.put("tAdvancedHash_row11", System.currentTimeMillis());
- /**
- * [tAdvancedHash_row11 end ] stop
- */
- }// end the resume
- } catch (java.lang.Exception e) {
- TalendException te = new TalendException(e, currentComponent,
- globalMap);
- throw te;
- } catch (java.lang.Error error) {
- runStat.stopThreadStat();
- throw error;
- } finally {
- try {
- /**
- * [tDBInput_3 finally ] start
- */
- currentComponent = "tDBInput_3";
- /**
- * [tDBInput_3 finally ] stop
- */
- /**
- * [tAdvancedHash_row11 finally ] start
- */
- currentComponent = "tAdvancedHash_row11";
- /**
- * [tAdvancedHash_row11 finally ] stop
- */
- } catch (java.lang.Exception e) {
- // ignore
- } catch (java.lang.Error error) {
- // ignore
- }
- resourceMap = null;
- }
- globalMap.put("tDBInput_3_SUBPROCESS_STATE", 1);
- }
- public static class row3Struct implements
- routines.system.IPersistableComparableLookupRow<row3Struct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- protected static final int DEFAULT_HASHCODE = 1;
- protected static final int PRIME = 31;
- protected int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- public String loopKey;
- public int idsazby;
- public int getIdsazby() {
- return this.idsazby;
- }
- public String nazev_profese;
- public String getNazev_profese() {
- return this.nazev_profese;
- }
- public int hodinova_sazba;
- public int getHodinova_sazba() {
- return this.hodinova_sazba;
- }
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime * result + (int) this.idsazby;
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final row3Struct other = (row3Struct) obj;
- if (this.idsazby != other.idsazby)
- return false;
- return true;
- }
- public void copyDataTo(row3Struct other) {
- other.idsazby = this.idsazby;
- other.nazev_profese = this.nazev_profese;
- other.hodinova_sazba = this.hodinova_sazba;
- }
- public void copyKeysDataTo(row3Struct other) {
- other.idsazby = this.idsazby;
- }
- private String readString(DataInputStream dis, ObjectInputStream ois)
- throws IOException {
- String strReturn = null;
- int length = 0;
- length = dis.readInt();
- if (length == -1) {
- strReturn = null;
- } else {
- byte[] byteArray = new byte[length];
- dis.read(byteArray);
- strReturn = new String(byteArray, utf8Charset);
- }
- return strReturn;
- }
- private void writeString(String str, DataOutputStream dos,
- ObjectOutputStream oos) throws IOException {
- if (str == null) {
- dos.writeInt(-1);
- } else {
- byte[] byteArray = str.getBytes(utf8Charset);
- dos.writeInt(byteArray.length);
- dos.write(byteArray);
- }
- }
- public void readKeysData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.idsazby = dis.readInt();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeKeysData(ObjectOutputStream dos) {
- try {
- // int
- dos.writeInt(this.idsazby);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Fill Values data by reading ObjectInputStream.
- */
- public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
- try {
- int length = 0;
- this.nazev_profese = readString(dis, ois);
- this.hodinova_sazba = dis.readInt();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Return a byte array which represents Values data.
- */
- public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
- try {
- writeString(this.nazev_profese, dos, oos);
- dos.writeInt(this.hodinova_sazba);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("idsazby=" + String.valueOf(idsazby));
- sb.append(",nazev_profese=" + nazev_profese);
- sb.append(",hodinova_sazba=" + String.valueOf(hodinova_sazba));
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(row3Struct other) {
- int returnValue = -1;
- returnValue = checkNullsAndCompare(this.idsazby, other.idsazby);
- if (returnValue != 0) {
- return returnValue;
- }
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public void tDBInput_4Process(final java.util.Map<String, Object> globalMap)
- throws TalendException {
- globalMap.put("tDBInput_4_SUBPROCESS_STATE", 0);
- final boolean execStat = this.execStat;
- String iterateId = "";
- String currentComponent = "";
- java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
- try {
- // TDI-39566 avoid throwing an useless Exception
- boolean resumeIt = true;
- if (globalResumeTicket == false && resumeEntryMethodName != null) {
- String currentMethodName = new java.lang.Exception()
- .getStackTrace()[0].getMethodName();
- resumeIt = resumeEntryMethodName.equals(currentMethodName);
- }
- if (resumeIt || globalResumeTicket) { // start the resume
- globalResumeTicket = true;
- row3Struct row3 = new row3Struct();
- /**
- * [tAdvancedHash_row3 begin ] start
- */
- ok_Hash.put("tAdvancedHash_row3", false);
- start_Hash
- .put("tAdvancedHash_row3", System.currentTimeMillis());
- currentComponent = "tAdvancedHash_row3";
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null) {
- runStat.updateStatOnConnection("row3" + iterateId, 0, 0);
- }
- }
- int tos_count_tAdvancedHash_row3 = 0;
- // connection name:row3
- // source node:tDBInput_4 - inputs:(after_tDBInput_1)
- // outputs:(row3,row3) | target node:tAdvancedHash_row3 -
- // inputs:(row3) outputs:()
- // linked node: tMap_1 - inputs:(row1,row2,row3)
- // outputs:(zamestnanec,zamestnanec)
- org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row3 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row3Struct> tHash_Lookup_row3 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
- .<row3Struct> getLookup(matchingModeEnum_row3);
- globalMap.put("tHash_Lookup_row3", tHash_Lookup_row3);
- /**
- * [tAdvancedHash_row3 begin ] stop
- */
- /**
- * [tDBInput_4 begin ] start
- */
- ok_Hash.put("tDBInput_4", false);
- start_Hash.put("tDBInput_4", System.currentTimeMillis());
- currentComponent = "tDBInput_4";
- int tos_count_tDBInput_4 = 0;
- org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_4 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
- .getMSSqlGenerateTimestampUtil();
- java.util.List<String> talendToDBList_tDBInput_4 = new java.util.ArrayList();
- String[] talendToDBArray_tDBInput_4 = new String[] { "FLOAT",
- "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
- "DECIMAL IDENTITY", "REAL" };
- java.util.Collections.addAll(talendToDBList_tDBInput_4,
- talendToDBArray_tDBInput_4);
- int nb_line_tDBInput_4 = 0;
- java.sql.Connection conn_tDBInput_4 = null;
- String driverClass_tDBInput_4 = "net.sourceforge.jtds.jdbc.Driver";
- java.lang.Class.forName(driverClass_tDBInput_4);
- String dbUser_tDBInput_4 = "tym1";
- final String decryptedPassword_tDBInput_4 = routines.system.PasswordEncryptUtil
- .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
- String dbPwd_tDBInput_4 = decryptedPassword_tDBInput_4;
- String port_tDBInput_4 = "1433";
- String dbname_tDBInput_4 = "bi_zdroj01";
- String url_tDBInput_4 = "jdbc:jtds:sqlserver://"
- + "158.196.160.60";
- if (!"".equals(port_tDBInput_4)) {
- url_tDBInput_4 += ":" + "1433";
- }
- if (!"".equals(dbname_tDBInput_4)) {
- url_tDBInput_4 += "//" + "bi_zdroj01";
- }
- url_tDBInput_4 += ";appName=" + projectName + ";" + "";
- String dbschema_tDBInput_4 = "";
- conn_tDBInput_4 = java.sql.DriverManager.getConnection(
- url_tDBInput_4, dbUser_tDBInput_4, dbPwd_tDBInput_4);
- java.sql.Statement stmt_tDBInput_4 = conn_tDBInput_4
- .createStatement();
- String dbquery_tDBInput_4 = "SELECT mzdove_sazby.idsazby,\n mzdove_sazby.nazev_profese,\n mzdove_sazby.hodinova_sazba\nFROM mzdove_sazby";
- globalMap.put("tDBInput_4_QUERY", dbquery_tDBInput_4);
- java.sql.ResultSet rs_tDBInput_4 = null;
- try {
- rs_tDBInput_4 = stmt_tDBInput_4
- .executeQuery(dbquery_tDBInput_4);
- java.sql.ResultSetMetaData rsmd_tDBInput_4 = rs_tDBInput_4
- .getMetaData();
- int colQtyInRs_tDBInput_4 = rsmd_tDBInput_4
- .getColumnCount();
- String tmpContent_tDBInput_4 = null;
- while (rs_tDBInput_4.next()) {
- nb_line_tDBInput_4++;
- if (colQtyInRs_tDBInput_4 < 1) {
- row3.idsazby = 0;
- } else {
- if (rs_tDBInput_4.getObject(1) != null) {
- row3.idsazby = rs_tDBInput_4.getInt(1);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_4 < 2) {
- row3.nazev_profese = null;
- } else {
- tmpContent_tDBInput_4 = rs_tDBInput_4.getString(2);
- if (tmpContent_tDBInput_4 != null) {
- if (talendToDBList_tDBInput_4
- .contains(rsmd_tDBInput_4
- .getColumnTypeName(2)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row3.nazev_profese = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_4);
- } else {
- row3.nazev_profese = tmpContent_tDBInput_4;
- }
- } else {
- row3.nazev_profese = null;
- }
- }
- if (colQtyInRs_tDBInput_4 < 3) {
- row3.hodinova_sazba = 0;
- } else {
- if (rs_tDBInput_4.getObject(3) != null) {
- row3.hodinova_sazba = rs_tDBInput_4.getInt(3);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- /**
- * [tDBInput_4 begin ] stop
- */
- /**
- * [tDBInput_4 main ] start
- */
- currentComponent = "tDBInput_4";
- tos_count_tDBInput_4++;
- /**
- * [tDBInput_4 main ] stop
- */
- /**
- * [tDBInput_4 process_data_begin ] start
- */
- currentComponent = "tDBInput_4";
- /**
- * [tDBInput_4 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row3 main ] start
- */
- currentComponent = "tAdvancedHash_row3";
- // row3
- // row3
- if (execStat) {
- runStat.updateStatOnConnection("row3" + iterateId,
- 1, 1);
- }
- row3Struct row3_HashRow = new row3Struct();
- row3_HashRow.idsazby = row3.idsazby;
- row3_HashRow.nazev_profese = row3.nazev_profese;
- row3_HashRow.hodinova_sazba = row3.hodinova_sazba;
- tHash_Lookup_row3.put(row3_HashRow);
- tos_count_tAdvancedHash_row3++;
- /**
- * [tAdvancedHash_row3 main ] stop
- */
- /**
- * [tAdvancedHash_row3 process_data_begin ] start
- */
- currentComponent = "tAdvancedHash_row3";
- /**
- * [tAdvancedHash_row3 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row3 process_data_end ] start
- */
- currentComponent = "tAdvancedHash_row3";
- /**
- * [tAdvancedHash_row3 process_data_end ] stop
- */
- /**
- * [tDBInput_4 process_data_end ] start
- */
- currentComponent = "tDBInput_4";
- /**
- * [tDBInput_4 process_data_end ] stop
- */
- /**
- * [tDBInput_4 end ] start
- */
- currentComponent = "tDBInput_4";
- }
- } finally {
- if (rs_tDBInput_4 != null) {
- rs_tDBInput_4.close();
- }
- if (stmt_tDBInput_4 != null) {
- stmt_tDBInput_4.close();
- }
- if (conn_tDBInput_4 != null && !conn_tDBInput_4.isClosed()) {
- conn_tDBInput_4.close();
- }
- }
- globalMap.put("tDBInput_4_NB_LINE", nb_line_tDBInput_4);
- ok_Hash.put("tDBInput_4", true);
- end_Hash.put("tDBInput_4", System.currentTimeMillis());
- /**
- * [tDBInput_4 end ] stop
- */
- /**
- * [tAdvancedHash_row3 end ] start
- */
- currentComponent = "tAdvancedHash_row3";
- tHash_Lookup_row3.endPut();
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null
- || !((Boolean) resourceMap.get("inIterateVComp"))) {
- runStat.updateStatOnConnection("row3" + iterateId, 2, 0);
- }
- }
- ok_Hash.put("tAdvancedHash_row3", true);
- end_Hash.put("tAdvancedHash_row3", System.currentTimeMillis());
- /**
- * [tAdvancedHash_row3 end ] stop
- */
- }// end the resume
- } catch (java.lang.Exception e) {
- TalendException te = new TalendException(e, currentComponent,
- globalMap);
- throw te;
- } catch (java.lang.Error error) {
- runStat.stopThreadStat();
- throw error;
- } finally {
- try {
- /**
- * [tDBInput_4 finally ] start
- */
- currentComponent = "tDBInput_4";
- /**
- * [tDBInput_4 finally ] stop
- */
- /**
- * [tAdvancedHash_row3 finally ] start
- */
- currentComponent = "tAdvancedHash_row3";
- /**
- * [tAdvancedHash_row3 finally ] stop
- */
- } catch (java.lang.Exception e) {
- // ignore
- } catch (java.lang.Error error) {
- // ignore
- }
- resourceMap = null;
- }
- globalMap.put("tDBInput_4_SUBPROCESS_STATE", 1);
- }
- public static class row5Struct implements
- routines.system.IPersistableComparableLookupRow<row5Struct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- protected static final int DEFAULT_HASHCODE = 1;
- protected static final int PRIME = 31;
- protected int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- public String loopKey;
- public int idpredpis;
- public int getIdpredpis() {
- return this.idpredpis;
- }
- public int idzamestnanci;
- public int getIdzamestnanci() {
- return this.idzamestnanci;
- }
- public Short rok;
- public Short getRok() {
- return this.rok;
- }
- public Short dovolena_celkem;
- public Short getDovolena_celkem() {
- return this.dovolena_celkem;
- }
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime * result + (int) this.idzamestnanci;
- result = prime * result
- + ((this.rok == null) ? 0 : this.rok.hashCode());
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final row5Struct other = (row5Struct) obj;
- if (this.idzamestnanci != other.idzamestnanci)
- return false;
- if (this.rok == null) {
- if (other.rok != null)
- return false;
- } else if (!this.rok.equals(other.rok))
- return false;
- return true;
- }
- public void copyDataTo(row5Struct other) {
- other.idpredpis = this.idpredpis;
- other.idzamestnanci = this.idzamestnanci;
- other.rok = this.rok;
- other.dovolena_celkem = this.dovolena_celkem;
- }
- public void copyKeysDataTo(row5Struct other) {
- other.idzamestnanci = this.idzamestnanci;
- other.rok = this.rok;
- }
- public void readKeysData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.idzamestnanci = dis.readInt();
- length = dis.readByte();
- if (length == -1) {
- this.rok = null;
- } else {
- this.rok = dis.readShort();
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeKeysData(ObjectOutputStream dos) {
- try {
- // int
- dos.writeInt(this.idzamestnanci);
- // Short
- if (this.rok == null) {
- dos.writeByte(-1);
- } else {
- dos.writeByte(0);
- dos.writeShort(this.rok);
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Fill Values data by reading ObjectInputStream.
- */
- public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
- try {
- int length = 0;
- this.idpredpis = dis.readInt();
- length = dis.readByte();
- if (length == -1) {
- this.dovolena_celkem = null;
- } else {
- this.dovolena_celkem = dis.readShort();
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Return a byte array which represents Values data.
- */
- public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
- try {
- dos.writeInt(this.idpredpis);
- if (this.dovolena_celkem == null) {
- dos.writeByte(-1);
- } else {
- dos.writeByte(0);
- dos.writeShort(this.dovolena_celkem);
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("idpredpis=" + String.valueOf(idpredpis));
- sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
- sb.append(",rok=" + String.valueOf(rok));
- sb.append(",dovolena_celkem=" + String.valueOf(dovolena_celkem));
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(row5Struct other) {
- int returnValue = -1;
- returnValue = checkNullsAndCompare(this.idzamestnanci,
- other.idzamestnanci);
- if (returnValue != 0) {
- return returnValue;
- }
- returnValue = checkNullsAndCompare(this.rok, other.rok);
- if (returnValue != 0) {
- return returnValue;
- }
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public void tDBInput_5Process(final java.util.Map<String, Object> globalMap)
- throws TalendException {
- globalMap.put("tDBInput_5_SUBPROCESS_STATE", 0);
- final boolean execStat = this.execStat;
- String iterateId = "";
- String currentComponent = "";
- java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
- try {
- // TDI-39566 avoid throwing an useless Exception
- boolean resumeIt = true;
- if (globalResumeTicket == false && resumeEntryMethodName != null) {
- String currentMethodName = new java.lang.Exception()
- .getStackTrace()[0].getMethodName();
- resumeIt = resumeEntryMethodName.equals(currentMethodName);
- }
- if (resumeIt || globalResumeTicket) { // start the resume
- globalResumeTicket = true;
- row5Struct row5 = new row5Struct();
- /**
- * [tAdvancedHash_row5 begin ] start
- */
- ok_Hash.put("tAdvancedHash_row5", false);
- start_Hash
- .put("tAdvancedHash_row5", System.currentTimeMillis());
- currentComponent = "tAdvancedHash_row5";
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null) {
- runStat.updateStatOnConnection("row5" + iterateId, 0, 0);
- }
- }
- int tos_count_tAdvancedHash_row5 = 0;
- // connection name:row5
- // source node:tDBInput_5 - inputs:(after_tDBInput_6)
- // outputs:(row5,row5) | target node:tAdvancedHash_row5 -
- // inputs:(row5) outputs:()
- // linked node: tMap_2 -
- // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
- // outputs:(out2)
- org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row5 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row5Struct> tHash_Lookup_row5 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
- .<row5Struct> getLookup(matchingModeEnum_row5);
- globalMap.put("tHash_Lookup_row5", tHash_Lookup_row5);
- /**
- * [tAdvancedHash_row5 begin ] stop
- */
- /**
- * [tDBInput_5 begin ] start
- */
- ok_Hash.put("tDBInput_5", false);
- start_Hash.put("tDBInput_5", System.currentTimeMillis());
- currentComponent = "tDBInput_5";
- int tos_count_tDBInput_5 = 0;
- org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_5 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
- .getMSSqlGenerateTimestampUtil();
- java.util.List<String> talendToDBList_tDBInput_5 = new java.util.ArrayList();
- String[] talendToDBArray_tDBInput_5 = new String[] { "FLOAT",
- "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
- "DECIMAL IDENTITY", "REAL" };
- java.util.Collections.addAll(talendToDBList_tDBInput_5,
- talendToDBArray_tDBInput_5);
- int nb_line_tDBInput_5 = 0;
- java.sql.Connection conn_tDBInput_5 = null;
- String driverClass_tDBInput_5 = "net.sourceforge.jtds.jdbc.Driver";
- java.lang.Class.forName(driverClass_tDBInput_5);
- String dbUser_tDBInput_5 = "tym1";
- final String decryptedPassword_tDBInput_5 = routines.system.PasswordEncryptUtil
- .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
- String dbPwd_tDBInput_5 = decryptedPassword_tDBInput_5;
- String port_tDBInput_5 = "1433";
- String dbname_tDBInput_5 = "bi_zdroj01";
- String url_tDBInput_5 = "jdbc:jtds:sqlserver://"
- + "158.196.160.60";
- if (!"".equals(port_tDBInput_5)) {
- url_tDBInput_5 += ":" + "1433";
- }
- if (!"".equals(dbname_tDBInput_5)) {
- url_tDBInput_5 += "//" + "bi_zdroj01";
- }
- url_tDBInput_5 += ";appName=" + projectName + ";" + "";
- String dbschema_tDBInput_5 = "";
- conn_tDBInput_5 = java.sql.DriverManager.getConnection(
- url_tDBInput_5, dbUser_tDBInput_5, dbPwd_tDBInput_5);
- java.sql.Statement stmt_tDBInput_5 = conn_tDBInput_5
- .createStatement();
- String dbquery_tDBInput_5 = "SELECT predpis_dovolene.idpredpis,\n predpis_dovolene.idzamestnanci,\n predpis_dovolene.rok,\n predpis_dovolene.dovolen"
- + "a_celkem\nFROM predpis_dovolene";
- globalMap.put("tDBInput_5_QUERY", dbquery_tDBInput_5);
- java.sql.ResultSet rs_tDBInput_5 = null;
- try {
- rs_tDBInput_5 = stmt_tDBInput_5
- .executeQuery(dbquery_tDBInput_5);
- java.sql.ResultSetMetaData rsmd_tDBInput_5 = rs_tDBInput_5
- .getMetaData();
- int colQtyInRs_tDBInput_5 = rsmd_tDBInput_5
- .getColumnCount();
- String tmpContent_tDBInput_5 = null;
- while (rs_tDBInput_5.next()) {
- nb_line_tDBInput_5++;
- if (colQtyInRs_tDBInput_5 < 1) {
- row5.idpredpis = 0;
- } else {
- if (rs_tDBInput_5.getObject(1) != null) {
- row5.idpredpis = rs_tDBInput_5.getInt(1);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_5 < 2) {
- row5.idzamestnanci = 0;
- } else {
- if (rs_tDBInput_5.getObject(2) != null) {
- row5.idzamestnanci = rs_tDBInput_5.getInt(2);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_5 < 3) {
- row5.rok = null;
- } else {
- if (rs_tDBInput_5.getObject(3) != null) {
- row5.rok = rs_tDBInput_5.getShort(3);
- } else {
- row5.rok = null;
- }
- }
- if (colQtyInRs_tDBInput_5 < 4) {
- row5.dovolena_celkem = null;
- } else {
- if (rs_tDBInput_5.getObject(4) != null) {
- row5.dovolena_celkem = rs_tDBInput_5
- .getShort(4);
- } else {
- row5.dovolena_celkem = null;
- }
- }
- /**
- * [tDBInput_5 begin ] stop
- */
- /**
- * [tDBInput_5 main ] start
- */
- currentComponent = "tDBInput_5";
- tos_count_tDBInput_5++;
- /**
- * [tDBInput_5 main ] stop
- */
- /**
- * [tDBInput_5 process_data_begin ] start
- */
- currentComponent = "tDBInput_5";
- /**
- * [tDBInput_5 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row5 main ] start
- */
- currentComponent = "tAdvancedHash_row5";
- // row5
- // row5
- if (execStat) {
- runStat.updateStatOnConnection("row5" + iterateId,
- 1, 1);
- }
- row5Struct row5_HashRow = new row5Struct();
- row5_HashRow.idpredpis = row5.idpredpis;
- row5_HashRow.idzamestnanci = row5.idzamestnanci;
- row5_HashRow.rok = row5.rok;
- row5_HashRow.dovolena_celkem = row5.dovolena_celkem;
- tHash_Lookup_row5.put(row5_HashRow);
- tos_count_tAdvancedHash_row5++;
- /**
- * [tAdvancedHash_row5 main ] stop
- */
- /**
- * [tAdvancedHash_row5 process_data_begin ] start
- */
- currentComponent = "tAdvancedHash_row5";
- /**
- * [tAdvancedHash_row5 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row5 process_data_end ] start
- */
- currentComponent = "tAdvancedHash_row5";
- /**
- * [tAdvancedHash_row5 process_data_end ] stop
- */
- /**
- * [tDBInput_5 process_data_end ] start
- */
- currentComponent = "tDBInput_5";
- /**
- * [tDBInput_5 process_data_end ] stop
- */
- /**
- * [tDBInput_5 end ] start
- */
- currentComponent = "tDBInput_5";
- }
- } finally {
- if (rs_tDBInput_5 != null) {
- rs_tDBInput_5.close();
- }
- if (stmt_tDBInput_5 != null) {
- stmt_tDBInput_5.close();
- }
- if (conn_tDBInput_5 != null && !conn_tDBInput_5.isClosed()) {
- conn_tDBInput_5.close();
- }
- }
- globalMap.put("tDBInput_5_NB_LINE", nb_line_tDBInput_5);
- ok_Hash.put("tDBInput_5", true);
- end_Hash.put("tDBInput_5", System.currentTimeMillis());
- /**
- * [tDBInput_5 end ] stop
- */
- /**
- * [tAdvancedHash_row5 end ] start
- */
- currentComponent = "tAdvancedHash_row5";
- tHash_Lookup_row5.endPut();
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null
- || !((Boolean) resourceMap.get("inIterateVComp"))) {
- runStat.updateStatOnConnection("row5" + iterateId, 2, 0);
- }
- }
- ok_Hash.put("tAdvancedHash_row5", true);
- end_Hash.put("tAdvancedHash_row5", System.currentTimeMillis());
- /**
- * [tAdvancedHash_row5 end ] stop
- */
- }// end the resume
- } catch (java.lang.Exception e) {
- TalendException te = new TalendException(e, currentComponent,
- globalMap);
- throw te;
- } catch (java.lang.Error error) {
- runStat.stopThreadStat();
- throw error;
- } finally {
- try {
- /**
- * [tDBInput_5 finally ] start
- */
- currentComponent = "tDBInput_5";
- /**
- * [tDBInput_5 finally ] stop
- */
- /**
- * [tAdvancedHash_row5 finally ] start
- */
- currentComponent = "tAdvancedHash_row5";
- /**
- * [tAdvancedHash_row5 finally ] stop
- */
- } catch (java.lang.Exception e) {
- // ignore
- } catch (java.lang.Error error) {
- // ignore
- }
- resourceMap = null;
- }
- globalMap.put("tDBInput_5_SUBPROCESS_STATE", 1);
- }
- public static class out2Struct implements
- routines.system.IPersistableRow<out2Struct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- protected static final int DEFAULT_HASHCODE = 1;
- protected static final int PRIME = 31;
- protected int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- public String loopKey;
- public BigDecimal odpracovano_hodin;
- public BigDecimal getOdpracovano_hodin() {
- return this.odpracovano_hodin;
- }
- public BigDecimal prescasy;
- public BigDecimal getPrescasy() {
- return this.prescasy;
- }
- public BigDecimal celkova_mzda;
- public BigDecimal getCelkova_mzda() {
- return this.celkova_mzda;
- }
- public BigDecimal dovolena_vybrana;
- public BigDecimal getDovolena_vybrana() {
- return this.dovolena_vybrana;
- }
- public BigDecimal dovolena_zustatek;
- public BigDecimal getDovolena_zustatek() {
- return this.dovolena_zustatek;
- }
- public Integer dovolena_celkem;
- public Integer getDovolena_celkem() {
- return this.dovolena_celkem;
- }
- public Integer DIM_zamestnanci_idzamestnanci;
- public Integer getDIM_zamestnanci_idzamestnanci() {
- return this.DIM_zamestnanci_idzamestnanci;
- }
- public Integer DIM_pracoviste_idpracoviste;
- public Integer getDIM_pracoviste_idpracoviste() {
- return this.DIM_pracoviste_idpracoviste;
- }
- public Integer DIM_kalendar_idkalendare;
- public Integer getDIM_kalendar_idkalendare() {
- return this.DIM_kalendar_idkalendare;
- }
- public Integer DIM_mzdove_sazby_idsazby;
- public Integer getDIM_mzdove_sazby_idsazby() {
- return this.DIM_mzdove_sazby_idsazby;
- }
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime
- * result
- + ((this.DIM_zamestnanci_idzamestnanci == null) ? 0
- : this.DIM_zamestnanci_idzamestnanci.hashCode());
- result = prime
- * result
- + ((this.DIM_pracoviste_idpracoviste == null) ? 0
- : this.DIM_pracoviste_idpracoviste.hashCode());
- result = prime
- * result
- + ((this.DIM_kalendar_idkalendare == null) ? 0
- : this.DIM_kalendar_idkalendare.hashCode());
- result = prime
- * result
- + ((this.DIM_mzdove_sazby_idsazby == null) ? 0
- : this.DIM_mzdove_sazby_idsazby.hashCode());
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final out2Struct other = (out2Struct) obj;
- if (this.DIM_zamestnanci_idzamestnanci == null) {
- if (other.DIM_zamestnanci_idzamestnanci != null)
- return false;
- } else if (!this.DIM_zamestnanci_idzamestnanci
- .equals(other.DIM_zamestnanci_idzamestnanci))
- return false;
- if (this.DIM_pracoviste_idpracoviste == null) {
- if (other.DIM_pracoviste_idpracoviste != null)
- return false;
- } else if (!this.DIM_pracoviste_idpracoviste
- .equals(other.DIM_pracoviste_idpracoviste))
- return false;
- if (this.DIM_kalendar_idkalendare == null) {
- if (other.DIM_kalendar_idkalendare != null)
- return false;
- } else if (!this.DIM_kalendar_idkalendare
- .equals(other.DIM_kalendar_idkalendare))
- return false;
- if (this.DIM_mzdove_sazby_idsazby == null) {
- if (other.DIM_mzdove_sazby_idsazby != null)
- return false;
- } else if (!this.DIM_mzdove_sazby_idsazby
- .equals(other.DIM_mzdove_sazby_idsazby))
- return false;
- return true;
- }
- public void copyDataTo(out2Struct other) {
- other.odpracovano_hodin = this.odpracovano_hodin;
- other.prescasy = this.prescasy;
- other.celkova_mzda = this.celkova_mzda;
- other.dovolena_vybrana = this.dovolena_vybrana;
- other.dovolena_zustatek = this.dovolena_zustatek;
- other.dovolena_celkem = this.dovolena_celkem;
- other.DIM_zamestnanci_idzamestnanci = this.DIM_zamestnanci_idzamestnanci;
- other.DIM_pracoviste_idpracoviste = this.DIM_pracoviste_idpracoviste;
- other.DIM_kalendar_idkalendare = this.DIM_kalendar_idkalendare;
- other.DIM_mzdove_sazby_idsazby = this.DIM_mzdove_sazby_idsazby;
- }
- public void copyKeysDataTo(out2Struct other) {
- other.DIM_zamestnanci_idzamestnanci = this.DIM_zamestnanci_idzamestnanci;
- other.DIM_pracoviste_idpracoviste = this.DIM_pracoviste_idpracoviste;
- other.DIM_kalendar_idkalendare = this.DIM_kalendar_idkalendare;
- other.DIM_mzdove_sazby_idsazby = this.DIM_mzdove_sazby_idsazby;
- }
- private Integer readInteger(ObjectInputStream dis) throws IOException {
- Integer intReturn;
- int length = 0;
- length = dis.readByte();
- if (length == -1) {
- intReturn = null;
- } else {
- intReturn = dis.readInt();
- }
- return intReturn;
- }
- private void writeInteger(Integer intNum, ObjectOutputStream dos)
- throws IOException {
- if (intNum == null) {
- dos.writeByte(-1);
- } else {
- dos.writeByte(0);
- dos.writeInt(intNum);
- }
- }
- public void readData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.odpracovano_hodin = (BigDecimal) dis.readObject();
- this.prescasy = (BigDecimal) dis.readObject();
- this.celkova_mzda = (BigDecimal) dis.readObject();
- this.dovolena_vybrana = (BigDecimal) dis.readObject();
- this.dovolena_zustatek = (BigDecimal) dis.readObject();
- this.dovolena_celkem = readInteger(dis);
- this.DIM_zamestnanci_idzamestnanci = readInteger(dis);
- this.DIM_pracoviste_idpracoviste = readInteger(dis);
- this.DIM_kalendar_idkalendare = readInteger(dis);
- this.DIM_mzdove_sazby_idsazby = readInteger(dis);
- } catch (IOException e) {
- throw new RuntimeException(e);
- } catch (ClassNotFoundException eCNFE) {
- throw new RuntimeException(eCNFE);
- }
- }
- }
- public void writeData(ObjectOutputStream dos) {
- try {
- // BigDecimal
- dos.writeObject(this.odpracovano_hodin);
- // BigDecimal
- dos.writeObject(this.prescasy);
- // BigDecimal
- dos.writeObject(this.celkova_mzda);
- // BigDecimal
- dos.writeObject(this.dovolena_vybrana);
- // BigDecimal
- dos.writeObject(this.dovolena_zustatek);
- // Integer
- writeInteger(this.dovolena_celkem, dos);
- // Integer
- writeInteger(this.DIM_zamestnanci_idzamestnanci, dos);
- // Integer
- writeInteger(this.DIM_pracoviste_idpracoviste, dos);
- // Integer
- writeInteger(this.DIM_kalendar_idkalendare, dos);
- // Integer
- writeInteger(this.DIM_mzdove_sazby_idsazby, dos);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("odpracovano_hodin=" + String.valueOf(odpracovano_hodin));
- sb.append(",prescasy=" + String.valueOf(prescasy));
- sb.append(",celkova_mzda=" + String.valueOf(celkova_mzda));
- sb.append(",dovolena_vybrana=" + String.valueOf(dovolena_vybrana));
- sb.append(",dovolena_zustatek=" + String.valueOf(dovolena_zustatek));
- sb.append(",dovolena_celkem=" + String.valueOf(dovolena_celkem));
- sb.append(",DIM_zamestnanci_idzamestnanci="
- + String.valueOf(DIM_zamestnanci_idzamestnanci));
- sb.append(",DIM_pracoviste_idpracoviste="
- + String.valueOf(DIM_pracoviste_idpracoviste));
- sb.append(",DIM_kalendar_idkalendare="
- + String.valueOf(DIM_kalendar_idkalendare));
- sb.append(",DIM_mzdove_sazby_idsazby="
- + String.valueOf(DIM_mzdove_sazby_idsazby));
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(out2Struct other) {
- int returnValue = -1;
- returnValue = checkNullsAndCompare(
- this.DIM_zamestnanci_idzamestnanci,
- other.DIM_zamestnanci_idzamestnanci);
- if (returnValue != 0) {
- return returnValue;
- }
- returnValue = checkNullsAndCompare(
- this.DIM_pracoviste_idpracoviste,
- other.DIM_pracoviste_idpracoviste);
- if (returnValue != 0) {
- return returnValue;
- }
- returnValue = checkNullsAndCompare(this.DIM_kalendar_idkalendare,
- other.DIM_kalendar_idkalendare);
- if (returnValue != 0) {
- return returnValue;
- }
- returnValue = checkNullsAndCompare(this.DIM_mzdove_sazby_idsazby,
- other.DIM_mzdove_sazby_idsazby);
- if (returnValue != 0) {
- return returnValue;
- }
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public static class row4Struct implements
- routines.system.IPersistableRow<row4Struct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- public Integer zaznam_dochazky;
- public Integer getZaznam_dochazky() {
- return this.zaznam_dochazky;
- }
- public Integer idzamestnanci;
- public Integer getIdzamestnanci() {
- return this.idzamestnanci;
- }
- public Short datum_rok;
- public Short getDatum_rok() {
- return this.datum_rok;
- }
- public Short datum_mesic;
- public Short getDatum_mesic() {
- return this.datum_mesic;
- }
- public Integer doba_v_praci;
- public Integer getDoba_v_praci() {
- return this.doba_v_praci;
- }
- public Integer prescas;
- public Integer getPrescas() {
- return this.prescas;
- }
- private Integer readInteger(ObjectInputStream dis) throws IOException {
- Integer intReturn;
- int length = 0;
- length = dis.readByte();
- if (length == -1) {
- intReturn = null;
- } else {
- intReturn = dis.readInt();
- }
- return intReturn;
- }
- private void writeInteger(Integer intNum, ObjectOutputStream dos)
- throws IOException {
- if (intNum == null) {
- dos.writeByte(-1);
- } else {
- dos.writeByte(0);
- dos.writeInt(intNum);
- }
- }
- public void readData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.zaznam_dochazky = readInteger(dis);
- this.idzamestnanci = readInteger(dis);
- length = dis.readByte();
- if (length == -1) {
- this.datum_rok = null;
- } else {
- this.datum_rok = dis.readShort();
- }
- length = dis.readByte();
- if (length == -1) {
- this.datum_mesic = null;
- } else {
- this.datum_mesic = dis.readShort();
- }
- this.doba_v_praci = readInteger(dis);
- this.prescas = readInteger(dis);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeData(ObjectOutputStream dos) {
- try {
- // Integer
- writeInteger(this.zaznam_dochazky, dos);
- // Integer
- writeInteger(this.idzamestnanci, dos);
- // Short
- if (this.datum_rok == null) {
- dos.writeByte(-1);
- } else {
- dos.writeByte(0);
- dos.writeShort(this.datum_rok);
- }
- // Short
- if (this.datum_mesic == null) {
- dos.writeByte(-1);
- } else {
- dos.writeByte(0);
- dos.writeShort(this.datum_mesic);
- }
- // Integer
- writeInteger(this.doba_v_praci, dos);
- // Integer
- writeInteger(this.prescas, dos);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("zaznam_dochazky=" + String.valueOf(zaznam_dochazky));
- sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
- sb.append(",datum_rok=" + String.valueOf(datum_rok));
- sb.append(",datum_mesic=" + String.valueOf(datum_mesic));
- sb.append(",doba_v_praci=" + String.valueOf(doba_v_praci));
- sb.append(",prescas=" + String.valueOf(prescas));
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(row4Struct other) {
- int returnValue = -1;
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public static class OnRowsEndStructtAggregateRow_1 implements
- routines.system.IPersistableRow<OnRowsEndStructtAggregateRow_1> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- protected static final int DEFAULT_HASHCODE = 1;
- protected static final int PRIME = 31;
- protected int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- public String loopKey;
- public Integer zaznam_dochazky;
- public Integer getZaznam_dochazky() {
- return this.zaznam_dochazky;
- }
- public Integer idzamestnanci;
- public Integer getIdzamestnanci() {
- return this.idzamestnanci;
- }
- public Short datum_rok;
- public Short getDatum_rok() {
- return this.datum_rok;
- }
- public Short datum_mesic;
- public Short getDatum_mesic() {
- return this.datum_mesic;
- }
- public Integer doba_v_praci;
- public Integer getDoba_v_praci() {
- return this.doba_v_praci;
- }
- public Integer prescas;
- public Integer getPrescas() {
- return this.prescas;
- }
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime
- * result
- + ((this.zaznam_dochazky == null) ? 0
- : this.zaznam_dochazky.hashCode());
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final OnRowsEndStructtAggregateRow_1 other = (OnRowsEndStructtAggregateRow_1) obj;
- if (this.zaznam_dochazky == null) {
- if (other.zaznam_dochazky != null)
- return false;
- } else if (!this.zaznam_dochazky.equals(other.zaznam_dochazky))
- return false;
- return true;
- }
- public void copyDataTo(OnRowsEndStructtAggregateRow_1 other) {
- other.zaznam_dochazky = this.zaznam_dochazky;
- other.idzamestnanci = this.idzamestnanci;
- other.datum_rok = this.datum_rok;
- other.datum_mesic = this.datum_mesic;
- other.doba_v_praci = this.doba_v_praci;
- other.prescas = this.prescas;
- }
- public void copyKeysDataTo(OnRowsEndStructtAggregateRow_1 other) {
- other.zaznam_dochazky = this.zaznam_dochazky;
- }
- private Integer readInteger(ObjectInputStream dis) throws IOException {
- Integer intReturn;
- int length = 0;
- length = dis.readByte();
- if (length == -1) {
- intReturn = null;
- } else {
- intReturn = dis.readInt();
- }
- return intReturn;
- }
- private void writeInteger(Integer intNum, ObjectOutputStream dos)
- throws IOException {
- if (intNum == null) {
- dos.writeByte(-1);
- } else {
- dos.writeByte(0);
- dos.writeInt(intNum);
- }
- }
- public void readData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.zaznam_dochazky = readInteger(dis);
- this.idzamestnanci = readInteger(dis);
- length = dis.readByte();
- if (length == -1) {
- this.datum_rok = null;
- } else {
- this.datum_rok = dis.readShort();
- }
- length = dis.readByte();
- if (length == -1) {
- this.datum_mesic = null;
- } else {
- this.datum_mesic = dis.readShort();
- }
- this.doba_v_praci = readInteger(dis);
- this.prescas = readInteger(dis);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeData(ObjectOutputStream dos) {
- try {
- // Integer
- writeInteger(this.zaznam_dochazky, dos);
- // Integer
- writeInteger(this.idzamestnanci, dos);
- // Short
- if (this.datum_rok == null) {
- dos.writeByte(-1);
- } else {
- dos.writeByte(0);
- dos.writeShort(this.datum_rok);
- }
- // Short
- if (this.datum_mesic == null) {
- dos.writeByte(-1);
- } else {
- dos.writeByte(0);
- dos.writeShort(this.datum_mesic);
- }
- // Integer
- writeInteger(this.doba_v_praci, dos);
- // Integer
- writeInteger(this.prescas, dos);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("zaznam_dochazky=" + String.valueOf(zaznam_dochazky));
- sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
- sb.append(",datum_rok=" + String.valueOf(datum_rok));
- sb.append(",datum_mesic=" + String.valueOf(datum_mesic));
- sb.append(",doba_v_praci=" + String.valueOf(doba_v_praci));
- sb.append(",prescas=" + String.valueOf(prescas));
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(OnRowsEndStructtAggregateRow_1 other) {
- int returnValue = -1;
- returnValue = checkNullsAndCompare(this.zaznam_dochazky,
- other.zaznam_dochazky);
- if (returnValue != 0) {
- return returnValue;
- }
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public static class row10Struct implements
- routines.system.IPersistableRow<row10Struct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- protected static final int DEFAULT_HASHCODE = 1;
- protected static final int PRIME = 31;
- protected int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- public String loopKey;
- public int zaznam_dochazky;
- public int getZaznam_dochazky() {
- return this.zaznam_dochazky;
- }
- public int idzamestnanci;
- public int getIdzamestnanci() {
- return this.idzamestnanci;
- }
- public short datum_rok;
- public short getDatum_rok() {
- return this.datum_rok;
- }
- public short datum_mesic;
- public short getDatum_mesic() {
- return this.datum_mesic;
- }
- public int doba_v_praci;
- public int getDoba_v_praci() {
- return this.doba_v_praci;
- }
- public int prescas;
- public int getPrescas() {
- return this.prescas;
- }
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime * result + (int) this.zaznam_dochazky;
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final row10Struct other = (row10Struct) obj;
- if (this.zaznam_dochazky != other.zaznam_dochazky)
- return false;
- return true;
- }
- public void copyDataTo(row10Struct other) {
- other.zaznam_dochazky = this.zaznam_dochazky;
- other.idzamestnanci = this.idzamestnanci;
- other.datum_rok = this.datum_rok;
- other.datum_mesic = this.datum_mesic;
- other.doba_v_praci = this.doba_v_praci;
- other.prescas = this.prescas;
- }
- public void copyKeysDataTo(row10Struct other) {
- other.zaznam_dochazky = this.zaznam_dochazky;
- }
- public void readData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.zaznam_dochazky = dis.readInt();
- this.idzamestnanci = dis.readInt();
- this.datum_rok = dis.readShort();
- this.datum_mesic = dis.readShort();
- this.doba_v_praci = dis.readInt();
- this.prescas = dis.readInt();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeData(ObjectOutputStream dos) {
- try {
- // int
- dos.writeInt(this.zaznam_dochazky);
- // int
- dos.writeInt(this.idzamestnanci);
- // short
- dos.writeShort(this.datum_rok);
- // short
- dos.writeShort(this.datum_mesic);
- // int
- dos.writeInt(this.doba_v_praci);
- // int
- dos.writeInt(this.prescas);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("zaznam_dochazky=" + String.valueOf(zaznam_dochazky));
- sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
- sb.append(",datum_rok=" + String.valueOf(datum_rok));
- sb.append(",datum_mesic=" + String.valueOf(datum_mesic));
- sb.append(",doba_v_praci=" + String.valueOf(doba_v_praci));
- sb.append(",prescas=" + String.valueOf(prescas));
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(row10Struct other) {
- int returnValue = -1;
- returnValue = checkNullsAndCompare(this.zaznam_dochazky,
- other.zaznam_dochazky);
- if (returnValue != 0) {
- return returnValue;
- }
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public static class after_tDBInput_6Struct implements
- routines.system.IPersistableRow<after_tDBInput_6Struct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- protected static final int DEFAULT_HASHCODE = 1;
- protected static final int PRIME = 31;
- protected int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- public String loopKey;
- public int zaznam_dochazky;
- public int getZaznam_dochazky() {
- return this.zaznam_dochazky;
- }
- public int idzamestnanci;
- public int getIdzamestnanci() {
- return this.idzamestnanci;
- }
- public short datum_rok;
- public short getDatum_rok() {
- return this.datum_rok;
- }
- public short datum_mesic;
- public short getDatum_mesic() {
- return this.datum_mesic;
- }
- public int doba_v_praci;
- public int getDoba_v_praci() {
- return this.doba_v_praci;
- }
- public int prescas;
- public int getPrescas() {
- return this.prescas;
- }
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime * result + (int) this.zaznam_dochazky;
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final after_tDBInput_6Struct other = (after_tDBInput_6Struct) obj;
- if (this.zaznam_dochazky != other.zaznam_dochazky)
- return false;
- return true;
- }
- public void copyDataTo(after_tDBInput_6Struct other) {
- other.zaznam_dochazky = this.zaznam_dochazky;
- other.idzamestnanci = this.idzamestnanci;
- other.datum_rok = this.datum_rok;
- other.datum_mesic = this.datum_mesic;
- other.doba_v_praci = this.doba_v_praci;
- other.prescas = this.prescas;
- }
- public void copyKeysDataTo(after_tDBInput_6Struct other) {
- other.zaznam_dochazky = this.zaznam_dochazky;
- }
- public void readData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.zaznam_dochazky = dis.readInt();
- this.idzamestnanci = dis.readInt();
- this.datum_rok = dis.readShort();
- this.datum_mesic = dis.readShort();
- this.doba_v_praci = dis.readInt();
- this.prescas = dis.readInt();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeData(ObjectOutputStream dos) {
- try {
- // int
- dos.writeInt(this.zaznam_dochazky);
- // int
- dos.writeInt(this.idzamestnanci);
- // short
- dos.writeShort(this.datum_rok);
- // short
- dos.writeShort(this.datum_mesic);
- // int
- dos.writeInt(this.doba_v_praci);
- // int
- dos.writeInt(this.prescas);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("zaznam_dochazky=" + String.valueOf(zaznam_dochazky));
- sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
- sb.append(",datum_rok=" + String.valueOf(datum_rok));
- sb.append(",datum_mesic=" + String.valueOf(datum_mesic));
- sb.append(",doba_v_praci=" + String.valueOf(doba_v_praci));
- sb.append(",prescas=" + String.valueOf(prescas));
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(after_tDBInput_6Struct other) {
- int returnValue = -1;
- returnValue = checkNullsAndCompare(this.zaznam_dochazky,
- other.zaznam_dochazky);
- if (returnValue != 0) {
- return returnValue;
- }
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public void tDBInput_6Process(final java.util.Map<String, Object> globalMap)
- throws TalendException {
- globalMap.put("tDBInput_6_SUBPROCESS_STATE", 0);
- final boolean execStat = this.execStat;
- String currentVirtualComponent = null;
- String iterateId = "";
- String currentComponent = "";
- java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
- try {
- // TDI-39566 avoid throwing an useless Exception
- boolean resumeIt = true;
- if (globalResumeTicket == false && resumeEntryMethodName != null) {
- String currentMethodName = new java.lang.Exception()
- .getStackTrace()[0].getMethodName();
- resumeIt = resumeEntryMethodName.equals(currentMethodName);
- }
- if (resumeIt || globalResumeTicket) { // start the resume
- globalResumeTicket = true;
- tDBInput_1Process(globalMap);
- tDBInput_3Process(globalMap);
- tDBInput_5Process(globalMap);
- tDBInput_7Process(globalMap);
- tDBInput_8Process(globalMap);
- tDBInput_9Process(globalMap);
- tDBInput_10Process(globalMap);
- row10Struct row10 = new row10Struct();
- row4Struct row4 = new row4Struct();
- out2Struct out2 = new out2Struct();
- /**
- * [tAggregateRow_1_AGGOUT begin ] start
- */
- ok_Hash.put("tAggregateRow_1_AGGOUT", false);
- start_Hash.put("tAggregateRow_1_AGGOUT",
- System.currentTimeMillis());
- currentVirtualComponent = "tAggregateRow_1";
- currentComponent = "tAggregateRow_1_AGGOUT";
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null) {
- runStat.updateStatOnConnection("row10" + iterateId, 0,
- 0);
- }
- }
- int tos_count_tAggregateRow_1_AGGOUT = 0;
- // ------------ Seems it is not used
- java.util.Map hashAggreg_tAggregateRow_1 = new java.util.HashMap();
- // ------------
- class UtilClass_tAggregateRow_1 { // G_OutBegin_AggR_144
- public double sd(Double[] data) {
- final int n = data.length;
- if (n < 2) {
- return Double.NaN;
- }
- double d1 = 0d;
- double d2 = 0d;
- for (int i = 0; i < data.length; i++) {
- d1 += (data[i] * data[i]);
- d2 += data[i];
- }
- return Math.sqrt((n * d1 - d2 * d2) / n / (n - 1));
- }
- public void checkedIADD(byte a, byte b,
- boolean checkTypeOverFlow, boolean checkUlp) {
- byte r = (byte) (a + b);
- if (checkTypeOverFlow && ((a ^ r) & (b ^ r)) < 0) {
- throw new RuntimeException(buildOverflowMessage(
- String.valueOf(a), String.valueOf(b),
- "'short/Short'", "'byte/Byte'"));
- }
- }
- public void checkedIADD(short a, short b,
- boolean checkTypeOverFlow, boolean checkUlp) {
- short r = (short) (a + b);
- if (checkTypeOverFlow && ((a ^ r) & (b ^ r)) < 0) {
- throw new RuntimeException(buildOverflowMessage(
- String.valueOf(a), String.valueOf(b),
- "'int/Integer'", "'short/Short'"));
- }
- }
- public void checkedIADD(int a, int b,
- boolean checkTypeOverFlow, boolean checkUlp) {
- int r = a + b;
- if (checkTypeOverFlow && ((a ^ r) & (b ^ r)) < 0) {
- throw new RuntimeException(buildOverflowMessage(
- String.valueOf(a), String.valueOf(b),
- "'long/Long'", "'int/Integer'"));
- }
- }
- public void checkedIADD(long a, long b,
- boolean checkTypeOverFlow, boolean checkUlp) {
- long r = a + b;
- if (checkTypeOverFlow && ((a ^ r) & (b ^ r)) < 0) {
- throw new RuntimeException(buildOverflowMessage(
- String.valueOf(a), String.valueOf(b),
- "'BigDecimal'", "'long/Long'"));
- }
- }
- public void checkedIADD(float a, float b,
- boolean checkTypeOverFlow, boolean checkUlp) {
- if (checkUlp) {
- float minAddedValue = Math.ulp(a);
- if (minAddedValue > Math.abs(b)) {
- throw new RuntimeException(
- buildPrecisionMessage(
- String.valueOf(a),
- String.valueOf(b),
- "'double' or 'BigDecimal'",
- "'float/Float'"));
- }
- }
- if (checkTypeOverFlow
- && ((double) a + (double) b > (double) Float.MAX_VALUE)
- || ((double) a + (double) b < (double) -Float.MAX_VALUE)) {
- throw new RuntimeException(
- buildOverflowMessage(String.valueOf(a),
- String.valueOf(b),
- "'double' or 'BigDecimal'",
- "'float/Float'"));
- }
- }
- public void checkedIADD(double a, double b,
- boolean checkTypeOverFlow, boolean checkUlp) {
- if (checkUlp) {
- double minAddedValue = Math.ulp(a);
- if (minAddedValue > Math.abs(b)) {
- throw new RuntimeException(
- buildPrecisionMessage(
- String.valueOf(a),
- String.valueOf(a),
- "'BigDecimal'",
- "'double/Double'"));
- }
- }
- if (checkTypeOverFlow
- && (a + b > (double) Double.MAX_VALUE)
- || (a + b < -Double.MAX_VALUE)) {
- throw new RuntimeException(buildOverflowMessage(
- String.valueOf(a), String.valueOf(b),
- "'BigDecimal'", "'double/Double'"));
- }
- }
- public void checkedIADD(double a, byte b,
- boolean checkTypeOverFlow, boolean checkUlp) {
- if (checkTypeOverFlow
- && (a + b > (double) Double.MAX_VALUE)
- || (a + b < -Double.MAX_VALUE)) {
- throw new RuntimeException(buildOverflowMessage(
- String.valueOf(a), String.valueOf(b),
- "'BigDecimal'", "'double/Double'"));
- }
- }
- public void checkedIADD(double a, short b,
- boolean checkTypeOverFlow, boolean checkUlp) {
- if (checkTypeOverFlow
- && (a + b > (double) Double.MAX_VALUE)
- || (a + b < -Double.MAX_VALUE)) {
- throw new RuntimeException(buildOverflowMessage(
- String.valueOf(a), String.valueOf(b),
- "'BigDecimal'", "'double/Double'"));
- }
- }
- public void checkedIADD(double a, int b,
- boolean checkTypeOverFlow, boolean checkUlp) {
- if (checkTypeOverFlow
- && (a + b > (double) Double.MAX_VALUE)
- || (a + b < -Double.MAX_VALUE)) {
- throw new RuntimeException(buildOverflowMessage(
- String.valueOf(a), String.valueOf(b),
- "'BigDecimal'", "'double/Double'"));
- }
- }
- public void checkedIADD(double a, float b,
- boolean checkTypeOverFlow, boolean checkUlp) {
- if (checkUlp) {
- double minAddedValue = Math.ulp(a);
- if (minAddedValue > Math.abs(b)) {
- throw new RuntimeException(
- buildPrecisionMessage(
- String.valueOf(a),
- String.valueOf(a),
- "'BigDecimal'",
- "'double/Double'"));
- }
- }
- if (checkTypeOverFlow
- && (a + b > (double) Double.MAX_VALUE)
- || (a + b < -Double.MAX_VALUE)) {
- throw new RuntimeException(buildOverflowMessage(
- String.valueOf(a), String.valueOf(b),
- "'BigDecimal'", "'double/Double'"));
- }
- }
- private String buildOverflowMessage(String a, String b,
- String advicedTypes, String originalType) {
- return "Type overflow when adding "
- + b
- + " to "
- + a
- + ", to resolve this problem, increase the precision by using "
- + advicedTypes + " type in place of "
- + originalType + ".";
- }
- private String buildPrecisionMessage(String a, String b,
- String advicedTypes, String originalType) {
- return "The double precision is unsufficient to add the value "
- + b
- + " to "
- + a
- + ", to resolve this problem, increase the precision by using "
- + advicedTypes
- + " type in place of "
- + originalType + ".";
- }
- } // G_OutBegin_AggR_144
- UtilClass_tAggregateRow_1 utilClass_tAggregateRow_1 = new UtilClass_tAggregateRow_1();
- class AggOperationStruct_tAggregateRow_1 { // G_OutBegin_AggR_100
- private static final int DEFAULT_HASHCODE = 1;
- private static final int PRIME = 31;
- private int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- int idzamestnanci;
- short datum_rok;
- short datum_mesic;
- Integer doba_v_praci_sum;
- Integer prescas_sum;
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime * result + (int) this.idzamestnanci;
- result = prime * result + (int) this.datum_rok;
- result = prime * result + (int) this.datum_mesic;
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final AggOperationStruct_tAggregateRow_1 other = (AggOperationStruct_tAggregateRow_1) obj;
- if (this.idzamestnanci != other.idzamestnanci)
- return false;
- if (this.datum_rok != other.datum_rok)
- return false;
- if (this.datum_mesic != other.datum_mesic)
- return false;
- return true;
- }
- } // G_OutBegin_AggR_100
- AggOperationStruct_tAggregateRow_1 operation_result_tAggregateRow_1 = null;
- AggOperationStruct_tAggregateRow_1 operation_finder_tAggregateRow_1 = new AggOperationStruct_tAggregateRow_1();
- java.util.Map<AggOperationStruct_tAggregateRow_1, AggOperationStruct_tAggregateRow_1> hash_tAggregateRow_1 = new java.util.HashMap<AggOperationStruct_tAggregateRow_1, AggOperationStruct_tAggregateRow_1>();
- /**
- * [tAggregateRow_1_AGGOUT begin ] stop
- */
- /**
- * [tDBInput_6 begin ] start
- */
- ok_Hash.put("tDBInput_6", false);
- start_Hash.put("tDBInput_6", System.currentTimeMillis());
- currentComponent = "tDBInput_6";
- int tos_count_tDBInput_6 = 0;
- org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_6 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
- .getMSSqlGenerateTimestampUtil();
- java.util.List<String> talendToDBList_tDBInput_6 = new java.util.ArrayList();
- String[] talendToDBArray_tDBInput_6 = new String[] { "FLOAT",
- "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
- "DECIMAL IDENTITY", "REAL" };
- java.util.Collections.addAll(talendToDBList_tDBInput_6,
- talendToDBArray_tDBInput_6);
- int nb_line_tDBInput_6 = 0;
- java.sql.Connection conn_tDBInput_6 = null;
- String driverClass_tDBInput_6 = "net.sourceforge.jtds.jdbc.Driver";
- java.lang.Class.forName(driverClass_tDBInput_6);
- String dbUser_tDBInput_6 = "tym1";
- final String decryptedPassword_tDBInput_6 = routines.system.PasswordEncryptUtil
- .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
- String dbPwd_tDBInput_6 = decryptedPassword_tDBInput_6;
- String port_tDBInput_6 = "1433";
- String dbname_tDBInput_6 = "bi_zdroj01";
- String url_tDBInput_6 = "jdbc:jtds:sqlserver://"
- + "158.196.160.60";
- if (!"".equals(port_tDBInput_6)) {
- url_tDBInput_6 += ":" + "1433";
- }
- if (!"".equals(dbname_tDBInput_6)) {
- url_tDBInput_6 += "//" + "bi_zdroj01";
- }
- url_tDBInput_6 += ";appName=" + projectName + ";" + "";
- String dbschema_tDBInput_6 = "";
- conn_tDBInput_6 = java.sql.DriverManager.getConnection(
- url_tDBInput_6, dbUser_tDBInput_6, dbPwd_tDBInput_6);
- java.sql.Statement stmt_tDBInput_6 = conn_tDBInput_6
- .createStatement();
- String dbquery_tDBInput_6 = "SELECT evidence_dochazky.zaznam_dochazky,\nevidence_dochazky.idzamestnanci,\nYEAR(evidence_dochazky.datum) AS datum_rok"
- + ",\nMONTH(evidence_dochazky.datum) AS datum_mesic,\nDATEDIFF(second, evidence_dochazky.cas_prichodu, cas_odchodu)\nAS dob"
- + "a_v_praci,\n IIF(DATEDIFF(second, evidence_dochazky.cas_prichodu, cas_odchodu) -\n8*3600 > 0,\nDATEDIFF(second, evidence"
- + "_dochazky.cas_prichodu, cas_odchodu) -\n8*3600, 0) AS prescas\nFROM evidence_dochazky";
- globalMap.put("tDBInput_6_QUERY", dbquery_tDBInput_6);
- java.sql.ResultSet rs_tDBInput_6 = null;
- try {
- rs_tDBInput_6 = stmt_tDBInput_6
- .executeQuery(dbquery_tDBInput_6);
- java.sql.ResultSetMetaData rsmd_tDBInput_6 = rs_tDBInput_6
- .getMetaData();
- int colQtyInRs_tDBInput_6 = rsmd_tDBInput_6
- .getColumnCount();
- String tmpContent_tDBInput_6 = null;
- while (rs_tDBInput_6.next()) {
- nb_line_tDBInput_6++;
- if (colQtyInRs_tDBInput_6 < 1) {
- row10.zaznam_dochazky = 0;
- } else {
- if (rs_tDBInput_6.getObject(1) != null) {
- row10.zaznam_dochazky = rs_tDBInput_6.getInt(1);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_6 < 2) {
- row10.idzamestnanci = 0;
- } else {
- if (rs_tDBInput_6.getObject(2) != null) {
- row10.idzamestnanci = rs_tDBInput_6.getInt(2);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_6 < 3) {
- row10.datum_rok = 0;
- } else {
- if (rs_tDBInput_6.getObject(3) != null) {
- row10.datum_rok = rs_tDBInput_6.getShort(3);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_6 < 4) {
- row10.datum_mesic = 0;
- } else {
- if (rs_tDBInput_6.getObject(4) != null) {
- row10.datum_mesic = rs_tDBInput_6.getShort(4);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_6 < 5) {
- row10.doba_v_praci = 0;
- } else {
- if (rs_tDBInput_6.getObject(5) != null) {
- row10.doba_v_praci = rs_tDBInput_6.getInt(5);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_6 < 6) {
- row10.prescas = 0;
- } else {
- if (rs_tDBInput_6.getObject(6) != null) {
- row10.prescas = rs_tDBInput_6.getInt(6);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- /**
- * [tDBInput_6 begin ] stop
- */
- /**
- * [tDBInput_6 main ] start
- */
- currentComponent = "tDBInput_6";
- tos_count_tDBInput_6++;
- /**
- * [tDBInput_6 main ] stop
- */
- /**
- * [tDBInput_6 process_data_begin ] start
- */
- currentComponent = "tDBInput_6";
- /**
- * [tDBInput_6 process_data_begin ] stop
- */
- /**
- * [tAggregateRow_1_AGGOUT main ] start
- */
- currentVirtualComponent = "tAggregateRow_1";
- currentComponent = "tAggregateRow_1_AGGOUT";
- // row10
- // row10
- if (execStat) {
- runStat.updateStatOnConnection("row10" + iterateId,
- 1, 1);
- }
- operation_finder_tAggregateRow_1.idzamestnanci = row10.idzamestnanci;
- operation_finder_tAggregateRow_1.datum_rok = row10.datum_rok;
- operation_finder_tAggregateRow_1.datum_mesic = row10.datum_mesic;
- operation_finder_tAggregateRow_1.hashCodeDirty = true;
- operation_result_tAggregateRow_1 = hash_tAggregateRow_1
- .get(operation_finder_tAggregateRow_1);
- if (operation_result_tAggregateRow_1 == null) { // G_OutMain_AggR_001
- operation_result_tAggregateRow_1 = new AggOperationStruct_tAggregateRow_1();
- operation_result_tAggregateRow_1.idzamestnanci = operation_finder_tAggregateRow_1.idzamestnanci;
- operation_result_tAggregateRow_1.datum_rok = operation_finder_tAggregateRow_1.datum_rok;
- operation_result_tAggregateRow_1.datum_mesic = operation_finder_tAggregateRow_1.datum_mesic;
- hash_tAggregateRow_1.put(
- operation_result_tAggregateRow_1,
- operation_result_tAggregateRow_1);
- } // G_OutMain_AggR_001
- if (operation_result_tAggregateRow_1.doba_v_praci_sum == null) {
- operation_result_tAggregateRow_1.doba_v_praci_sum = (int) 0;
- }
- operation_result_tAggregateRow_1.doba_v_praci_sum += row10.doba_v_praci;
- if (operation_result_tAggregateRow_1.prescas_sum == null) {
- operation_result_tAggregateRow_1.prescas_sum = (int) 0;
- }
- operation_result_tAggregateRow_1.prescas_sum += row10.prescas;
- tos_count_tAggregateRow_1_AGGOUT++;
- /**
- * [tAggregateRow_1_AGGOUT main ] stop
- */
- /**
- * [tAggregateRow_1_AGGOUT process_data_begin ] start
- */
- currentVirtualComponent = "tAggregateRow_1";
- currentComponent = "tAggregateRow_1_AGGOUT";
- /**
- * [tAggregateRow_1_AGGOUT process_data_begin ] stop
- */
- /**
- * [tAggregateRow_1_AGGOUT process_data_end ] start
- */
- currentVirtualComponent = "tAggregateRow_1";
- currentComponent = "tAggregateRow_1_AGGOUT";
- /**
- * [tAggregateRow_1_AGGOUT process_data_end ] stop
- */
- /**
- * [tDBInput_6 process_data_end ] start
- */
- currentComponent = "tDBInput_6";
- /**
- * [tDBInput_6 process_data_end ] stop
- */
- /**
- * [tDBInput_6 end ] start
- */
- currentComponent = "tDBInput_6";
- }
- } finally {
- if (rs_tDBInput_6 != null) {
- rs_tDBInput_6.close();
- }
- if (stmt_tDBInput_6 != null) {
- stmt_tDBInput_6.close();
- }
- if (conn_tDBInput_6 != null && !conn_tDBInput_6.isClosed()) {
- conn_tDBInput_6.close();
- }
- }
- globalMap.put("tDBInput_6_NB_LINE", nb_line_tDBInput_6);
- ok_Hash.put("tDBInput_6", true);
- end_Hash.put("tDBInput_6", System.currentTimeMillis());
- /**
- * [tDBInput_6 end ] stop
- */
- /**
- * [tAggregateRow_1_AGGOUT end ] start
- */
- currentVirtualComponent = "tAggregateRow_1";
- currentComponent = "tAggregateRow_1_AGGOUT";
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null
- || !((Boolean) resourceMap.get("inIterateVComp"))) {
- runStat.updateStatOnConnection("row10" + iterateId, 2,
- 0);
- }
- }
- ok_Hash.put("tAggregateRow_1_AGGOUT", true);
- end_Hash.put("tAggregateRow_1_AGGOUT",
- System.currentTimeMillis());
- /**
- * [tAggregateRow_1_AGGOUT end ] stop
- */
- /**
- * [tDBOutput_1 begin ] start
- */
- ok_Hash.put("tDBOutput_1", false);
- start_Hash.put("tDBOutput_1", System.currentTimeMillis());
- currentComponent = "tDBOutput_1";
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null) {
- runStat.updateStatOnConnection("out2" + iterateId, 0, 0);
- }
- }
- int tos_count_tDBOutput_1 = 0;
- int nb_line_tDBOutput_1 = 0;
- int nb_line_update_tDBOutput_1 = 0;
- int nb_line_inserted_tDBOutput_1 = 0;
- int nb_line_deleted_tDBOutput_1 = 0;
- int nb_line_rejected_tDBOutput_1 = 0;
- int deletedCount_tDBOutput_1 = 0;
- int updatedCount_tDBOutput_1 = 0;
- int insertedCount_tDBOutput_1 = 0;
- int rejectedCount_tDBOutput_1 = 0;
- String dbschema_tDBOutput_1 = null;
- String tableName_tDBOutput_1 = null;
- boolean whetherReject_tDBOutput_1 = false;
- java.util.Calendar calendar_tDBOutput_1 = java.util.Calendar
- .getInstance();
- long year1_tDBOutput_1 = TalendDate.parseDate("yyyy-MM-dd",
- "0001-01-01").getTime();
- long year2_tDBOutput_1 = TalendDate.parseDate("yyyy-MM-dd",
- "1753-01-01").getTime();
- long year10000_tDBOutput_1 = TalendDate.parseDate(
- "yyyy-MM-dd HH:mm:ss", "9999-12-31 24:00:00").getTime();
- long date_tDBOutput_1;
- java.util.Calendar calendar_datetimeoffset_tDBOutput_1 = java.util.Calendar
- .getInstance(java.util.TimeZone.getTimeZone("UTC"));
- java.sql.Connection conn_tDBOutput_1 = null;
- String dbUser_tDBOutput_1 = null;
- dbschema_tDBOutput_1 = "";
- String driverClass_tDBOutput_1 = "net.sourceforge.jtds.jdbc.Driver";
- java.lang.Class.forName(driverClass_tDBOutput_1);
- String port_tDBOutput_1 = "1433";
- String dbname_tDBOutput_1 = "tym1";
- String url_tDBOutput_1 = "jdbc:jtds:sqlserver://"
- + "158.196.160.60";
- if (!"".equals(port_tDBOutput_1)) {
- url_tDBOutput_1 += ":" + "1433";
- }
- if (!"".equals(dbname_tDBOutput_1)) {
- url_tDBOutput_1 += "//" + "tym1";
- }
- url_tDBOutput_1 += ";appName=" + projectName + ";" + "";
- dbUser_tDBOutput_1 = "tym1";
- final String decryptedPassword_tDBOutput_1 = routines.system.PasswordEncryptUtil
- .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
- String dbPwd_tDBOutput_1 = decryptedPassword_tDBOutput_1;
- conn_tDBOutput_1 = java.sql.DriverManager.getConnection(
- url_tDBOutput_1, dbUser_tDBOutput_1, dbPwd_tDBOutput_1);
- resourceMap.put("conn_tDBOutput_1", conn_tDBOutput_1);
- conn_tDBOutput_1.setAutoCommit(false);
- int commitEvery_tDBOutput_1 = 10000;
- int commitCounter_tDBOutput_1 = 0;
- int batchSize_tDBOutput_1 = 10000;
- int batchSizeCounter_tDBOutput_1 = 0;
- if (dbschema_tDBOutput_1 == null
- || dbschema_tDBOutput_1.trim().length() == 0) {
- tableName_tDBOutput_1 = "FACT_snimek_dochazky";
- } else {
- tableName_tDBOutput_1 = dbschema_tDBOutput_1 + "].["
- + "FACT_snimek_dochazky";
- }
- int count_tDBOutput_1 = 0;
- String insert_tDBOutput_1 = "INSERT INTO ["
- + tableName_tDBOutput_1
- + "] ([odpracovano_hodin],[prescasy],[celkova_mzda],[dovolena_vybrana],[dovolena_zustatek],[dovolena_celkem],[DIM_zamestnanci_idzamestnanci],[DIM_pracoviste_idpracoviste],[DIM_kalendar_idkalendare],[DIM_mzdove_sazby_idsazby]) VALUES (?,?,?,?,?,?,?,?,?,?)";
- java.sql.PreparedStatement pstmt_tDBOutput_1 = conn_tDBOutput_1
- .prepareStatement(insert_tDBOutput_1);
- resourceMap.put("pstmt_tDBOutput_1", pstmt_tDBOutput_1);
- /**
- * [tDBOutput_1 begin ] stop
- */
- /**
- * [tMap_2 begin ] start
- */
- ok_Hash.put("tMap_2", false);
- start_Hash.put("tMap_2", System.currentTimeMillis());
- currentComponent = "tMap_2";
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null) {
- runStat.updateStatOnConnection("row4" + iterateId, 0, 0);
- }
- }
- int tos_count_tMap_2 = 0;
- // ###############################
- // # Lookup's keys initialization
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row7Struct> tHash_Lookup_row7 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row7Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row7Struct>) globalMap
- .get("tHash_Lookup_row7"));
- row7Struct row7HashKey = new row7Struct();
- row7Struct row7Default = new row7Struct();
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<zamestnanecStruct> tHash_Lookup_zamestnanec = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<zamestnanecStruct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<zamestnanecStruct>) globalMap
- .get("tHash_Lookup_zamestnanec"));
- zamestnanecStruct zamestnanecHashKey = new zamestnanecStruct();
- zamestnanecStruct zamestnanecDefault = new zamestnanecStruct();
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row11Struct> tHash_Lookup_row11 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row11Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row11Struct>) globalMap
- .get("tHash_Lookup_row11"));
- row11Struct row11HashKey = new row11Struct();
- row11Struct row11Default = new row11Struct();
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row5Struct> tHash_Lookup_row5 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row5Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row5Struct>) globalMap
- .get("tHash_Lookup_row5"));
- row5Struct row5HashKey = new row5Struct();
- row5Struct row5Default = new row5Struct();
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row9Struct> tHash_Lookup_row9 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row9Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row9Struct>) globalMap
- .get("tHash_Lookup_row9"));
- row9Struct row9HashKey = new row9Struct();
- row9Struct row9Default = new row9Struct();
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct> tHash_Lookup_row8 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct>) globalMap
- .get("tHash_Lookup_row8"));
- row8Struct row8HashKey = new row8Struct();
- row8Struct row8Default = new row8Struct();
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct> tHash_Lookup_row6 = (org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct>) ((org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct>) globalMap
- .get("tHash_Lookup_row6"));
- row6Struct row6HashKey = new row6Struct();
- row6Struct row6Default = new row6Struct();
- // ###############################
- // ###############################
- // # Vars initialization
- class Var__tMap_2__Struct {
- }
- Var__tMap_2__Struct Var__tMap_2 = new Var__tMap_2__Struct();
- // ###############################
- // ###############################
- // # Outputs initialization
- out2Struct out2_tmp = new out2Struct();
- // ###############################
- /**
- * [tMap_2 begin ] stop
- */
- /**
- * [tAggregateRow_1_AGGIN begin ] start
- */
- ok_Hash.put("tAggregateRow_1_AGGIN", false);
- start_Hash.put("tAggregateRow_1_AGGIN",
- System.currentTimeMillis());
- currentVirtualComponent = "tAggregateRow_1";
- currentComponent = "tAggregateRow_1_AGGIN";
- int tos_count_tAggregateRow_1_AGGIN = 0;
- java.util.Collection<AggOperationStruct_tAggregateRow_1> values_tAggregateRow_1 = hash_tAggregateRow_1
- .values();
- globalMap.put("tAggregateRow_1_NB_LINE",
- values_tAggregateRow_1.size());
- for (AggOperationStruct_tAggregateRow_1 aggregated_row_tAggregateRow_1 : values_tAggregateRow_1) { // G_AggR_600
- /**
- * [tAggregateRow_1_AGGIN begin ] stop
- */
- /**
- * [tAggregateRow_1_AGGIN main ] start
- */
- currentVirtualComponent = "tAggregateRow_1";
- currentComponent = "tAggregateRow_1_AGGIN";
- row4.idzamestnanci = aggregated_row_tAggregateRow_1.idzamestnanci;
- row4.datum_rok = aggregated_row_tAggregateRow_1.datum_rok;
- row4.datum_mesic = aggregated_row_tAggregateRow_1.datum_mesic;
- row4.doba_v_praci = aggregated_row_tAggregateRow_1.doba_v_praci_sum;
- row4.prescas = aggregated_row_tAggregateRow_1.prescas_sum;
- tos_count_tAggregateRow_1_AGGIN++;
- /**
- * [tAggregateRow_1_AGGIN main ] stop
- */
- /**
- * [tAggregateRow_1_AGGIN process_data_begin ] start
- */
- currentVirtualComponent = "tAggregateRow_1";
- currentComponent = "tAggregateRow_1_AGGIN";
- /**
- * [tAggregateRow_1_AGGIN process_data_begin ] stop
- */
- /**
- * [tMap_2 main ] start
- */
- currentComponent = "tMap_2";
- // row4
- // row4
- if (execStat) {
- runStat.updateStatOnConnection("row4" + iterateId, 1, 1);
- }
- boolean hasCasePrimitiveKeyWithNull_tMap_2 = false;
- // ###############################
- // # Input tables (lookups)
- boolean rejectedInnerJoin_tMap_2 = false;
- boolean mainRowRejected_tMap_2 = false;
- // /////////////////////////////////////////////
- // Starting Lookup Table "row7"
- // /////////////////////////////////////////////
- boolean forceLooprow7 = false;
- row7Struct row7ObjectFromLookup = null;
- if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
- hasCasePrimitiveKeyWithNull_tMap_2 = false;
- Object exprKeyValue_row7__nazev_mesice = row4.datum_mesic;
- if (exprKeyValue_row7__nazev_mesice == null) {
- hasCasePrimitiveKeyWithNull_tMap_2 = true;
- } else {
- row7HashKey.nazev_mesice = (short) (Short) exprKeyValue_row7__nazev_mesice;
- }
- Object exprKeyValue_row7__rok = row4.datum_rok;
- if (exprKeyValue_row7__rok == null) {
- hasCasePrimitiveKeyWithNull_tMap_2 = true;
- } else {
- row7HashKey.rok = (short) (Short) exprKeyValue_row7__rok;
- }
- row7HashKey.hashCodeDirty = true;
- if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
- tHash_Lookup_row7.lookup(row7HashKey);
- } // G_TM_M_091
- } // G_TM_M_020
- if (tHash_Lookup_row7 != null
- && tHash_Lookup_row7.getCount(row7HashKey) > 1) { // G
- // 071
- // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row7' and it contains more one result from keys : row7.nazev_mesice = '"
- // + row7HashKey.nazev_mesice + "', row7.rok = '" +
- // row7HashKey.rok + "'");
- } // G 071
- row7Struct row7 = null;
- row7Struct fromLookup_row7 = null;
- row7 = row7Default;
- if (tHash_Lookup_row7 != null
- && tHash_Lookup_row7.hasNext()) { // G 099
- fromLookup_row7 = tHash_Lookup_row7.next();
- } // G 099
- if (fromLookup_row7 != null) {
- row7 = fromLookup_row7;
- }
- // /////////////////////////////////////////////
- // Starting Lookup Table "zamestnanec"
- // /////////////////////////////////////////////
- boolean forceLoopzamestnanec = false;
- zamestnanecStruct zamestnanecObjectFromLookup = null;
- if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
- hasCasePrimitiveKeyWithNull_tMap_2 = false;
- Object exprKeyValue_zamestnanec__cislo_zamestnance = row4.idzamestnanci;
- if (exprKeyValue_zamestnanec__cislo_zamestnance == null) {
- hasCasePrimitiveKeyWithNull_tMap_2 = true;
- } else {
- zamestnanecHashKey.cislo_zamestnance = (int) (Integer) exprKeyValue_zamestnanec__cislo_zamestnance;
- }
- zamestnanecHashKey.hashCodeDirty = true;
- if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
- tHash_Lookup_zamestnanec.lookup(zamestnanecHashKey);
- } // G_TM_M_091
- if (hasCasePrimitiveKeyWithNull_tMap_2
- || !tHash_Lookup_zamestnanec.hasNext()) { // G_TM_M_090
- rejectedInnerJoin_tMap_2 = true;
- } // G_TM_M_090
- } // G_TM_M_020
- if (tHash_Lookup_zamestnanec != null
- && tHash_Lookup_zamestnanec
- .getCount(zamestnanecHashKey) > 1) { // G
- // 071
- // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'zamestnanec' and it contains more one result from keys : zamestnanec.cislo_zamestnance = '"
- // + zamestnanecHashKey.cislo_zamestnance + "'");
- } // G 071
- zamestnanecStruct zamestnanec = null;
- zamestnanecStruct fromLookup_zamestnanec = null;
- zamestnanec = zamestnanecDefault;
- if (tHash_Lookup_zamestnanec != null
- && tHash_Lookup_zamestnanec.hasNext()) { // G 099
- fromLookup_zamestnanec = tHash_Lookup_zamestnanec
- .next();
- } // G 099
- if (fromLookup_zamestnanec != null) {
- zamestnanec = fromLookup_zamestnanec;
- }
- // /////////////////////////////////////////////
- // Starting Lookup Table "row11"
- // /////////////////////////////////////////////
- boolean forceLooprow11 = false;
- row11Struct row11ObjectFromLookup = null;
- if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
- hasCasePrimitiveKeyWithNull_tMap_2 = false;
- Object exprKeyValue_row11__idzamestnanci = row4.idzamestnanci;
- if (exprKeyValue_row11__idzamestnanci == null) {
- hasCasePrimitiveKeyWithNull_tMap_2 = true;
- } else {
- row11HashKey.idzamestnanci = (int) (Integer) exprKeyValue_row11__idzamestnanci;
- }
- Object exprKeyValue_row11__mesic = row4.datum_mesic;
- if (exprKeyValue_row11__mesic == null) {
- hasCasePrimitiveKeyWithNull_tMap_2 = true;
- } else {
- row11HashKey.mesic = (short) (Short) exprKeyValue_row11__mesic;
- }
- Object exprKeyValue_row11__rok = row4.datum_rok;
- if (exprKeyValue_row11__rok == null) {
- hasCasePrimitiveKeyWithNull_tMap_2 = true;
- } else {
- row11HashKey.rok = (short) (Short) exprKeyValue_row11__rok;
- }
- row11HashKey.hashCodeDirty = true;
- if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
- tHash_Lookup_row11.lookup(row11HashKey);
- } // G_TM_M_091
- } // G_TM_M_020
- if (tHash_Lookup_row11 != null
- && tHash_Lookup_row11.getCount(row11HashKey) > 1) { // G
- // 071
- // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row11' and it contains more one result from keys : row11.idzamestnanci = '"
- // + row11HashKey.idzamestnanci + "', row11.mesic = '" +
- // row11HashKey.mesic + "', row11.rok = '" +
- // row11HashKey.rok + "'");
- } // G 071
- row11Struct row11 = null;
- row11Struct fromLookup_row11 = null;
- row11 = row11Default;
- if (tHash_Lookup_row11 != null
- && tHash_Lookup_row11.hasNext()) { // G 099
- fromLookup_row11 = tHash_Lookup_row11.next();
- } // G 099
- if (fromLookup_row11 != null) {
- row11 = fromLookup_row11;
- }
- // /////////////////////////////////////////////
- // Starting Lookup Table "row5"
- // /////////////////////////////////////////////
- boolean forceLooprow5 = false;
- row5Struct row5ObjectFromLookup = null;
- if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
- hasCasePrimitiveKeyWithNull_tMap_2 = false;
- Object exprKeyValue_row5__idzamestnanci = row4.idzamestnanci;
- if (exprKeyValue_row5__idzamestnanci == null) {
- hasCasePrimitiveKeyWithNull_tMap_2 = true;
- } else {
- row5HashKey.idzamestnanci = (int) (Integer) exprKeyValue_row5__idzamestnanci;
- }
- row5HashKey.rok = row4.datum_rok;
- row5HashKey.hashCodeDirty = true;
- if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
- tHash_Lookup_row5.lookup(row5HashKey);
- } // G_TM_M_091
- if (hasCasePrimitiveKeyWithNull_tMap_2
- || !tHash_Lookup_row5.hasNext()) { // G_TM_M_090
- rejectedInnerJoin_tMap_2 = true;
- } // G_TM_M_090
- } // G_TM_M_020
- if (tHash_Lookup_row5 != null
- && tHash_Lookup_row5.getCount(row5HashKey) > 1) { // G
- // 071
- // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row5' and it contains more one result from keys : row5.idzamestnanci = '"
- // + row5HashKey.idzamestnanci + "', row5.rok = '" +
- // row5HashKey.rok + "'");
- } // G 071
- row5Struct row5 = null;
- row5Struct fromLookup_row5 = null;
- row5 = row5Default;
- if (tHash_Lookup_row5 != null
- && tHash_Lookup_row5.hasNext()) { // G 099
- fromLookup_row5 = tHash_Lookup_row5.next();
- } // G 099
- if (fromLookup_row5 != null) {
- row5 = fromLookup_row5;
- }
- // /////////////////////////////////////////////
- // Starting Lookup Table "row9"
- // /////////////////////////////////////////////
- boolean forceLooprow9 = false;
- row9Struct row9ObjectFromLookup = null;
- if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
- hasCasePrimitiveKeyWithNull_tMap_2 = false;
- Object exprKeyValue_row9__cislo_pracoviste = zamestnanec.idpracoviste;
- if (exprKeyValue_row9__cislo_pracoviste == null) {
- hasCasePrimitiveKeyWithNull_tMap_2 = true;
- } else {
- row9HashKey.cislo_pracoviste = (int) (Integer) exprKeyValue_row9__cislo_pracoviste;
- }
- row9HashKey.hashCodeDirty = true;
- if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
- tHash_Lookup_row9.lookup(row9HashKey);
- } // G_TM_M_091
- if (hasCasePrimitiveKeyWithNull_tMap_2
- || !tHash_Lookup_row9.hasNext()) { // G_TM_M_090
- rejectedInnerJoin_tMap_2 = true;
- } // G_TM_M_090
- } // G_TM_M_020
- if (tHash_Lookup_row9 != null
- && tHash_Lookup_row9.getCount(row9HashKey) > 1) { // G
- // 071
- // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row9' and it contains more one result from keys : row9.cislo_pracoviste = '"
- // + row9HashKey.cislo_pracoviste + "'");
- } // G 071
- row9Struct row9 = null;
- row9Struct fromLookup_row9 = null;
- row9 = row9Default;
- if (tHash_Lookup_row9 != null
- && tHash_Lookup_row9.hasNext()) { // G 099
- fromLookup_row9 = tHash_Lookup_row9.next();
- } // G 099
- if (fromLookup_row9 != null) {
- row9 = fromLookup_row9;
- }
- // /////////////////////////////////////////////
- // Starting Lookup Table "row8"
- // /////////////////////////////////////////////
- boolean forceLooprow8 = false;
- row8Struct row8ObjectFromLookup = null;
- if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
- hasCasePrimitiveKeyWithNull_tMap_2 = false;
- row8HashKey.nazev_profese = zamestnanec.nazev_profese;
- row8HashKey.hashCodeDirty = true;
- tHash_Lookup_row8.lookup(row8HashKey);
- if (!tHash_Lookup_row8.hasNext()) { // G_TM_M_090
- rejectedInnerJoin_tMap_2 = true;
- } // G_TM_M_090
- } // G_TM_M_020
- if (tHash_Lookup_row8 != null
- && tHash_Lookup_row8.getCount(row8HashKey) > 1) { // G
- // 071
- // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row8' and it contains more one result from keys : row8.nazev_profese = '"
- // + row8HashKey.nazev_profese + "'");
- } // G 071
- row8Struct row8 = null;
- row8Struct fromLookup_row8 = null;
- row8 = row8Default;
- if (tHash_Lookup_row8 != null
- && tHash_Lookup_row8.hasNext()) { // G 099
- fromLookup_row8 = tHash_Lookup_row8.next();
- } // G 099
- if (fromLookup_row8 != null) {
- row8 = fromLookup_row8;
- }
- // /////////////////////////////////////////////
- // Starting Lookup Table "row6"
- // /////////////////////////////////////////////
- boolean forceLooprow6 = false;
- row6Struct row6ObjectFromLookup = null;
- if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
- hasCasePrimitiveKeyWithNull_tMap_2 = false;
- Object exprKeyValue_row6__idzamestnanci = zamestnanec.idzamestnanci;
- if (exprKeyValue_row6__idzamestnanci == null) {
- hasCasePrimitiveKeyWithNull_tMap_2 = true;
- } else {
- row6HashKey.idzamestnanci = (int) (Integer) exprKeyValue_row6__idzamestnanci;
- }
- row6HashKey.dovolena_rok = row4.datum_rok;
- row6HashKey.hashCodeDirty = true;
- if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
- tHash_Lookup_row6.lookup(row6HashKey);
- } // G_TM_M_091
- } // G_TM_M_020
- if (tHash_Lookup_row6 != null
- && tHash_Lookup_row6.getCount(row6HashKey) > 1) { // G
- // 071
- // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row6' and it contains more one result from keys : row6.idzamestnanci = '"
- // + row6HashKey.idzamestnanci +
- // "', row6.dovolena_rok = '" + row6HashKey.dovolena_rok
- // + "'");
- } // G 071
- row6Struct row6 = null;
- row6Struct fromLookup_row6 = null;
- row6 = row6Default;
- if (tHash_Lookup_row6 != null
- && tHash_Lookup_row6.hasNext()) { // G 099
- fromLookup_row6 = tHash_Lookup_row6.next();
- } // G 099
- if (fromLookup_row6 != null) {
- row6 = fromLookup_row6;
- }
- // ###############################
- { // start of Var scope
- // ###############################
- // # Vars tables
- Var__tMap_2__Struct Var = Var__tMap_2;// ###############################
- // ###############################
- // # Output tables
- out2 = null;
- if (!rejectedInnerJoin_tMap_2) {
- // # Output table : 'out2'
- out2_tmp.odpracovano_hodin = BigDecimal
- .valueOf(row4.doba_v_praci / 3600);
- out2_tmp.prescasy = BigDecimal
- .valueOf(row4.prescas / 3600);
- out2_tmp.celkova_mzda = BigDecimal
- .valueOf(zamestnanec.hodinova_sazba
- * (row4.doba_v_praci / 3600)
- + zamestnanec.osobni_priplatek
- + (Relational.ISNULL(row11.odmena) ? 0
- : row11.odmena));
- out2_tmp.dovolena_vybrana = BigDecimal
- .valueOf(row6.dovolena_mesic == row4.datum_mesic ? row6.dovolena_cerpani
- : 0);
- out2_tmp.dovolena_zustatek = BigDecimal
- .valueOf(row4.datum_mesic >= row6.dovolena_mesic ? row5.dovolena_celkem
- - row6.dovolena_cerpani
- : row5.dovolena_celkem);
- out2_tmp.dovolena_celkem = row5.dovolena_celkem;
- out2_tmp.DIM_zamestnanci_idzamestnanci = zamestnanec.idzamestnanci;
- out2_tmp.DIM_pracoviste_idpracoviste = row9.idpracoviste;
- out2_tmp.DIM_kalendar_idkalendare = row7.idkalendare;
- out2_tmp.DIM_mzdove_sazby_idsazby = row8.idsazby;
- out2 = out2_tmp;
- } // closing inner join bracket (2)
- // ###############################
- } // end of Var scope
- rejectedInnerJoin_tMap_2 = false;
- tos_count_tMap_2++;
- /**
- * [tMap_2 main ] stop
- */
- /**
- * [tMap_2 process_data_begin ] start
- */
- currentComponent = "tMap_2";
- /**
- * [tMap_2 process_data_begin ] stop
- */
- // Start of branch "out2"
- if (out2 != null) {
- /**
- * [tDBOutput_1 main ] start
- */
- currentComponent = "tDBOutput_1";
- // out2
- // out2
- if (execStat) {
- runStat.updateStatOnConnection("out2" + iterateId,
- 1, 1);
- }
- whetherReject_tDBOutput_1 = false;
- pstmt_tDBOutput_1.setBigDecimal(1,
- out2.odpracovano_hodin);
- pstmt_tDBOutput_1.setBigDecimal(2, out2.prescasy);
- pstmt_tDBOutput_1.setBigDecimal(3, out2.celkova_mzda);
- pstmt_tDBOutput_1.setBigDecimal(4,
- out2.dovolena_vybrana);
- pstmt_tDBOutput_1.setBigDecimal(5,
- out2.dovolena_zustatek);
- if (out2.dovolena_celkem == null) {
- pstmt_tDBOutput_1
- .setNull(6, java.sql.Types.INTEGER);
- } else {
- pstmt_tDBOutput_1.setInt(6, out2.dovolena_celkem);
- }
- if (out2.DIM_zamestnanci_idzamestnanci == null) {
- pstmt_tDBOutput_1
- .setNull(7, java.sql.Types.INTEGER);
- } else {
- pstmt_tDBOutput_1.setInt(7,
- out2.DIM_zamestnanci_idzamestnanci);
- }
- if (out2.DIM_pracoviste_idpracoviste == null) {
- pstmt_tDBOutput_1
- .setNull(8, java.sql.Types.INTEGER);
- } else {
- pstmt_tDBOutput_1.setInt(8,
- out2.DIM_pracoviste_idpracoviste);
- }
- if (out2.DIM_kalendar_idkalendare == null) {
- pstmt_tDBOutput_1
- .setNull(9, java.sql.Types.INTEGER);
- } else {
- pstmt_tDBOutput_1.setInt(9,
- out2.DIM_kalendar_idkalendare);
- }
- if (out2.DIM_mzdove_sazby_idsazby == null) {
- pstmt_tDBOutput_1.setNull(10,
- java.sql.Types.INTEGER);
- } else {
- pstmt_tDBOutput_1.setInt(10,
- out2.DIM_mzdove_sazby_idsazby);
- }
- pstmt_tDBOutput_1.addBatch();
- nb_line_tDBOutput_1++;
- batchSizeCounter_tDBOutput_1++;
- // ////////batch execute by batch size///////
- class LimitBytesHelper_tDBOutput_1 {
- public int limitBytePart1(int counter,
- java.sql.PreparedStatement pstmt_tDBOutput_1)
- throws Exception {
- try {
- for (int countEach_tDBOutput_1 : pstmt_tDBOutput_1
- .executeBatch()) {
- if (countEach_tDBOutput_1 == -2
- || countEach_tDBOutput_1 == -3) {
- break;
- }
- counter += countEach_tDBOutput_1;
- }
- } catch (java.sql.BatchUpdateException e) {
- int countSum_tDBOutput_1 = 0;
- for (int countEach_tDBOutput_1 : e
- .getUpdateCounts()) {
- counter += (countEach_tDBOutput_1 < 0 ? 0
- : countEach_tDBOutput_1);
- }
- System.err.println(e.getMessage());
- }
- return counter;
- }
- public int limitBytePart2(int counter,
- java.sql.PreparedStatement pstmt_tDBOutput_1)
- throws Exception {
- try {
- for (int countEach_tDBOutput_1 : pstmt_tDBOutput_1
- .executeBatch()) {
- if (countEach_tDBOutput_1 == -2
- || countEach_tDBOutput_1 == -3) {
- break;
- }
- counter += countEach_tDBOutput_1;
- }
- } catch (java.sql.BatchUpdateException e) {
- for (int countEach_tDBOutput_1 : e
- .getUpdateCounts()) {
- counter += (countEach_tDBOutput_1 < 0 ? 0
- : countEach_tDBOutput_1);
- }
- System.err.println(e.getMessage());
- }
- return counter;
- }
- }
- if ((batchSize_tDBOutput_1 > 0)
- && (batchSize_tDBOutput_1 <= batchSizeCounter_tDBOutput_1)) {
- insertedCount_tDBOutput_1 = new LimitBytesHelper_tDBOutput_1()
- .limitBytePart1(insertedCount_tDBOutput_1,
- pstmt_tDBOutput_1);
- batchSizeCounter_tDBOutput_1 = 0;
- }
- // //////////commit every////////////
- commitCounter_tDBOutput_1++;
- if (commitEvery_tDBOutput_1 <= commitCounter_tDBOutput_1) {
- if ((batchSize_tDBOutput_1 > 0)
- && (batchSizeCounter_tDBOutput_1 > 0)) {
- insertedCount_tDBOutput_1 = new LimitBytesHelper_tDBOutput_1()
- .limitBytePart1(
- insertedCount_tDBOutput_1,
- pstmt_tDBOutput_1);
- batchSizeCounter_tDBOutput_1 = 0;
- }
- conn_tDBOutput_1.commit();
- commitCounter_tDBOutput_1 = 0;
- }
- tos_count_tDBOutput_1++;
- /**
- * [tDBOutput_1 main ] stop
- */
- /**
- * [tDBOutput_1 process_data_begin ] start
- */
- currentComponent = "tDBOutput_1";
- /**
- * [tDBOutput_1 process_data_begin ] stop
- */
- /**
- * [tDBOutput_1 process_data_end ] start
- */
- currentComponent = "tDBOutput_1";
- /**
- * [tDBOutput_1 process_data_end ] stop
- */
- } // End of branch "out2"
- /**
- * [tMap_2 process_data_end ] start
- */
- currentComponent = "tMap_2";
- /**
- * [tMap_2 process_data_end ] stop
- */
- /**
- * [tAggregateRow_1_AGGIN process_data_end ] start
- */
- currentVirtualComponent = "tAggregateRow_1";
- currentComponent = "tAggregateRow_1_AGGIN";
- /**
- * [tAggregateRow_1_AGGIN process_data_end ] stop
- */
- /**
- * [tAggregateRow_1_AGGIN end ] start
- */
- currentVirtualComponent = "tAggregateRow_1";
- currentComponent = "tAggregateRow_1_AGGIN";
- } // G_AggR_600
- ok_Hash.put("tAggregateRow_1_AGGIN", true);
- end_Hash.put("tAggregateRow_1_AGGIN",
- System.currentTimeMillis());
- /**
- * [tAggregateRow_1_AGGIN end ] stop
- */
- /**
- * [tMap_2 end ] start
- */
- currentComponent = "tMap_2";
- // ###############################
- // # Lookup hashes releasing
- if (tHash_Lookup_row7 != null) {
- tHash_Lookup_row7.endGet();
- }
- globalMap.remove("tHash_Lookup_row7");
- if (tHash_Lookup_zamestnanec != null) {
- tHash_Lookup_zamestnanec.endGet();
- }
- globalMap.remove("tHash_Lookup_zamestnanec");
- if (tHash_Lookup_row11 != null) {
- tHash_Lookup_row11.endGet();
- }
- globalMap.remove("tHash_Lookup_row11");
- if (tHash_Lookup_row5 != null) {
- tHash_Lookup_row5.endGet();
- }
- globalMap.remove("tHash_Lookup_row5");
- if (tHash_Lookup_row9 != null) {
- tHash_Lookup_row9.endGet();
- }
- globalMap.remove("tHash_Lookup_row9");
- if (tHash_Lookup_row8 != null) {
- tHash_Lookup_row8.endGet();
- }
- globalMap.remove("tHash_Lookup_row8");
- if (tHash_Lookup_row6 != null) {
- tHash_Lookup_row6.endGet();
- }
- globalMap.remove("tHash_Lookup_row6");
- // ###############################
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null
- || !((Boolean) resourceMap.get("inIterateVComp"))) {
- runStat.updateStatOnConnection("row4" + iterateId, 2, 0);
- }
- }
- ok_Hash.put("tMap_2", true);
- end_Hash.put("tMap_2", System.currentTimeMillis());
- /**
- * [tMap_2 end ] stop
- */
- /**
- * [tDBOutput_1 end ] start
- */
- currentComponent = "tDBOutput_1";
- try {
- int countSum_tDBOutput_1 = 0;
- if (pstmt_tDBOutput_1 != null
- && batchSizeCounter_tDBOutput_1 > 0) {
- for (int countEach_tDBOutput_1 : pstmt_tDBOutput_1
- .executeBatch()) {
- if (countEach_tDBOutput_1 == -2
- || countEach_tDBOutput_1 == -3) {
- break;
- }
- countSum_tDBOutput_1 += countEach_tDBOutput_1;
- }
- }
- insertedCount_tDBOutput_1 += countSum_tDBOutput_1;
- } catch (java.sql.BatchUpdateException e) {
- int countSum_tDBOutput_1 = 0;
- for (int countEach_tDBOutput_1 : e.getUpdateCounts()) {
- countSum_tDBOutput_1 += (countEach_tDBOutput_1 < 0 ? 0
- : countEach_tDBOutput_1);
- }
- insertedCount_tDBOutput_1 += countSum_tDBOutput_1;
- System.err.println(e.getMessage());
- }
- if (pstmt_tDBOutput_1 != null) {
- pstmt_tDBOutput_1.close();
- resourceMap.remove("pstmt_tDBOutput_1");
- }
- resourceMap.put("statementClosed_tDBOutput_1", true);
- conn_tDBOutput_1.commit();
- conn_tDBOutput_1.close();
- resourceMap.put("finish_tDBOutput_1", true);
- nb_line_deleted_tDBOutput_1 = nb_line_deleted_tDBOutput_1
- + deletedCount_tDBOutput_1;
- nb_line_update_tDBOutput_1 = nb_line_update_tDBOutput_1
- + updatedCount_tDBOutput_1;
- nb_line_inserted_tDBOutput_1 = nb_line_inserted_tDBOutput_1
- + insertedCount_tDBOutput_1;
- nb_line_rejected_tDBOutput_1 = nb_line_rejected_tDBOutput_1
- + rejectedCount_tDBOutput_1;
- globalMap.put("tDBOutput_1_NB_LINE", nb_line_tDBOutput_1);
- globalMap.put("tDBOutput_1_NB_LINE_UPDATED",
- nb_line_update_tDBOutput_1);
- globalMap.put("tDBOutput_1_NB_LINE_INSERTED",
- nb_line_inserted_tDBOutput_1);
- globalMap.put("tDBOutput_1_NB_LINE_DELETED",
- nb_line_deleted_tDBOutput_1);
- globalMap.put("tDBOutput_1_NB_LINE_REJECTED",
- nb_line_rejected_tDBOutput_1);
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null
- || !((Boolean) resourceMap.get("inIterateVComp"))) {
- runStat.updateStatOnConnection("out2" + iterateId, 2, 0);
- }
- }
- ok_Hash.put("tDBOutput_1", true);
- end_Hash.put("tDBOutput_1", System.currentTimeMillis());
- /**
- * [tDBOutput_1 end ] stop
- */
- }// end the resume
- } catch (java.lang.Exception e) {
- TalendException te = new TalendException(e, currentComponent,
- globalMap);
- te.setVirtualComponentName(currentVirtualComponent);
- throw te;
- } catch (java.lang.Error error) {
- runStat.stopThreadStat();
- throw error;
- } finally {
- // free memory for "tMap_2"
- globalMap.remove("tHash_Lookup_zamestnanec");
- // free memory for "tMap_2"
- globalMap.remove("tHash_Lookup_row11");
- // free memory for "tMap_2"
- globalMap.remove("tHash_Lookup_row5");
- // free memory for "tMap_2"
- globalMap.remove("tHash_Lookup_row6");
- // free memory for "tMap_2"
- globalMap.remove("tHash_Lookup_row7");
- // free memory for "tMap_2"
- globalMap.remove("tHash_Lookup_row8");
- // free memory for "tMap_2"
- globalMap.remove("tHash_Lookup_row9");
- // free memory for "tAggregateRow_1_AGGIN"
- globalMap.remove("tAggregateRow_1");
- try {
- /**
- * [tDBInput_6 finally ] start
- */
- currentComponent = "tDBInput_6";
- /**
- * [tDBInput_6 finally ] stop
- */
- /**
- * [tAggregateRow_1_AGGOUT finally ] start
- */
- currentVirtualComponent = "tAggregateRow_1";
- currentComponent = "tAggregateRow_1_AGGOUT";
- /**
- * [tAggregateRow_1_AGGOUT finally ] stop
- */
- /**
- * [tAggregateRow_1_AGGIN finally ] start
- */
- currentVirtualComponent = "tAggregateRow_1";
- currentComponent = "tAggregateRow_1_AGGIN";
- /**
- * [tAggregateRow_1_AGGIN finally ] stop
- */
- /**
- * [tMap_2 finally ] start
- */
- currentComponent = "tMap_2";
- /**
- * [tMap_2 finally ] stop
- */
- /**
- * [tDBOutput_1 finally ] start
- */
- currentComponent = "tDBOutput_1";
- try {
- if (resourceMap.get("statementClosed_tDBOutput_1") == null) {
- java.sql.PreparedStatement pstmtToClose_tDBOutput_1 = null;
- if ((pstmtToClose_tDBOutput_1 = (java.sql.PreparedStatement) resourceMap
- .remove("pstmt_tDBOutput_1")) != null) {
- pstmtToClose_tDBOutput_1.close();
- }
- }
- } finally {
- if (resourceMap.get("finish_tDBOutput_1") == null) {
- java.sql.Connection ctn_tDBOutput_1 = null;
- if ((ctn_tDBOutput_1 = (java.sql.Connection) resourceMap
- .get("conn_tDBOutput_1")) != null) {
- try {
- ctn_tDBOutput_1.close();
- } catch (java.sql.SQLException sqlEx_tDBOutput_1) {
- String errorMessage_tDBOutput_1 = "failed to close the connection in tDBOutput_1 :"
- + sqlEx_tDBOutput_1.getMessage();
- System.err.println(errorMessage_tDBOutput_1);
- }
- }
- }
- }
- /**
- * [tDBOutput_1 finally ] stop
- */
- } catch (java.lang.Exception e) {
- // ignore
- } catch (java.lang.Error error) {
- // ignore
- }
- resourceMap = null;
- }
- globalMap.put("tDBInput_6_SUBPROCESS_STATE", 1);
- }
- public static class row6Struct implements
- routines.system.IPersistableComparableLookupRow<row6Struct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- protected static final int DEFAULT_HASHCODE = 1;
- protected static final int PRIME = 31;
- protected int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- public String loopKey;
- public int idzamestnanci;
- public int getIdzamestnanci() {
- return this.idzamestnanci;
- }
- public Short dovolena_mesic;
- public Short getDovolena_mesic() {
- return this.dovolena_mesic;
- }
- public Short dovolena_rok;
- public Short getDovolena_rok() {
- return this.dovolena_rok;
- }
- public Integer dovolena_cerpani;
- public Integer getDovolena_cerpani() {
- return this.dovolena_cerpani;
- }
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime * result + (int) this.idzamestnanci;
- result = prime
- * result
- + ((this.dovolena_rok == null) ? 0 : this.dovolena_rok
- .hashCode());
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final row6Struct other = (row6Struct) obj;
- if (this.idzamestnanci != other.idzamestnanci)
- return false;
- if (this.dovolena_rok == null) {
- if (other.dovolena_rok != null)
- return false;
- } else if (!this.dovolena_rok.equals(other.dovolena_rok))
- return false;
- return true;
- }
- public void copyDataTo(row6Struct other) {
- other.idzamestnanci = this.idzamestnanci;
- other.dovolena_mesic = this.dovolena_mesic;
- other.dovolena_rok = this.dovolena_rok;
- other.dovolena_cerpani = this.dovolena_cerpani;
- }
- public void copyKeysDataTo(row6Struct other) {
- other.idzamestnanci = this.idzamestnanci;
- other.dovolena_rok = this.dovolena_rok;
- }
- private Integer readInteger(DataInputStream dis, ObjectInputStream ois)
- throws IOException {
- Integer intReturn;
- int length = 0;
- length = dis.readByte();
- if (length == -1) {
- intReturn = null;
- } else {
- intReturn = dis.readInt();
- }
- return intReturn;
- }
- private void writeInteger(Integer intNum, DataOutputStream dos,
- ObjectOutputStream oos) throws IOException {
- if (intNum == null) {
- dos.writeByte(-1);
- } else {
- dos.writeByte(0);
- dos.writeInt(intNum);
- }
- }
- public void readKeysData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.idzamestnanci = dis.readInt();
- length = dis.readByte();
- if (length == -1) {
- this.dovolena_rok = null;
- } else {
- this.dovolena_rok = dis.readShort();
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeKeysData(ObjectOutputStream dos) {
- try {
- // int
- dos.writeInt(this.idzamestnanci);
- // Short
- if (this.dovolena_rok == null) {
- dos.writeByte(-1);
- } else {
- dos.writeByte(0);
- dos.writeShort(this.dovolena_rok);
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Fill Values data by reading ObjectInputStream.
- */
- public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
- try {
- int length = 0;
- length = dis.readByte();
- if (length == -1) {
- this.dovolena_mesic = null;
- } else {
- this.dovolena_mesic = dis.readShort();
- }
- this.dovolena_cerpani = readInteger(dis, ois);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Return a byte array which represents Values data.
- */
- public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
- try {
- if (this.dovolena_mesic == null) {
- dos.writeByte(-1);
- } else {
- dos.writeByte(0);
- dos.writeShort(this.dovolena_mesic);
- }
- writeInteger(this.dovolena_cerpani, dos, oos);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("idzamestnanci=" + String.valueOf(idzamestnanci));
- sb.append(",dovolena_mesic=" + String.valueOf(dovolena_mesic));
- sb.append(",dovolena_rok=" + String.valueOf(dovolena_rok));
- sb.append(",dovolena_cerpani=" + String.valueOf(dovolena_cerpani));
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(row6Struct other) {
- int returnValue = -1;
- returnValue = checkNullsAndCompare(this.idzamestnanci,
- other.idzamestnanci);
- if (returnValue != 0) {
- return returnValue;
- }
- returnValue = checkNullsAndCompare(this.dovolena_rok,
- other.dovolena_rok);
- if (returnValue != 0) {
- return returnValue;
- }
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public void tDBInput_7Process(final java.util.Map<String, Object> globalMap)
- throws TalendException {
- globalMap.put("tDBInput_7_SUBPROCESS_STATE", 0);
- final boolean execStat = this.execStat;
- String iterateId = "";
- String currentComponent = "";
- java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
- try {
- // TDI-39566 avoid throwing an useless Exception
- boolean resumeIt = true;
- if (globalResumeTicket == false && resumeEntryMethodName != null) {
- String currentMethodName = new java.lang.Exception()
- .getStackTrace()[0].getMethodName();
- resumeIt = resumeEntryMethodName.equals(currentMethodName);
- }
- if (resumeIt || globalResumeTicket) { // start the resume
- globalResumeTicket = true;
- row6Struct row6 = new row6Struct();
- /**
- * [tAdvancedHash_row6 begin ] start
- */
- ok_Hash.put("tAdvancedHash_row6", false);
- start_Hash
- .put("tAdvancedHash_row6", System.currentTimeMillis());
- currentComponent = "tAdvancedHash_row6";
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null) {
- runStat.updateStatOnConnection("row6" + iterateId, 0, 0);
- }
- }
- int tos_count_tAdvancedHash_row6 = 0;
- // connection name:row6
- // source node:tDBInput_7 - inputs:(after_tDBInput_6)
- // outputs:(row6,row6) | target node:tAdvancedHash_row6 -
- // inputs:(row6) outputs:()
- // linked node: tMap_2 -
- // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
- // outputs:(out2)
- org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row6 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct> tHash_Lookup_row6 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
- .<row6Struct> getLookup(matchingModeEnum_row6);
- globalMap.put("tHash_Lookup_row6", tHash_Lookup_row6);
- /**
- * [tAdvancedHash_row6 begin ] stop
- */
- /**
- * [tDBInput_7 begin ] start
- */
- ok_Hash.put("tDBInput_7", false);
- start_Hash.put("tDBInput_7", System.currentTimeMillis());
- currentComponent = "tDBInput_7";
- int tos_count_tDBInput_7 = 0;
- org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_7 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
- .getMSSqlGenerateTimestampUtil();
- java.util.List<String> talendToDBList_tDBInput_7 = new java.util.ArrayList();
- String[] talendToDBArray_tDBInput_7 = new String[] { "FLOAT",
- "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
- "DECIMAL IDENTITY", "REAL" };
- java.util.Collections.addAll(talendToDBList_tDBInput_7,
- talendToDBArray_tDBInput_7);
- int nb_line_tDBInput_7 = 0;
- java.sql.Connection conn_tDBInput_7 = null;
- String driverClass_tDBInput_7 = "net.sourceforge.jtds.jdbc.Driver";
- java.lang.Class.forName(driverClass_tDBInput_7);
- String dbUser_tDBInput_7 = "tym1";
- final String decryptedPassword_tDBInput_7 = routines.system.PasswordEncryptUtil
- .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
- String dbPwd_tDBInput_7 = decryptedPassword_tDBInput_7;
- String port_tDBInput_7 = "1433";
- String dbname_tDBInput_7 = "bi_zdroj01";
- String url_tDBInput_7 = "jdbc:jtds:sqlserver://"
- + "158.196.160.60";
- if (!"".equals(port_tDBInput_7)) {
- url_tDBInput_7 += ":" + "1433";
- }
- if (!"".equals(dbname_tDBInput_7)) {
- url_tDBInput_7 += "//" + "bi_zdroj01";
- }
- url_tDBInput_7 += ";appName=" + projectName + ";" + "";
- String dbschema_tDBInput_7 = "";
- conn_tDBInput_7 = java.sql.DriverManager.getConnection(
- url_tDBInput_7, dbUser_tDBInput_7, dbPwd_tDBInput_7);
- java.sql.Statement stmt_tDBInput_7 = conn_tDBInput_7
- .createStatement();
- String dbquery_tDBInput_7 = "SELECT\n cerpani_dovolene.idzamestnanci,\n MONTH(cerpani_dovolene.dovolena_od) AS dovolena_mesic,\n YEAR(cerpani_dov"
- + "olene.dovolena_do) AS dovolena_rok,\n DATEDIFF(day, dovolena_od, dovolena_do) AS dovolena_cerpani\nFROM cerpani_dovolen"
- + "e ORDER BY dovolena_rok, dovolena_mesic";
- globalMap.put("tDBInput_7_QUERY", dbquery_tDBInput_7);
- java.sql.ResultSet rs_tDBInput_7 = null;
- try {
- rs_tDBInput_7 = stmt_tDBInput_7
- .executeQuery(dbquery_tDBInput_7);
- java.sql.ResultSetMetaData rsmd_tDBInput_7 = rs_tDBInput_7
- .getMetaData();
- int colQtyInRs_tDBInput_7 = rsmd_tDBInput_7
- .getColumnCount();
- String tmpContent_tDBInput_7 = null;
- while (rs_tDBInput_7.next()) {
- nb_line_tDBInput_7++;
- if (colQtyInRs_tDBInput_7 < 1) {
- row6.idzamestnanci = 0;
- } else {
- if (rs_tDBInput_7.getObject(1) != null) {
- row6.idzamestnanci = rs_tDBInput_7.getInt(1);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_7 < 2) {
- row6.dovolena_mesic = null;
- } else {
- if (rs_tDBInput_7.getObject(2) != null) {
- row6.dovolena_mesic = rs_tDBInput_7.getShort(2);
- } else {
- row6.dovolena_mesic = null;
- }
- }
- if (colQtyInRs_tDBInput_7 < 3) {
- row6.dovolena_rok = null;
- } else {
- if (rs_tDBInput_7.getObject(3) != null) {
- row6.dovolena_rok = rs_tDBInput_7.getShort(3);
- } else {
- row6.dovolena_rok = null;
- }
- }
- if (colQtyInRs_tDBInput_7 < 4) {
- row6.dovolena_cerpani = null;
- } else {
- if (rs_tDBInput_7.getObject(4) != null) {
- row6.dovolena_cerpani = rs_tDBInput_7.getInt(4);
- } else {
- row6.dovolena_cerpani = null;
- }
- }
- /**
- * [tDBInput_7 begin ] stop
- */
- /**
- * [tDBInput_7 main ] start
- */
- currentComponent = "tDBInput_7";
- tos_count_tDBInput_7++;
- /**
- * [tDBInput_7 main ] stop
- */
- /**
- * [tDBInput_7 process_data_begin ] start
- */
- currentComponent = "tDBInput_7";
- /**
- * [tDBInput_7 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row6 main ] start
- */
- currentComponent = "tAdvancedHash_row6";
- // row6
- // row6
- if (execStat) {
- runStat.updateStatOnConnection("row6" + iterateId,
- 1, 1);
- }
- row6Struct row6_HashRow = new row6Struct();
- row6_HashRow.idzamestnanci = row6.idzamestnanci;
- row6_HashRow.dovolena_mesic = row6.dovolena_mesic;
- row6_HashRow.dovolena_rok = row6.dovolena_rok;
- row6_HashRow.dovolena_cerpani = row6.dovolena_cerpani;
- tHash_Lookup_row6.put(row6_HashRow);
- tos_count_tAdvancedHash_row6++;
- /**
- * [tAdvancedHash_row6 main ] stop
- */
- /**
- * [tAdvancedHash_row6 process_data_begin ] start
- */
- currentComponent = "tAdvancedHash_row6";
- /**
- * [tAdvancedHash_row6 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row6 process_data_end ] start
- */
- currentComponent = "tAdvancedHash_row6";
- /**
- * [tAdvancedHash_row6 process_data_end ] stop
- */
- /**
- * [tDBInput_7 process_data_end ] start
- */
- currentComponent = "tDBInput_7";
- /**
- * [tDBInput_7 process_data_end ] stop
- */
- /**
- * [tDBInput_7 end ] start
- */
- currentComponent = "tDBInput_7";
- }
- } finally {
- if (rs_tDBInput_7 != null) {
- rs_tDBInput_7.close();
- }
- if (stmt_tDBInput_7 != null) {
- stmt_tDBInput_7.close();
- }
- if (conn_tDBInput_7 != null && !conn_tDBInput_7.isClosed()) {
- conn_tDBInput_7.close();
- }
- }
- globalMap.put("tDBInput_7_NB_LINE", nb_line_tDBInput_7);
- ok_Hash.put("tDBInput_7", true);
- end_Hash.put("tDBInput_7", System.currentTimeMillis());
- /**
- * [tDBInput_7 end ] stop
- */
- /**
- * [tAdvancedHash_row6 end ] start
- */
- currentComponent = "tAdvancedHash_row6";
- tHash_Lookup_row6.endPut();
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null
- || !((Boolean) resourceMap.get("inIterateVComp"))) {
- runStat.updateStatOnConnection("row6" + iterateId, 2, 0);
- }
- }
- ok_Hash.put("tAdvancedHash_row6", true);
- end_Hash.put("tAdvancedHash_row6", System.currentTimeMillis());
- /**
- * [tAdvancedHash_row6 end ] stop
- */
- }// end the resume
- } catch (java.lang.Exception e) {
- TalendException te = new TalendException(e, currentComponent,
- globalMap);
- throw te;
- } catch (java.lang.Error error) {
- runStat.stopThreadStat();
- throw error;
- } finally {
- try {
- /**
- * [tDBInput_7 finally ] start
- */
- currentComponent = "tDBInput_7";
- /**
- * [tDBInput_7 finally ] stop
- */
- /**
- * [tAdvancedHash_row6 finally ] start
- */
- currentComponent = "tAdvancedHash_row6";
- /**
- * [tAdvancedHash_row6 finally ] stop
- */
- } catch (java.lang.Exception e) {
- // ignore
- } catch (java.lang.Error error) {
- // ignore
- }
- resourceMap = null;
- }
- globalMap.put("tDBInput_7_SUBPROCESS_STATE", 1);
- }
- public static class row7Struct implements
- routines.system.IPersistableComparableLookupRow<row7Struct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- protected static final int DEFAULT_HASHCODE = 1;
- protected static final int PRIME = 31;
- protected int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- public String loopKey;
- public int idkalendare;
- public int getIdkalendare() {
- return this.idkalendare;
- }
- public short nazev_mesice;
- public short getNazev_mesice() {
- return this.nazev_mesice;
- }
- public short ctvrtleti;
- public short getCtvrtleti() {
- return this.ctvrtleti;
- }
- public short rok;
- public short getRok() {
- return this.rok;
- }
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime * result + (int) this.nazev_mesice;
- result = prime * result + (int) this.rok;
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final row7Struct other = (row7Struct) obj;
- if (this.nazev_mesice != other.nazev_mesice)
- return false;
- if (this.rok != other.rok)
- return false;
- return true;
- }
- public void copyDataTo(row7Struct other) {
- other.idkalendare = this.idkalendare;
- other.nazev_mesice = this.nazev_mesice;
- other.ctvrtleti = this.ctvrtleti;
- other.rok = this.rok;
- }
- public void copyKeysDataTo(row7Struct other) {
- other.nazev_mesice = this.nazev_mesice;
- other.rok = this.rok;
- }
- public void readKeysData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.nazev_mesice = dis.readShort();
- this.rok = dis.readShort();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeKeysData(ObjectOutputStream dos) {
- try {
- // short
- dos.writeShort(this.nazev_mesice);
- // short
- dos.writeShort(this.rok);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Fill Values data by reading ObjectInputStream.
- */
- public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
- try {
- int length = 0;
- this.idkalendare = dis.readInt();
- this.ctvrtleti = dis.readShort();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Return a byte array which represents Values data.
- */
- public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
- try {
- dos.writeInt(this.idkalendare);
- dos.writeShort(this.ctvrtleti);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("idkalendare=" + String.valueOf(idkalendare));
- sb.append(",nazev_mesice=" + String.valueOf(nazev_mesice));
- sb.append(",ctvrtleti=" + String.valueOf(ctvrtleti));
- sb.append(",rok=" + String.valueOf(rok));
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(row7Struct other) {
- int returnValue = -1;
- returnValue = checkNullsAndCompare(this.nazev_mesice,
- other.nazev_mesice);
- if (returnValue != 0) {
- return returnValue;
- }
- returnValue = checkNullsAndCompare(this.rok, other.rok);
- if (returnValue != 0) {
- return returnValue;
- }
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public void tDBInput_8Process(final java.util.Map<String, Object> globalMap)
- throws TalendException {
- globalMap.put("tDBInput_8_SUBPROCESS_STATE", 0);
- final boolean execStat = this.execStat;
- String iterateId = "";
- String currentComponent = "";
- java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
- try {
- // TDI-39566 avoid throwing an useless Exception
- boolean resumeIt = true;
- if (globalResumeTicket == false && resumeEntryMethodName != null) {
- String currentMethodName = new java.lang.Exception()
- .getStackTrace()[0].getMethodName();
- resumeIt = resumeEntryMethodName.equals(currentMethodName);
- }
- if (resumeIt || globalResumeTicket) { // start the resume
- globalResumeTicket = true;
- row7Struct row7 = new row7Struct();
- /**
- * [tAdvancedHash_row7 begin ] start
- */
- ok_Hash.put("tAdvancedHash_row7", false);
- start_Hash
- .put("tAdvancedHash_row7", System.currentTimeMillis());
- currentComponent = "tAdvancedHash_row7";
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null) {
- runStat.updateStatOnConnection("row7" + iterateId, 0, 0);
- }
- }
- int tos_count_tAdvancedHash_row7 = 0;
- // connection name:row7
- // source node:tDBInput_8 - inputs:(after_tDBInput_6)
- // outputs:(row7,row7) | target node:tAdvancedHash_row7 -
- // inputs:(row7) outputs:()
- // linked node: tMap_2 -
- // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
- // outputs:(out2)
- org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row7 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row7Struct> tHash_Lookup_row7 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
- .<row7Struct> getLookup(matchingModeEnum_row7);
- globalMap.put("tHash_Lookup_row7", tHash_Lookup_row7);
- /**
- * [tAdvancedHash_row7 begin ] stop
- */
- /**
- * [tDBInput_8 begin ] start
- */
- ok_Hash.put("tDBInput_8", false);
- start_Hash.put("tDBInput_8", System.currentTimeMillis());
- currentComponent = "tDBInput_8";
- int tos_count_tDBInput_8 = 0;
- org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_8 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
- .getMSSqlGenerateTimestampUtil();
- java.util.List<String> talendToDBList_tDBInput_8 = new java.util.ArrayList();
- String[] talendToDBArray_tDBInput_8 = new String[] { "FLOAT",
- "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
- "DECIMAL IDENTITY", "REAL" };
- java.util.Collections.addAll(talendToDBList_tDBInput_8,
- talendToDBArray_tDBInput_8);
- int nb_line_tDBInput_8 = 0;
- java.sql.Connection conn_tDBInput_8 = null;
- String driverClass_tDBInput_8 = "net.sourceforge.jtds.jdbc.Driver";
- java.lang.Class.forName(driverClass_tDBInput_8);
- String dbUser_tDBInput_8 = "tym1";
- final String decryptedPassword_tDBInput_8 = routines.system.PasswordEncryptUtil
- .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
- String dbPwd_tDBInput_8 = decryptedPassword_tDBInput_8;
- String port_tDBInput_8 = "1433";
- String dbname_tDBInput_8 = "tym1";
- String url_tDBInput_8 = "jdbc:jtds:sqlserver://"
- + "158.196.160.60";
- if (!"".equals(port_tDBInput_8)) {
- url_tDBInput_8 += ":" + "1433";
- }
- if (!"".equals(dbname_tDBInput_8)) {
- url_tDBInput_8 += "//" + "tym1";
- }
- url_tDBInput_8 += ";appName=" + projectName + ";" + "";
- String dbschema_tDBInput_8 = "";
- conn_tDBInput_8 = java.sql.DriverManager.getConnection(
- url_tDBInput_8, dbUser_tDBInput_8, dbPwd_tDBInput_8);
- java.sql.Statement stmt_tDBInput_8 = conn_tDBInput_8
- .createStatement();
- String dbquery_tDBInput_8 = "SELECT DIM_kalendar.idkalendare,\n DIM_kalendar.nazev_mesice,\n DIM_kalendar.ctvrtleti,\n DIM_kalendar.rok\nFROM DIM_kal"
- + "endar";
- globalMap.put("tDBInput_8_QUERY", dbquery_tDBInput_8);
- java.sql.ResultSet rs_tDBInput_8 = null;
- try {
- rs_tDBInput_8 = stmt_tDBInput_8
- .executeQuery(dbquery_tDBInput_8);
- java.sql.ResultSetMetaData rsmd_tDBInput_8 = rs_tDBInput_8
- .getMetaData();
- int colQtyInRs_tDBInput_8 = rsmd_tDBInput_8
- .getColumnCount();
- String tmpContent_tDBInput_8 = null;
- while (rs_tDBInput_8.next()) {
- nb_line_tDBInput_8++;
- if (colQtyInRs_tDBInput_8 < 1) {
- row7.idkalendare = 0;
- } else {
- if (rs_tDBInput_8.getObject(1) != null) {
- row7.idkalendare = rs_tDBInput_8.getInt(1);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_8 < 2) {
- row7.nazev_mesice = 0;
- } else {
- if (rs_tDBInput_8.getObject(2) != null) {
- row7.nazev_mesice = rs_tDBInput_8.getShort(2);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_8 < 3) {
- row7.ctvrtleti = 0;
- } else {
- if (rs_tDBInput_8.getObject(3) != null) {
- row7.ctvrtleti = rs_tDBInput_8.getShort(3);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_8 < 4) {
- row7.rok = 0;
- } else {
- if (rs_tDBInput_8.getObject(4) != null) {
- row7.rok = rs_tDBInput_8.getShort(4);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- /**
- * [tDBInput_8 begin ] stop
- */
- /**
- * [tDBInput_8 main ] start
- */
- currentComponent = "tDBInput_8";
- tos_count_tDBInput_8++;
- /**
- * [tDBInput_8 main ] stop
- */
- /**
- * [tDBInput_8 process_data_begin ] start
- */
- currentComponent = "tDBInput_8";
- /**
- * [tDBInput_8 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row7 main ] start
- */
- currentComponent = "tAdvancedHash_row7";
- // row7
- // row7
- if (execStat) {
- runStat.updateStatOnConnection("row7" + iterateId,
- 1, 1);
- }
- row7Struct row7_HashRow = new row7Struct();
- row7_HashRow.idkalendare = row7.idkalendare;
- row7_HashRow.nazev_mesice = row7.nazev_mesice;
- row7_HashRow.ctvrtleti = row7.ctvrtleti;
- row7_HashRow.rok = row7.rok;
- tHash_Lookup_row7.put(row7_HashRow);
- tos_count_tAdvancedHash_row7++;
- /**
- * [tAdvancedHash_row7 main ] stop
- */
- /**
- * [tAdvancedHash_row7 process_data_begin ] start
- */
- currentComponent = "tAdvancedHash_row7";
- /**
- * [tAdvancedHash_row7 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row7 process_data_end ] start
- */
- currentComponent = "tAdvancedHash_row7";
- /**
- * [tAdvancedHash_row7 process_data_end ] stop
- */
- /**
- * [tDBInput_8 process_data_end ] start
- */
- currentComponent = "tDBInput_8";
- /**
- * [tDBInput_8 process_data_end ] stop
- */
- /**
- * [tDBInput_8 end ] start
- */
- currentComponent = "tDBInput_8";
- }
- } finally {
- if (rs_tDBInput_8 != null) {
- rs_tDBInput_8.close();
- }
- if (stmt_tDBInput_8 != null) {
- stmt_tDBInput_8.close();
- }
- if (conn_tDBInput_8 != null && !conn_tDBInput_8.isClosed()) {
- conn_tDBInput_8.close();
- }
- }
- globalMap.put("tDBInput_8_NB_LINE", nb_line_tDBInput_8);
- ok_Hash.put("tDBInput_8", true);
- end_Hash.put("tDBInput_8", System.currentTimeMillis());
- /**
- * [tDBInput_8 end ] stop
- */
- /**
- * [tAdvancedHash_row7 end ] start
- */
- currentComponent = "tAdvancedHash_row7";
- tHash_Lookup_row7.endPut();
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null
- || !((Boolean) resourceMap.get("inIterateVComp"))) {
- runStat.updateStatOnConnection("row7" + iterateId, 2, 0);
- }
- }
- ok_Hash.put("tAdvancedHash_row7", true);
- end_Hash.put("tAdvancedHash_row7", System.currentTimeMillis());
- /**
- * [tAdvancedHash_row7 end ] stop
- */
- }// end the resume
- } catch (java.lang.Exception e) {
- TalendException te = new TalendException(e, currentComponent,
- globalMap);
- throw te;
- } catch (java.lang.Error error) {
- runStat.stopThreadStat();
- throw error;
- } finally {
- try {
- /**
- * [tDBInput_8 finally ] start
- */
- currentComponent = "tDBInput_8";
- /**
- * [tDBInput_8 finally ] stop
- */
- /**
- * [tAdvancedHash_row7 finally ] start
- */
- currentComponent = "tAdvancedHash_row7";
- /**
- * [tAdvancedHash_row7 finally ] stop
- */
- } catch (java.lang.Exception e) {
- // ignore
- } catch (java.lang.Error error) {
- // ignore
- }
- resourceMap = null;
- }
- globalMap.put("tDBInput_8_SUBPROCESS_STATE", 1);
- }
- public static class row8Struct implements
- routines.system.IPersistableComparableLookupRow<row8Struct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- protected static final int DEFAULT_HASHCODE = 1;
- protected static final int PRIME = 31;
- protected int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- public String loopKey;
- public int idsazby;
- public int getIdsazby() {
- return this.idsazby;
- }
- public int cislo_sazby;
- public int getCislo_sazby() {
- return this.cislo_sazby;
- }
- public String nazev_profese;
- public String getNazev_profese() {
- return this.nazev_profese;
- }
- public int hodinova_sazba;
- public int getHodinova_sazba() {
- return this.hodinova_sazba;
- }
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime
- * result
- + ((this.nazev_profese == null) ? 0
- : this.nazev_profese.hashCode());
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final row8Struct other = (row8Struct) obj;
- if (this.nazev_profese == null) {
- if (other.nazev_profese != null)
- return false;
- } else if (!this.nazev_profese.equals(other.nazev_profese))
- return false;
- return true;
- }
- public void copyDataTo(row8Struct other) {
- other.idsazby = this.idsazby;
- other.cislo_sazby = this.cislo_sazby;
- other.nazev_profese = this.nazev_profese;
- other.hodinova_sazba = this.hodinova_sazba;
- }
- public void copyKeysDataTo(row8Struct other) {
- other.nazev_profese = this.nazev_profese;
- }
- private String readString(ObjectInputStream dis) throws IOException {
- String strReturn = null;
- int length = 0;
- length = dis.readInt();
- if (length == -1) {
- strReturn = null;
- } else {
- if (length > commonByteArray_BI_FACT_snimek_dochazky.length) {
- if (length < 1024
- && commonByteArray_BI_FACT_snimek_dochazky.length == 0) {
- commonByteArray_BI_FACT_snimek_dochazky = new byte[1024];
- } else {
- commonByteArray_BI_FACT_snimek_dochazky = new byte[2 * length];
- }
- }
- dis.readFully(commonByteArray_BI_FACT_snimek_dochazky, 0,
- length);
- strReturn = new String(commonByteArray_BI_FACT_snimek_dochazky,
- 0, length, utf8Charset);
- }
- return strReturn;
- }
- private void writeString(String str, ObjectOutputStream dos)
- throws IOException {
- if (str == null) {
- dos.writeInt(-1);
- } else {
- byte[] byteArray = str.getBytes(utf8Charset);
- dos.writeInt(byteArray.length);
- dos.write(byteArray);
- }
- }
- public void readKeysData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.nazev_profese = readString(dis);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeKeysData(ObjectOutputStream dos) {
- try {
- // String
- writeString(this.nazev_profese, dos);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Fill Values data by reading ObjectInputStream.
- */
- public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
- try {
- int length = 0;
- this.idsazby = dis.readInt();
- this.cislo_sazby = dis.readInt();
- this.hodinova_sazba = dis.readInt();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Return a byte array which represents Values data.
- */
- public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
- try {
- dos.writeInt(this.idsazby);
- dos.writeInt(this.cislo_sazby);
- dos.writeInt(this.hodinova_sazba);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("idsazby=" + String.valueOf(idsazby));
- sb.append(",cislo_sazby=" + String.valueOf(cislo_sazby));
- sb.append(",nazev_profese=" + nazev_profese);
- sb.append(",hodinova_sazba=" + String.valueOf(hodinova_sazba));
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(row8Struct other) {
- int returnValue = -1;
- returnValue = checkNullsAndCompare(this.nazev_profese,
- other.nazev_profese);
- if (returnValue != 0) {
- return returnValue;
- }
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public void tDBInput_9Process(final java.util.Map<String, Object> globalMap)
- throws TalendException {
- globalMap.put("tDBInput_9_SUBPROCESS_STATE", 0);
- final boolean execStat = this.execStat;
- String iterateId = "";
- String currentComponent = "";
- java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
- try {
- // TDI-39566 avoid throwing an useless Exception
- boolean resumeIt = true;
- if (globalResumeTicket == false && resumeEntryMethodName != null) {
- String currentMethodName = new java.lang.Exception()
- .getStackTrace()[0].getMethodName();
- resumeIt = resumeEntryMethodName.equals(currentMethodName);
- }
- if (resumeIt || globalResumeTicket) { // start the resume
- globalResumeTicket = true;
- row8Struct row8 = new row8Struct();
- /**
- * [tAdvancedHash_row8 begin ] start
- */
- ok_Hash.put("tAdvancedHash_row8", false);
- start_Hash
- .put("tAdvancedHash_row8", System.currentTimeMillis());
- currentComponent = "tAdvancedHash_row8";
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null) {
- runStat.updateStatOnConnection("row8" + iterateId, 0, 0);
- }
- }
- int tos_count_tAdvancedHash_row8 = 0;
- // connection name:row8
- // source node:tDBInput_9 - inputs:(after_tDBInput_6)
- // outputs:(row8,row8) | target node:tAdvancedHash_row8 -
- // inputs:(row8) outputs:()
- // linked node: tMap_2 -
- // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
- // outputs:(out2)
- org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row8 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct> tHash_Lookup_row8 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
- .<row8Struct> getLookup(matchingModeEnum_row8);
- globalMap.put("tHash_Lookup_row8", tHash_Lookup_row8);
- /**
- * [tAdvancedHash_row8 begin ] stop
- */
- /**
- * [tDBInput_9 begin ] start
- */
- ok_Hash.put("tDBInput_9", false);
- start_Hash.put("tDBInput_9", System.currentTimeMillis());
- currentComponent = "tDBInput_9";
- int tos_count_tDBInput_9 = 0;
- org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_9 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
- .getMSSqlGenerateTimestampUtil();
- java.util.List<String> talendToDBList_tDBInput_9 = new java.util.ArrayList();
- String[] talendToDBArray_tDBInput_9 = new String[] { "FLOAT",
- "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
- "DECIMAL IDENTITY", "REAL" };
- java.util.Collections.addAll(talendToDBList_tDBInput_9,
- talendToDBArray_tDBInput_9);
- int nb_line_tDBInput_9 = 0;
- java.sql.Connection conn_tDBInput_9 = null;
- String driverClass_tDBInput_9 = "net.sourceforge.jtds.jdbc.Driver";
- java.lang.Class.forName(driverClass_tDBInput_9);
- String dbUser_tDBInput_9 = "tym1";
- final String decryptedPassword_tDBInput_9 = routines.system.PasswordEncryptUtil
- .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
- String dbPwd_tDBInput_9 = decryptedPassword_tDBInput_9;
- String port_tDBInput_9 = "1433";
- String dbname_tDBInput_9 = "tym1";
- String url_tDBInput_9 = "jdbc:jtds:sqlserver://"
- + "158.196.160.60";
- if (!"".equals(port_tDBInput_9)) {
- url_tDBInput_9 += ":" + "1433";
- }
- if (!"".equals(dbname_tDBInput_9)) {
- url_tDBInput_9 += "//" + "tym1";
- }
- url_tDBInput_9 += ";appName=" + projectName + ";" + "";
- String dbschema_tDBInput_9 = "";
- conn_tDBInput_9 = java.sql.DriverManager.getConnection(
- url_tDBInput_9, dbUser_tDBInput_9, dbPwd_tDBInput_9);
- java.sql.Statement stmt_tDBInput_9 = conn_tDBInput_9
- .createStatement();
- String dbquery_tDBInput_9 = "SELECT DIM_mzdove_sazby.idsazby,\n DIM_mzdove_sazby.cislo_sazby,\n DIM_mzdove_sazby.nazev_profese,\n DIM_mzdove_sazby.h"
- + "odinova_sazba\nFROM DIM_mzdove_sazby";
- globalMap.put("tDBInput_9_QUERY", dbquery_tDBInput_9);
- java.sql.ResultSet rs_tDBInput_9 = null;
- try {
- rs_tDBInput_9 = stmt_tDBInput_9
- .executeQuery(dbquery_tDBInput_9);
- java.sql.ResultSetMetaData rsmd_tDBInput_9 = rs_tDBInput_9
- .getMetaData();
- int colQtyInRs_tDBInput_9 = rsmd_tDBInput_9
- .getColumnCount();
- String tmpContent_tDBInput_9 = null;
- while (rs_tDBInput_9.next()) {
- nb_line_tDBInput_9++;
- if (colQtyInRs_tDBInput_9 < 1) {
- row8.idsazby = 0;
- } else {
- if (rs_tDBInput_9.getObject(1) != null) {
- row8.idsazby = rs_tDBInput_9.getInt(1);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_9 < 2) {
- row8.cislo_sazby = 0;
- } else {
- if (rs_tDBInput_9.getObject(2) != null) {
- row8.cislo_sazby = rs_tDBInput_9.getInt(2);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_9 < 3) {
- row8.nazev_profese = null;
- } else {
- tmpContent_tDBInput_9 = rs_tDBInput_9.getString(3);
- if (tmpContent_tDBInput_9 != null) {
- if (talendToDBList_tDBInput_9
- .contains(rsmd_tDBInput_9
- .getColumnTypeName(3)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row8.nazev_profese = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_9);
- } else {
- row8.nazev_profese = tmpContent_tDBInput_9;
- }
- } else {
- row8.nazev_profese = null;
- }
- }
- if (colQtyInRs_tDBInput_9 < 4) {
- row8.hodinova_sazba = 0;
- } else {
- if (rs_tDBInput_9.getObject(4) != null) {
- row8.hodinova_sazba = rs_tDBInput_9.getInt(4);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- /**
- * [tDBInput_9 begin ] stop
- */
- /**
- * [tDBInput_9 main ] start
- */
- currentComponent = "tDBInput_9";
- tos_count_tDBInput_9++;
- /**
- * [tDBInput_9 main ] stop
- */
- /**
- * [tDBInput_9 process_data_begin ] start
- */
- currentComponent = "tDBInput_9";
- /**
- * [tDBInput_9 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row8 main ] start
- */
- currentComponent = "tAdvancedHash_row8";
- // row8
- // row8
- if (execStat) {
- runStat.updateStatOnConnection("row8" + iterateId,
- 1, 1);
- }
- row8Struct row8_HashRow = new row8Struct();
- row8_HashRow.idsazby = row8.idsazby;
- row8_HashRow.cislo_sazby = row8.cislo_sazby;
- row8_HashRow.nazev_profese = row8.nazev_profese;
- row8_HashRow.hodinova_sazba = row8.hodinova_sazba;
- tHash_Lookup_row8.put(row8_HashRow);
- tos_count_tAdvancedHash_row8++;
- /**
- * [tAdvancedHash_row8 main ] stop
- */
- /**
- * [tAdvancedHash_row8 process_data_begin ] start
- */
- currentComponent = "tAdvancedHash_row8";
- /**
- * [tAdvancedHash_row8 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row8 process_data_end ] start
- */
- currentComponent = "tAdvancedHash_row8";
- /**
- * [tAdvancedHash_row8 process_data_end ] stop
- */
- /**
- * [tDBInput_9 process_data_end ] start
- */
- currentComponent = "tDBInput_9";
- /**
- * [tDBInput_9 process_data_end ] stop
- */
- /**
- * [tDBInput_9 end ] start
- */
- currentComponent = "tDBInput_9";
- }
- } finally {
- if (rs_tDBInput_9 != null) {
- rs_tDBInput_9.close();
- }
- if (stmt_tDBInput_9 != null) {
- stmt_tDBInput_9.close();
- }
- if (conn_tDBInput_9 != null && !conn_tDBInput_9.isClosed()) {
- conn_tDBInput_9.close();
- }
- }
- globalMap.put("tDBInput_9_NB_LINE", nb_line_tDBInput_9);
- ok_Hash.put("tDBInput_9", true);
- end_Hash.put("tDBInput_9", System.currentTimeMillis());
- /**
- * [tDBInput_9 end ] stop
- */
- /**
- * [tAdvancedHash_row8 end ] start
- */
- currentComponent = "tAdvancedHash_row8";
- tHash_Lookup_row8.endPut();
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null
- || !((Boolean) resourceMap.get("inIterateVComp"))) {
- runStat.updateStatOnConnection("row8" + iterateId, 2, 0);
- }
- }
- ok_Hash.put("tAdvancedHash_row8", true);
- end_Hash.put("tAdvancedHash_row8", System.currentTimeMillis());
- /**
- * [tAdvancedHash_row8 end ] stop
- */
- }// end the resume
- } catch (java.lang.Exception e) {
- TalendException te = new TalendException(e, currentComponent,
- globalMap);
- throw te;
- } catch (java.lang.Error error) {
- runStat.stopThreadStat();
- throw error;
- } finally {
- try {
- /**
- * [tDBInput_9 finally ] start
- */
- currentComponent = "tDBInput_9";
- /**
- * [tDBInput_9 finally ] stop
- */
- /**
- * [tAdvancedHash_row8 finally ] start
- */
- currentComponent = "tAdvancedHash_row8";
- /**
- * [tAdvancedHash_row8 finally ] stop
- */
- } catch (java.lang.Exception e) {
- // ignore
- } catch (java.lang.Error error) {
- // ignore
- }
- resourceMap = null;
- }
- globalMap.put("tDBInput_9_SUBPROCESS_STATE", 1);
- }
- public static class row9Struct implements
- routines.system.IPersistableComparableLookupRow<row9Struct> {
- final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
- static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
- protected static final int DEFAULT_HASHCODE = 1;
- protected static final int PRIME = 31;
- protected int hashCode = DEFAULT_HASHCODE;
- public boolean hashCodeDirty = true;
- public String loopKey;
- public int idpracoviste;
- public int getIdpracoviste() {
- return this.idpracoviste;
- }
- public int cislo_pracoviste;
- public int getCislo_pracoviste() {
- return this.cislo_pracoviste;
- }
- public String nazev_pracoviste;
- public String getNazev_pracoviste() {
- return this.nazev_pracoviste;
- }
- @Override
- public int hashCode() {
- if (this.hashCodeDirty) {
- final int prime = PRIME;
- int result = DEFAULT_HASHCODE;
- result = prime * result + (int) this.cislo_pracoviste;
- this.hashCode = result;
- this.hashCodeDirty = false;
- }
- return this.hashCode;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final row9Struct other = (row9Struct) obj;
- if (this.cislo_pracoviste != other.cislo_pracoviste)
- return false;
- return true;
- }
- public void copyDataTo(row9Struct other) {
- other.idpracoviste = this.idpracoviste;
- other.cislo_pracoviste = this.cislo_pracoviste;
- other.nazev_pracoviste = this.nazev_pracoviste;
- }
- public void copyKeysDataTo(row9Struct other) {
- other.cislo_pracoviste = this.cislo_pracoviste;
- }
- private String readString(DataInputStream dis, ObjectInputStream ois)
- throws IOException {
- String strReturn = null;
- int length = 0;
- length = dis.readInt();
- if (length == -1) {
- strReturn = null;
- } else {
- byte[] byteArray = new byte[length];
- dis.read(byteArray);
- strReturn = new String(byteArray, utf8Charset);
- }
- return strReturn;
- }
- private void writeString(String str, DataOutputStream dos,
- ObjectOutputStream oos) throws IOException {
- if (str == null) {
- dos.writeInt(-1);
- } else {
- byte[] byteArray = str.getBytes(utf8Charset);
- dos.writeInt(byteArray.length);
- dos.write(byteArray);
- }
- }
- public void readKeysData(ObjectInputStream dis) {
- synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
- try {
- int length = 0;
- this.cislo_pracoviste = dis.readInt();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
- public void writeKeysData(ObjectOutputStream dos) {
- try {
- // int
- dos.writeInt(this.cislo_pracoviste);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Fill Values data by reading ObjectInputStream.
- */
- public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
- try {
- int length = 0;
- this.idpracoviste = dis.readInt();
- this.nazev_pracoviste = readString(dis, ois);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- /**
- * Return a byte array which represents Values data.
- */
- public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
- try {
- dos.writeInt(this.idpracoviste);
- writeString(this.nazev_pracoviste, dos, oos);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.toString());
- sb.append("[");
- sb.append("idpracoviste=" + String.valueOf(idpracoviste));
- sb.append(",cislo_pracoviste=" + String.valueOf(cislo_pracoviste));
- sb.append(",nazev_pracoviste=" + nazev_pracoviste);
- sb.append("]");
- return sb.toString();
- }
- /**
- * Compare keys
- */
- public int compareTo(row9Struct other) {
- int returnValue = -1;
- returnValue = checkNullsAndCompare(this.cislo_pracoviste,
- other.cislo_pracoviste);
- if (returnValue != 0) {
- return returnValue;
- }
- return returnValue;
- }
- private int checkNullsAndCompare(Object object1, Object object2) {
- int returnValue = 0;
- if (object1 instanceof Comparable && object2 instanceof Comparable) {
- returnValue = ((Comparable) object1).compareTo(object2);
- } else if (object1 != null && object2 != null) {
- returnValue = compareStrings(object1.toString(),
- object2.toString());
- } else if (object1 == null && object2 != null) {
- returnValue = 1;
- } else if (object1 != null && object2 == null) {
- returnValue = -1;
- } else {
- returnValue = 0;
- }
- return returnValue;
- }
- private int compareStrings(String string1, String string2) {
- return string1.compareTo(string2);
- }
- }
- public void tDBInput_10Process(final java.util.Map<String, Object> globalMap)
- throws TalendException {
- globalMap.put("tDBInput_10_SUBPROCESS_STATE", 0);
- final boolean execStat = this.execStat;
- String iterateId = "";
- String currentComponent = "";
- java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
- try {
- // TDI-39566 avoid throwing an useless Exception
- boolean resumeIt = true;
- if (globalResumeTicket == false && resumeEntryMethodName != null) {
- String currentMethodName = new java.lang.Exception()
- .getStackTrace()[0].getMethodName();
- resumeIt = resumeEntryMethodName.equals(currentMethodName);
- }
- if (resumeIt || globalResumeTicket) { // start the resume
- globalResumeTicket = true;
- row9Struct row9 = new row9Struct();
- /**
- * [tAdvancedHash_row9 begin ] start
- */
- ok_Hash.put("tAdvancedHash_row9", false);
- start_Hash
- .put("tAdvancedHash_row9", System.currentTimeMillis());
- currentComponent = "tAdvancedHash_row9";
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null) {
- runStat.updateStatOnConnection("row9" + iterateId, 0, 0);
- }
- }
- int tos_count_tAdvancedHash_row9 = 0;
- // connection name:row9
- // source node:tDBInput_10 - inputs:(after_tDBInput_6)
- // outputs:(row9,row9) | target node:tAdvancedHash_row9 -
- // inputs:(row9) outputs:()
- // linked node: tMap_2 -
- // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
- // outputs:(out2)
- org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row9 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
- org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row9Struct> tHash_Lookup_row9 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
- .<row9Struct> getLookup(matchingModeEnum_row9);
- globalMap.put("tHash_Lookup_row9", tHash_Lookup_row9);
- /**
- * [tAdvancedHash_row9 begin ] stop
- */
- /**
- * [tDBInput_10 begin ] start
- */
- ok_Hash.put("tDBInput_10", false);
- start_Hash.put("tDBInput_10", System.currentTimeMillis());
- currentComponent = "tDBInput_10";
- int tos_count_tDBInput_10 = 0;
- org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_10 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
- .getMSSqlGenerateTimestampUtil();
- java.util.List<String> talendToDBList_tDBInput_10 = new java.util.ArrayList();
- String[] talendToDBArray_tDBInput_10 = new String[] { "FLOAT",
- "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
- "DECIMAL IDENTITY", "REAL" };
- java.util.Collections.addAll(talendToDBList_tDBInput_10,
- talendToDBArray_tDBInput_10);
- int nb_line_tDBInput_10 = 0;
- java.sql.Connection conn_tDBInput_10 = null;
- String driverClass_tDBInput_10 = "net.sourceforge.jtds.jdbc.Driver";
- java.lang.Class.forName(driverClass_tDBInput_10);
- String dbUser_tDBInput_10 = "tym1";
- final String decryptedPassword_tDBInput_10 = routines.system.PasswordEncryptUtil
- .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
- String dbPwd_tDBInput_10 = decryptedPassword_tDBInput_10;
- String port_tDBInput_10 = "1433";
- String dbname_tDBInput_10 = "tym1";
- String url_tDBInput_10 = "jdbc:jtds:sqlserver://"
- + "158.196.160.60";
- if (!"".equals(port_tDBInput_10)) {
- url_tDBInput_10 += ":" + "1433";
- }
- if (!"".equals(dbname_tDBInput_10)) {
- url_tDBInput_10 += "//" + "tym1";
- }
- url_tDBInput_10 += ";appName=" + projectName + ";" + "";
- String dbschema_tDBInput_10 = "";
- conn_tDBInput_10 = java.sql.DriverManager.getConnection(
- url_tDBInput_10, dbUser_tDBInput_10, dbPwd_tDBInput_10);
- java.sql.Statement stmt_tDBInput_10 = conn_tDBInput_10
- .createStatement();
- String dbquery_tDBInput_10 = "SELECT DIM_pracoviste.idpracoviste,\n DIM_pracoviste.cislo_pracoviste,\n DIM_pracoviste.nazev_pracoviste\nFROM DIM_praco"
- + "viste";
- globalMap.put("tDBInput_10_QUERY", dbquery_tDBInput_10);
- java.sql.ResultSet rs_tDBInput_10 = null;
- try {
- rs_tDBInput_10 = stmt_tDBInput_10
- .executeQuery(dbquery_tDBInput_10);
- java.sql.ResultSetMetaData rsmd_tDBInput_10 = rs_tDBInput_10
- .getMetaData();
- int colQtyInRs_tDBInput_10 = rsmd_tDBInput_10
- .getColumnCount();
- String tmpContent_tDBInput_10 = null;
- while (rs_tDBInput_10.next()) {
- nb_line_tDBInput_10++;
- if (colQtyInRs_tDBInput_10 < 1) {
- row9.idpracoviste = 0;
- } else {
- if (rs_tDBInput_10.getObject(1) != null) {
- row9.idpracoviste = rs_tDBInput_10.getInt(1);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_10 < 2) {
- row9.cislo_pracoviste = 0;
- } else {
- if (rs_tDBInput_10.getObject(2) != null) {
- row9.cislo_pracoviste = rs_tDBInput_10
- .getInt(2);
- } else {
- throw new RuntimeException(
- "Null value in non-Nullable column");
- }
- }
- if (colQtyInRs_tDBInput_10 < 3) {
- row9.nazev_pracoviste = null;
- } else {
- tmpContent_tDBInput_10 = rs_tDBInput_10
- .getString(3);
- if (tmpContent_tDBInput_10 != null) {
- if (talendToDBList_tDBInput_10
- .contains(rsmd_tDBInput_10
- .getColumnTypeName(3)
- .toUpperCase(
- java.util.Locale.ENGLISH))) {
- row9.nazev_pracoviste = FormatterUtils
- .formatUnwithE(tmpContent_tDBInput_10);
- } else {
- row9.nazev_pracoviste = tmpContent_tDBInput_10;
- }
- } else {
- row9.nazev_pracoviste = null;
- }
- }
- /**
- * [tDBInput_10 begin ] stop
- */
- /**
- * [tDBInput_10 main ] start
- */
- currentComponent = "tDBInput_10";
- tos_count_tDBInput_10++;
- /**
- * [tDBInput_10 main ] stop
- */
- /**
- * [tDBInput_10 process_data_begin ] start
- */
- currentComponent = "tDBInput_10";
- /**
- * [tDBInput_10 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row9 main ] start
- */
- currentComponent = "tAdvancedHash_row9";
- // row9
- // row9
- if (execStat) {
- runStat.updateStatOnConnection("row9" + iterateId,
- 1, 1);
- }
- row9Struct row9_HashRow = new row9Struct();
- row9_HashRow.idpracoviste = row9.idpracoviste;
- row9_HashRow.cislo_pracoviste = row9.cislo_pracoviste;
- row9_HashRow.nazev_pracoviste = row9.nazev_pracoviste;
- tHash_Lookup_row9.put(row9_HashRow);
- tos_count_tAdvancedHash_row9++;
- /**
- * [tAdvancedHash_row9 main ] stop
- */
- /**
- * [tAdvancedHash_row9 process_data_begin ] start
- */
- currentComponent = "tAdvancedHash_row9";
- /**
- * [tAdvancedHash_row9 process_data_begin ] stop
- */
- /**
- * [tAdvancedHash_row9 process_data_end ] start
- */
- currentComponent = "tAdvancedHash_row9";
- /**
- * [tAdvancedHash_row9 process_data_end ] stop
- */
- /**
- * [tDBInput_10 process_data_end ] start
- */
- currentComponent = "tDBInput_10";
- /**
- * [tDBInput_10 process_data_end ] stop
- */
- /**
- * [tDBInput_10 end ] start
- */
- currentComponent = "tDBInput_10";
- }
- } finally {
- if (rs_tDBInput_10 != null) {
- rs_tDBInput_10.close();
- }
- if (stmt_tDBInput_10 != null) {
- stmt_tDBInput_10.close();
- }
- if (conn_tDBInput_10 != null
- && !conn_tDBInput_10.isClosed()) {
- conn_tDBInput_10.close();
- }
- }
- globalMap.put("tDBInput_10_NB_LINE", nb_line_tDBInput_10);
- ok_Hash.put("tDBInput_10", true);
- end_Hash.put("tDBInput_10", System.currentTimeMillis());
- /**
- * [tDBInput_10 end ] stop
- */
- /**
- * [tAdvancedHash_row9 end ] start
- */
- currentComponent = "tAdvancedHash_row9";
- tHash_Lookup_row9.endPut();
- if (execStat) {
- if (resourceMap.get("inIterateVComp") == null
- || !((Boolean) resourceMap.get("inIterateVComp"))) {
- runStat.updateStatOnConnection("row9" + iterateId, 2, 0);
- }
- }
- ok_Hash.put("tAdvancedHash_row9", true);
- end_Hash.put("tAdvancedHash_row9", System.currentTimeMillis());
- /**
- * [tAdvancedHash_row9 end ] stop
- */
- }// end the resume
- } catch (java.lang.Exception e) {
- TalendException te = new TalendException(e, currentComponent,
- globalMap);
- throw te;
- } catch (java.lang.Error error) {
- runStat.stopThreadStat();
- throw error;
- } finally {
- try {
- /**
- * [tDBInput_10 finally ] start
- */
- currentComponent = "tDBInput_10";
- /**
- * [tDBInput_10 finally ] stop
- */
- /**
- * [tAdvancedHash_row9 finally ] start
- */
- currentComponent = "tAdvancedHash_row9";
- /**
- * [tAdvancedHash_row9 finally ] stop
- */
- } catch (java.lang.Exception e) {
- // ignore
- } catch (java.lang.Error error) {
- // ignore
- }
- resourceMap = null;
- }
- globalMap.put("tDBInput_10_SUBPROCESS_STATE", 1);
- }
- public String resuming_logs_dir_path = null;
- public String resuming_checkpoint_path = null;
- public String parent_part_launcher = null;
- private String resumeEntryMethodName = null;
- private boolean globalResumeTicket = false;
- public boolean watch = false;
- // portStats is null, it means don't execute the statistics
- public Integer portStats = null;
- public int portTraces = 4334;
- public String clientHost;
- public String defaultClientHost = "localhost";
- public String contextStr = "Default";
- public boolean isDefaultContext = true;
- public String pid = "0";
- public String rootPid = null;
- public String fatherPid = null;
- public String fatherNode = null;
- public long startTime = 0;
- public boolean isChildJob = false;
- public String log4jLevel = "";
- private boolean execStat = true;
- private ThreadLocal<java.util.Map<String, String>> threadLocal = new ThreadLocal<java.util.Map<String, String>>() {
- protected java.util.Map<String, String> initialValue() {
- java.util.Map<String, String> threadRunResultMap = new java.util.HashMap<String, String>();
- threadRunResultMap.put("errorCode", null);
- threadRunResultMap.put("status", "");
- return threadRunResultMap;
- };
- };
- private PropertiesWithType context_param = new PropertiesWithType();
- public java.util.Map<String, Object> parentContextMap = new java.util.HashMap<String, Object>();
- public String status = "";
- public static void main(String[] args) {
- final FACT_snimek_dochazky FACT_snimek_dochazkyClass = new FACT_snimek_dochazky();
- int exitCode = FACT_snimek_dochazkyClass.runJobInTOS(args);
- System.exit(exitCode);
- }
- public String[][] runJob(String[] args) {
- int exitCode = runJobInTOS(args);
- String[][] bufferValue = new String[][] { { Integer.toString(exitCode) } };
- return bufferValue;
- }
- public boolean hastBufferOutputComponent() {
- boolean hastBufferOutput = false;
- return hastBufferOutput;
- }
- public int runJobInTOS(String[] args) {
- // reset status
- status = "";
- String lastStr = "";
- for (String arg : args) {
- if (arg.equalsIgnoreCase("--context_param")) {
- lastStr = arg;
- } else if (lastStr.equals("")) {
- evalParam(arg);
- } else {
- evalParam(lastStr + " " + arg);
- lastStr = "";
- }
- }
- if (clientHost == null) {
- clientHost = defaultClientHost;
- }
- if (pid == null || "0".equals(pid)) {
- pid = TalendString.getAsciiRandomString(6);
- }
- if (rootPid == null) {
- rootPid = pid;
- }
- if (fatherPid == null) {
- fatherPid = pid;
- } else {
- isChildJob = true;
- }
- if (portStats != null) {
- // portStats = -1; //for testing
- if (portStats < 0 || portStats > 65535) {
- // issue:10869, the portStats is invalid, so this client socket
- // can't open
- System.err.println("The statistics socket port " + portStats
- + " is invalid.");
- execStat = false;
- }
- } else {
- execStat = false;
- }
- try {
- // call job/subjob with an existing context, like:
- // --context=production. if without this parameter, there will use
- // the default context instead.
- java.io.InputStream inContext = FACT_snimek_dochazky.class
- .getClassLoader().getResourceAsStream(
- "bi/fact_snimek_dochazky_0_1/contexts/"
- + contextStr + ".properties");
- if (inContext == null) {
- inContext = FACT_snimek_dochazky.class
- .getClassLoader()
- .getResourceAsStream(
- "config/contexts/" + contextStr + ".properties");
- }
- if (inContext != null) {
- // defaultProps is in order to keep the original context value
- defaultProps.load(inContext);
- inContext.close();
- context = new ContextProperties(defaultProps);
- } else if (!isDefaultContext) {
- // print info and job continue to run, for case: context_param
- // is not empty.
- System.err.println("Could not find the context " + contextStr);
- }
- if (!context_param.isEmpty()) {
- context.putAll(context_param);
- // set types for params from parentJobs
- for (Object key : context_param.keySet()) {
- String context_key = key.toString();
- String context_type = context_param
- .getContextType(context_key);
- context.setContextType(context_key, context_type);
- }
- }
- } catch (java.io.IOException ie) {
- System.err.println("Could not load context " + contextStr);
- ie.printStackTrace();
- }
- // get context value from parent directly
- if (parentContextMap != null && !parentContextMap.isEmpty()) {
- }
- // Resume: init the resumeUtil
- resumeEntryMethodName = ResumeUtil
- .getResumeEntryMethodName(resuming_checkpoint_path);
- resumeUtil = new ResumeUtil(resuming_logs_dir_path, isChildJob, rootPid);
- resumeUtil.initCommonInfo(pid, rootPid, fatherPid, projectName,
- jobName, contextStr, jobVersion);
- List<String> parametersToEncrypt = new java.util.ArrayList<String>();
- // Resume: jobStart
- resumeUtil.addLog("JOB_STARTED", "JOB:" + jobName,
- parent_part_launcher, Thread.currentThread().getId() + "", "",
- "", "", "",
- resumeUtil.convertToJsonText(context, parametersToEncrypt));
- if (execStat) {
- try {
- runStat.openSocket(!isChildJob);
- runStat.setAllPID(rootPid, fatherPid, pid, jobName);
- runStat.startThreadStat(clientHost, portStats);
- runStat.updateStatOnJob(RunStat.JOBSTART, fatherNode);
- } catch (java.io.IOException ioException) {
- ioException.printStackTrace();
- }
- }
- java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap = new java.util.concurrent.ConcurrentHashMap<Object, Object>();
- globalMap.put("concurrentHashMap", concurrentHashMap);
- long startUsedMemory = Runtime.getRuntime().totalMemory()
- - Runtime.getRuntime().freeMemory();
- long endUsedMemory = 0;
- long end = 0;
- startTime = System.currentTimeMillis();
- this.globalResumeTicket = true;// to run tPreJob
- this.globalResumeTicket = false;// to run others jobs
- try {
- errorCode = null;
- tDBInput_6Process(globalMap);
- if (!"failure".equals(status)) {
- status = "end";
- }
- } catch (TalendException e_tDBInput_6) {
- globalMap.put("tDBInput_6_SUBPROCESS_STATE", -1);
- e_tDBInput_6.printStackTrace();
- }
- this.globalResumeTicket = true;// to run tPostJob
- end = System.currentTimeMillis();
- if (watch) {
- System.out.println((end - startTime) + " milliseconds");
- }
- endUsedMemory = Runtime.getRuntime().totalMemory()
- - Runtime.getRuntime().freeMemory();
- if (false) {
- System.out
- .println((endUsedMemory - startUsedMemory)
- + " bytes memory increase when running : FACT_snimek_dochazky");
- }
- if (execStat) {
- runStat.updateStatOnJob(RunStat.JOBEND, fatherNode);
- runStat.stopThreadStat();
- }
- int returnCode = 0;
- if (errorCode == null) {
- returnCode = status != null && status.equals("failure") ? 1 : 0;
- } else {
- returnCode = errorCode.intValue();
- }
- resumeUtil.addLog("JOB_ENDED", "JOB:" + jobName, parent_part_launcher,
- Thread.currentThread().getId() + "", "", "" + returnCode, "",
- "", "");
- return returnCode;
- }
- // only for OSGi env
- public void destroy() {
- }
- private java.util.Map<String, Object> getSharedConnections4REST() {
- java.util.Map<String, Object> connections = new java.util.HashMap<String, Object>();
- return connections;
- }
- private void evalParam(String arg) {
- if (arg.startsWith("--resuming_logs_dir_path")) {
- resuming_logs_dir_path = arg.substring(25);
- } else if (arg.startsWith("--resuming_checkpoint_path")) {
- resuming_checkpoint_path = arg.substring(27);
- } else if (arg.startsWith("--parent_part_launcher")) {
- parent_part_launcher = arg.substring(23);
- } else if (arg.startsWith("--watch")) {
- watch = true;
- } else if (arg.startsWith("--stat_port=")) {
- String portStatsStr = arg.substring(12);
- if (portStatsStr != null && !portStatsStr.equals("null")) {
- portStats = Integer.parseInt(portStatsStr);
- }
- } else if (arg.startsWith("--trace_port=")) {
- portTraces = Integer.parseInt(arg.substring(13));
- } else if (arg.startsWith("--client_host=")) {
- clientHost = arg.substring(14);
- } else if (arg.startsWith("--context=")) {
- contextStr = arg.substring(10);
- isDefaultContext = false;
- } else if (arg.startsWith("--father_pid=")) {
- fatherPid = arg.substring(13);
- } else if (arg.startsWith("--root_pid=")) {
- rootPid = arg.substring(11);
- } else if (arg.startsWith("--father_node=")) {
- fatherNode = arg.substring(14);
- } else if (arg.startsWith("--pid=")) {
- pid = arg.substring(6);
- } else if (arg.startsWith("--context_type")) {
- String keyValue = arg.substring(15);
- int index = -1;
- if (keyValue != null && (index = keyValue.indexOf('=')) > -1) {
- if (fatherPid == null) {
- context_param.setContextType(keyValue.substring(0, index),
- replaceEscapeChars(keyValue.substring(index + 1)));
- } else { // the subjob won't escape the especial chars
- context_param.setContextType(keyValue.substring(0, index),
- keyValue.substring(index + 1));
- }
- }
- } else if (arg.startsWith("--context_param")) {
- String keyValue = arg.substring(16);
- int index = -1;
- if (keyValue != null && (index = keyValue.indexOf('=')) > -1) {
- if (fatherPid == null) {
- context_param.put(keyValue.substring(0, index),
- replaceEscapeChars(keyValue.substring(index + 1)));
- } else { // the subjob won't escape the especial chars
- context_param.put(keyValue.substring(0, index),
- keyValue.substring(index + 1));
- }
- }
- } else if (arg.startsWith("--log4jLevel=")) {
- log4jLevel = arg.substring(13);
- }
- }
- private static final String NULL_VALUE_EXPRESSION_IN_COMMAND_STRING_FOR_CHILD_JOB_ONLY = "<TALEND_NULL>";
- private final String[][] escapeChars = { { "\\\\", "\\" }, { "\\n", "\n" },
- { "\\'", "\'" }, { "\\r", "\r" }, { "\\f", "\f" }, { "\\b", "\b" },
- { "\\t", "\t" } };
- private String replaceEscapeChars(String keyValue) {
- if (keyValue == null || ("").equals(keyValue.trim())) {
- return keyValue;
- }
- StringBuilder result = new StringBuilder();
- int currIndex = 0;
- while (currIndex < keyValue.length()) {
- int index = -1;
- // judege if the left string includes escape chars
- for (String[] strArray : escapeChars) {
- index = keyValue.indexOf(strArray[0], currIndex);
- if (index >= 0) {
- result.append(keyValue.substring(currIndex,
- index + strArray[0].length()).replace(strArray[0],
- strArray[1]));
- currIndex = index + strArray[0].length();
- break;
- }
- }
- // if the left string doesn't include escape chars, append the left
- // into the result
- if (index < 0) {
- result.append(keyValue.substring(currIndex));
- currIndex = currIndex + keyValue.length();
- }
- }
- return result.toString();
- }
- public Integer getErrorCode() {
- return errorCode;
- }
- public String getStatus() {
- return status;
- }
- ResumeUtil resumeUtil = null;
- }
- /************************************************************************************************
- * 305985 characters generated by Talend Open Studio for Data Integration on the
- * 2. ledna 2019 22:02:33 CET
- ************************************************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement