Advertisement
Guest User

Untitled

a guest
Jan 2nd, 2019
755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 272.12 KB | None | 0 0
  1. // ============================================================================
  2. //
  3. // Copyright (c) 2006-2015, Talend Inc.
  4. //
  5. // This source code has been automatically generated by_Talend Open Studio for Data Integration
  6. // / Licensed under the Apache License, Version 2.0 (the "License");
  7. // you may not use this file except in compliance with the License.
  8. // You may obtain a copy of the License at
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing, software
  12. // distributed under the License is distributed on an "AS IS" BASIS,
  13. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. // See the License for the specific language governing permissions and
  15. // limitations under the License.
  16.  
  17. package bi.fact_snimek_dochazky_0_1;
  18.  
  19. import routines.Numeric;
  20. import routines.DataOperation;
  21. import routines.TalendDataGenerator;
  22. import routines.TalendStringUtil;
  23. import routines.TalendString;
  24. import routines.StringHandling;
  25. import routines.Relational;
  26. import routines.TalendDate;
  27. import routines.Mathematical;
  28. import routines.system.*;
  29. import routines.system.api.*;
  30. import java.text.ParseException;
  31. import java.text.SimpleDateFormat;
  32. import java.util.Date;
  33. import java.util.List;
  34. import java.math.BigDecimal;
  35. import java.io.ByteArrayOutputStream;
  36. import java.io.ByteArrayInputStream;
  37. import java.io.DataInputStream;
  38. import java.io.DataOutputStream;
  39. import java.io.ObjectOutputStream;
  40. import java.io.ObjectInputStream;
  41. import java.io.IOException;
  42. import java.util.Comparator;
  43.  
  44. @SuppressWarnings("unused")
  45. /**
  46. * Job: FACT_snimek_dochazky Purpose: <br>
  47. * Description: <br>
  48. * @author user@talend.com
  49. * @version 7.1.1.20181026_1147
  50. * @status
  51. */
  52. public class FACT_snimek_dochazky implements TalendJob {
  53.  
  54. protected static void logIgnoredError(String message, Throwable cause) {
  55. System.err.println(message);
  56. if (cause != null) {
  57. cause.printStackTrace();
  58. }
  59.  
  60. }
  61.  
  62. public final Object obj = new Object();
  63.  
  64. // for transmiting parameters purpose
  65. private Object valueObject = null;
  66.  
  67. public Object getValueObject() {
  68. return this.valueObject;
  69. }
  70.  
  71. public void setValueObject(Object valueObject) {
  72. this.valueObject = valueObject;
  73. }
  74.  
  75. private final static String defaultCharset = java.nio.charset.Charset
  76. .defaultCharset().name();
  77.  
  78. private final static String utf8Charset = "UTF-8";
  79.  
  80. // contains type for every context property
  81. public class PropertiesWithType extends java.util.Properties {
  82. private static final long serialVersionUID = 1L;
  83. private java.util.Map<String, String> propertyTypes = new java.util.HashMap<>();
  84.  
  85. public PropertiesWithType(java.util.Properties properties) {
  86. super(properties);
  87. }
  88.  
  89. public PropertiesWithType() {
  90. super();
  91. }
  92.  
  93. public void setContextType(String key, String type) {
  94. propertyTypes.put(key, type);
  95. }
  96.  
  97. public String getContextType(String key) {
  98. return propertyTypes.get(key);
  99. }
  100. }
  101.  
  102. // create and load default properties
  103. private java.util.Properties defaultProps = new java.util.Properties();
  104.  
  105. // create application properties with default
  106. public class ContextProperties extends PropertiesWithType {
  107.  
  108. private static final long serialVersionUID = 1L;
  109.  
  110. public ContextProperties(java.util.Properties properties) {
  111. super(properties);
  112. }
  113.  
  114. public ContextProperties() {
  115. super();
  116. }
  117.  
  118. public void synchronizeContext() {
  119.  
  120. }
  121.  
  122. }
  123.  
  124. private ContextProperties context = new ContextProperties();
  125.  
  126. public ContextProperties getContext() {
  127. return this.context;
  128. }
  129.  
  130. private final String jobVersion = "0.1";
  131. private final String jobName = "FACT_snimek_dochazky";
  132. private final String projectName = "BI";
  133. public Integer errorCode = null;
  134. private String currentComponent = "";
  135.  
  136. private final java.util.Map<String, Object> globalMap = new java.util.HashMap<String, Object>();
  137. private final static java.util.Map<String, Object> junitGlobalMap = new java.util.HashMap<String, Object>();
  138.  
  139. private final java.util.Map<String, Long> start_Hash = new java.util.HashMap<String, Long>();
  140. private final java.util.Map<String, Long> end_Hash = new java.util.HashMap<String, Long>();
  141. private final java.util.Map<String, Boolean> ok_Hash = new java.util.HashMap<String, Boolean>();
  142. public final java.util.List<String[]> globalBuffer = new java.util.ArrayList<String[]>();
  143.  
  144. private RunStat runStat = new RunStat();
  145.  
  146. // OSGi DataSource
  147. private final static String KEY_DB_DATASOURCES = "KEY_DB_DATASOURCES";
  148.  
  149. private final static String KEY_DB_DATASOURCES_RAW = "KEY_DB_DATASOURCES_RAW";
  150.  
  151. public void setDataSources(
  152. java.util.Map<String, javax.sql.DataSource> dataSources) {
  153. java.util.Map<String, routines.system.TalendDataSource> talendDataSources = new java.util.HashMap<String, routines.system.TalendDataSource>();
  154. for (java.util.Map.Entry<String, javax.sql.DataSource> dataSourceEntry : dataSources
  155. .entrySet()) {
  156. talendDataSources.put(
  157. dataSourceEntry.getKey(),
  158. new routines.system.TalendDataSource(dataSourceEntry
  159. .getValue()));
  160. }
  161. globalMap.put(KEY_DB_DATASOURCES, talendDataSources);
  162. globalMap
  163. .put(KEY_DB_DATASOURCES_RAW,
  164. new java.util.HashMap<String, javax.sql.DataSource>(
  165. dataSources));
  166. }
  167.  
  168. private final java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
  169. private final java.io.PrintStream errorMessagePS = new java.io.PrintStream(
  170. new java.io.BufferedOutputStream(baos));
  171.  
  172. public String getExceptionStackTrace() {
  173. if ("failure".equals(this.getStatus())) {
  174. errorMessagePS.flush();
  175. return baos.toString();
  176. }
  177. return null;
  178. }
  179.  
  180. private Exception exception;
  181.  
  182. public Exception getException() {
  183. if ("failure".equals(this.getStatus())) {
  184. return this.exception;
  185. }
  186. return null;
  187. }
  188.  
  189. private class TalendException extends Exception {
  190.  
  191. private static final long serialVersionUID = 1L;
  192.  
  193. private java.util.Map<String, Object> globalMap = null;
  194. private Exception e = null;
  195. private String currentComponent = null;
  196. private String virtualComponentName = null;
  197.  
  198. public void setVirtualComponentName(String virtualComponentName) {
  199. this.virtualComponentName = virtualComponentName;
  200. }
  201.  
  202. private TalendException(Exception e, String errorComponent,
  203. final java.util.Map<String, Object> globalMap) {
  204. this.currentComponent = errorComponent;
  205. this.globalMap = globalMap;
  206. this.e = e;
  207. }
  208.  
  209. public Exception getException() {
  210. return this.e;
  211. }
  212.  
  213. public String getCurrentComponent() {
  214. return this.currentComponent;
  215. }
  216.  
  217. public String getExceptionCauseMessage(Exception e) {
  218. Throwable cause = e;
  219. String message = null;
  220. int i = 10;
  221. while (null != cause && 0 < i--) {
  222. message = cause.getMessage();
  223. if (null == message) {
  224. cause = cause.getCause();
  225. } else {
  226. break;
  227. }
  228. }
  229. if (null == message) {
  230. message = e.getClass().getName();
  231. }
  232. return message;
  233. }
  234.  
  235. @Override
  236. public void printStackTrace() {
  237. if (!(e instanceof TalendException || e instanceof TDieException)) {
  238. if (virtualComponentName != null
  239. && currentComponent.indexOf(virtualComponentName + "_") == 0) {
  240. globalMap.put(virtualComponentName + "_ERROR_MESSAGE",
  241. getExceptionCauseMessage(e));
  242. }
  243. globalMap.put(currentComponent + "_ERROR_MESSAGE",
  244. getExceptionCauseMessage(e));
  245. System.err.println("Exception in component " + currentComponent
  246. + " (" + jobName + ")");
  247. }
  248. if (!(e instanceof TDieException)) {
  249. if (e instanceof TalendException) {
  250. e.printStackTrace();
  251. } else {
  252. e.printStackTrace();
  253. e.printStackTrace(errorMessagePS);
  254. FACT_snimek_dochazky.this.exception = e;
  255. }
  256. }
  257. if (!(e instanceof TalendException)) {
  258. try {
  259. for (java.lang.reflect.Method m : this.getClass()
  260. .getEnclosingClass().getMethods()) {
  261. if (m.getName().compareTo(currentComponent + "_error") == 0) {
  262. m.invoke(FACT_snimek_dochazky.this, new Object[] {
  263. e, currentComponent, globalMap });
  264. break;
  265. }
  266. }
  267.  
  268. if (!(e instanceof TDieException)) {
  269. }
  270. } catch (Exception e) {
  271. this.e.printStackTrace();
  272. }
  273. }
  274. }
  275. }
  276.  
  277. public void tDBInput_1_error(Exception exception, String errorComponent,
  278. final java.util.Map<String, Object> globalMap)
  279. throws TalendException {
  280.  
  281. end_Hash.put(errorComponent, System.currentTimeMillis());
  282.  
  283. status = "failure";
  284.  
  285. tDBInput_1_onSubJobError(exception, errorComponent, globalMap);
  286. }
  287.  
  288. public void tMap_1_error(Exception exception, String errorComponent,
  289. final java.util.Map<String, Object> globalMap)
  290. throws TalendException {
  291.  
  292. end_Hash.put(errorComponent, System.currentTimeMillis());
  293.  
  294. status = "failure";
  295.  
  296. tDBInput_1_onSubJobError(exception, errorComponent, globalMap);
  297. }
  298.  
  299. public void tMap_2_error(Exception exception, String errorComponent,
  300. final java.util.Map<String, Object> globalMap)
  301. throws TalendException {
  302.  
  303. end_Hash.put(errorComponent, System.currentTimeMillis());
  304.  
  305. status = "failure";
  306.  
  307. tDBInput_6_onSubJobError(exception, errorComponent, globalMap);
  308. }
  309.  
  310. public void tDBOutput_1_error(Exception exception, String errorComponent,
  311. final java.util.Map<String, Object> globalMap)
  312. throws TalendException {
  313.  
  314. end_Hash.put(errorComponent, System.currentTimeMillis());
  315.  
  316. status = "failure";
  317.  
  318. tDBInput_6_onSubJobError(exception, errorComponent, globalMap);
  319. }
  320.  
  321. public void tDBInput_2_error(Exception exception, String errorComponent,
  322. final java.util.Map<String, Object> globalMap)
  323. throws TalendException {
  324.  
  325. end_Hash.put(errorComponent, System.currentTimeMillis());
  326.  
  327. status = "failure";
  328.  
  329. tDBInput_2_onSubJobError(exception, errorComponent, globalMap);
  330. }
  331.  
  332. public void tDBInput_3_error(Exception exception, String errorComponent,
  333. final java.util.Map<String, Object> globalMap)
  334. throws TalendException {
  335.  
  336. end_Hash.put(errorComponent, System.currentTimeMillis());
  337.  
  338. status = "failure";
  339.  
  340. tDBInput_3_onSubJobError(exception, errorComponent, globalMap);
  341. }
  342.  
  343. public void tDBInput_4_error(Exception exception, String errorComponent,
  344. final java.util.Map<String, Object> globalMap)
  345. throws TalendException {
  346.  
  347. end_Hash.put(errorComponent, System.currentTimeMillis());
  348.  
  349. status = "failure";
  350.  
  351. tDBInput_4_onSubJobError(exception, errorComponent, globalMap);
  352. }
  353.  
  354. public void tDBInput_5_error(Exception exception, String errorComponent,
  355. final java.util.Map<String, Object> globalMap)
  356. throws TalendException {
  357.  
  358. end_Hash.put(errorComponent, System.currentTimeMillis());
  359.  
  360. status = "failure";
  361.  
  362. tDBInput_5_onSubJobError(exception, errorComponent, globalMap);
  363. }
  364.  
  365. public void tDBInput_6_error(Exception exception, String errorComponent,
  366. final java.util.Map<String, Object> globalMap)
  367. throws TalendException {
  368.  
  369. end_Hash.put(errorComponent, System.currentTimeMillis());
  370.  
  371. status = "failure";
  372.  
  373. tDBInput_6_onSubJobError(exception, errorComponent, globalMap);
  374. }
  375.  
  376. public void tDBInput_7_error(Exception exception, String errorComponent,
  377. final java.util.Map<String, Object> globalMap)
  378. throws TalendException {
  379.  
  380. end_Hash.put(errorComponent, System.currentTimeMillis());
  381.  
  382. status = "failure";
  383.  
  384. tDBInput_7_onSubJobError(exception, errorComponent, globalMap);
  385. }
  386.  
  387. public void tDBInput_8_error(Exception exception, String errorComponent,
  388. final java.util.Map<String, Object> globalMap)
  389. throws TalendException {
  390.  
  391. end_Hash.put(errorComponent, System.currentTimeMillis());
  392.  
  393. status = "failure";
  394.  
  395. tDBInput_8_onSubJobError(exception, errorComponent, globalMap);
  396. }
  397.  
  398. public void tDBInput_9_error(Exception exception, String errorComponent,
  399. final java.util.Map<String, Object> globalMap)
  400. throws TalendException {
  401.  
  402. end_Hash.put(errorComponent, System.currentTimeMillis());
  403.  
  404. status = "failure";
  405.  
  406. tDBInput_9_onSubJobError(exception, errorComponent, globalMap);
  407. }
  408.  
  409. public void tDBInput_10_error(Exception exception, String errorComponent,
  410. final java.util.Map<String, Object> globalMap)
  411. throws TalendException {
  412.  
  413. end_Hash.put(errorComponent, System.currentTimeMillis());
  414.  
  415. status = "failure";
  416.  
  417. tDBInput_10_onSubJobError(exception, errorComponent, globalMap);
  418. }
  419.  
  420. public void tAdvancedHash_zamestnanec_error(Exception exception,
  421. String errorComponent, final java.util.Map<String, Object> globalMap)
  422. throws TalendException {
  423.  
  424. end_Hash.put(errorComponent, System.currentTimeMillis());
  425.  
  426. status = "failure";
  427.  
  428. tDBInput_1_onSubJobError(exception, errorComponent, globalMap);
  429. }
  430.  
  431. public void tAdvancedHash_row2_error(Exception exception,
  432. String errorComponent, final java.util.Map<String, Object> globalMap)
  433. throws TalendException {
  434.  
  435. end_Hash.put(errorComponent, System.currentTimeMillis());
  436.  
  437. status = "failure";
  438.  
  439. tDBInput_2_onSubJobError(exception, errorComponent, globalMap);
  440. }
  441.  
  442. public void tAdvancedHash_row11_error(Exception exception,
  443. String errorComponent, final java.util.Map<String, Object> globalMap)
  444. throws TalendException {
  445.  
  446. end_Hash.put(errorComponent, System.currentTimeMillis());
  447.  
  448. status = "failure";
  449.  
  450. tDBInput_3_onSubJobError(exception, errorComponent, globalMap);
  451. }
  452.  
  453. public void tAdvancedHash_row3_error(Exception exception,
  454. String errorComponent, final java.util.Map<String, Object> globalMap)
  455. throws TalendException {
  456.  
  457. end_Hash.put(errorComponent, System.currentTimeMillis());
  458.  
  459. status = "failure";
  460.  
  461. tDBInput_4_onSubJobError(exception, errorComponent, globalMap);
  462. }
  463.  
  464. public void tAdvancedHash_row5_error(Exception exception,
  465. String errorComponent, final java.util.Map<String, Object> globalMap)
  466. throws TalendException {
  467.  
  468. end_Hash.put(errorComponent, System.currentTimeMillis());
  469.  
  470. status = "failure";
  471.  
  472. tDBInput_5_onSubJobError(exception, errorComponent, globalMap);
  473. }
  474.  
  475. public void tAdvancedHash_row6_error(Exception exception,
  476. String errorComponent, final java.util.Map<String, Object> globalMap)
  477. throws TalendException {
  478.  
  479. end_Hash.put(errorComponent, System.currentTimeMillis());
  480.  
  481. status = "failure";
  482.  
  483. tDBInput_7_onSubJobError(exception, errorComponent, globalMap);
  484. }
  485.  
  486. public void tAdvancedHash_row7_error(Exception exception,
  487. String errorComponent, final java.util.Map<String, Object> globalMap)
  488. throws TalendException {
  489.  
  490. end_Hash.put(errorComponent, System.currentTimeMillis());
  491.  
  492. status = "failure";
  493.  
  494. tDBInput_8_onSubJobError(exception, errorComponent, globalMap);
  495. }
  496.  
  497. public void tAdvancedHash_row8_error(Exception exception,
  498. String errorComponent, final java.util.Map<String, Object> globalMap)
  499. throws TalendException {
  500.  
  501. end_Hash.put(errorComponent, System.currentTimeMillis());
  502.  
  503. status = "failure";
  504.  
  505. tDBInput_9_onSubJobError(exception, errorComponent, globalMap);
  506. }
  507.  
  508. public void tAdvancedHash_row9_error(Exception exception,
  509. String errorComponent, final java.util.Map<String, Object> globalMap)
  510. throws TalendException {
  511.  
  512. end_Hash.put(errorComponent, System.currentTimeMillis());
  513.  
  514. status = "failure";
  515.  
  516. tDBInput_10_onSubJobError(exception, errorComponent, globalMap);
  517. }
  518.  
  519. public void tAggregateRow_1_AGGOUT_error(Exception exception,
  520. String errorComponent, final java.util.Map<String, Object> globalMap)
  521. throws TalendException {
  522.  
  523. tAggregateRow_1_AGGIN_error(exception, errorComponent, globalMap);
  524.  
  525. }
  526.  
  527. public void tAggregateRow_1_AGGIN_error(Exception exception,
  528. String errorComponent, final java.util.Map<String, Object> globalMap)
  529. throws TalendException {
  530.  
  531. end_Hash.put(errorComponent, System.currentTimeMillis());
  532.  
  533. status = "failure";
  534.  
  535. tDBInput_6_onSubJobError(exception, errorComponent, globalMap);
  536. }
  537.  
  538. public void tDBInput_1_onSubJobError(Exception exception,
  539. String errorComponent, final java.util.Map<String, Object> globalMap)
  540. throws TalendException {
  541.  
  542. resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
  543. .currentThread().getId() + "", "FATAL", "",
  544. exception.getMessage(),
  545. ResumeUtil.getExceptionStackTrace(exception), "");
  546.  
  547. }
  548.  
  549. public void tDBInput_2_onSubJobError(Exception exception,
  550. String errorComponent, final java.util.Map<String, Object> globalMap)
  551. throws TalendException {
  552.  
  553. resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
  554. .currentThread().getId() + "", "FATAL", "",
  555. exception.getMessage(),
  556. ResumeUtil.getExceptionStackTrace(exception), "");
  557.  
  558. }
  559.  
  560. public void tDBInput_3_onSubJobError(Exception exception,
  561. String errorComponent, final java.util.Map<String, Object> globalMap)
  562. throws TalendException {
  563.  
  564. resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
  565. .currentThread().getId() + "", "FATAL", "",
  566. exception.getMessage(),
  567. ResumeUtil.getExceptionStackTrace(exception), "");
  568.  
  569. }
  570.  
  571. public void tDBInput_4_onSubJobError(Exception exception,
  572. String errorComponent, final java.util.Map<String, Object> globalMap)
  573. throws TalendException {
  574.  
  575. resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
  576. .currentThread().getId() + "", "FATAL", "",
  577. exception.getMessage(),
  578. ResumeUtil.getExceptionStackTrace(exception), "");
  579.  
  580. }
  581.  
  582. public void tDBInput_5_onSubJobError(Exception exception,
  583. String errorComponent, final java.util.Map<String, Object> globalMap)
  584. throws TalendException {
  585.  
  586. resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
  587. .currentThread().getId() + "", "FATAL", "",
  588. exception.getMessage(),
  589. ResumeUtil.getExceptionStackTrace(exception), "");
  590.  
  591. }
  592.  
  593. public void tDBInput_6_onSubJobError(Exception exception,
  594. String errorComponent, final java.util.Map<String, Object> globalMap)
  595. throws TalendException {
  596.  
  597. resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
  598. .currentThread().getId() + "", "FATAL", "",
  599. exception.getMessage(),
  600. ResumeUtil.getExceptionStackTrace(exception), "");
  601.  
  602. }
  603.  
  604. public void tDBInput_7_onSubJobError(Exception exception,
  605. String errorComponent, final java.util.Map<String, Object> globalMap)
  606. throws TalendException {
  607.  
  608. resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
  609. .currentThread().getId() + "", "FATAL", "",
  610. exception.getMessage(),
  611. ResumeUtil.getExceptionStackTrace(exception), "");
  612.  
  613. }
  614.  
  615. public void tDBInput_8_onSubJobError(Exception exception,
  616. String errorComponent, final java.util.Map<String, Object> globalMap)
  617. throws TalendException {
  618.  
  619. resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
  620. .currentThread().getId() + "", "FATAL", "",
  621. exception.getMessage(),
  622. ResumeUtil.getExceptionStackTrace(exception), "");
  623.  
  624. }
  625.  
  626. public void tDBInput_9_onSubJobError(Exception exception,
  627. String errorComponent, final java.util.Map<String, Object> globalMap)
  628. throws TalendException {
  629.  
  630. resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
  631. .currentThread().getId() + "", "FATAL", "",
  632. exception.getMessage(),
  633. ResumeUtil.getExceptionStackTrace(exception), "");
  634.  
  635. }
  636.  
  637. public void tDBInput_10_onSubJobError(Exception exception,
  638. String errorComponent, final java.util.Map<String, Object> globalMap)
  639. throws TalendException {
  640.  
  641. resumeUtil.addLog("SYSTEM_LOG", "NODE:" + errorComponent, "", Thread
  642. .currentThread().getId() + "", "FATAL", "",
  643. exception.getMessage(),
  644. ResumeUtil.getExceptionStackTrace(exception), "");
  645.  
  646. }
  647.  
  648. public static class zamestnanecStruct implements
  649. routines.system.IPersistableComparableLookupRow<zamestnanecStruct> {
  650. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  651. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  652. protected static final int DEFAULT_HASHCODE = 1;
  653. protected static final int PRIME = 31;
  654. protected int hashCode = DEFAULT_HASHCODE;
  655. public boolean hashCodeDirty = true;
  656.  
  657. public String loopKey;
  658.  
  659. public int idzamestnanci;
  660.  
  661. public int getIdzamestnanci() {
  662. return this.idzamestnanci;
  663. }
  664.  
  665. public int idpracoviste;
  666.  
  667. public int getIdpracoviste() {
  668. return this.idpracoviste;
  669. }
  670.  
  671. public int cislo_zamestnance;
  672.  
  673. public int getCislo_zamestnance() {
  674. return this.cislo_zamestnance;
  675. }
  676.  
  677. public Integer osobni_priplatek;
  678.  
  679. public Integer getOsobni_priplatek() {
  680. return this.osobni_priplatek;
  681. }
  682.  
  683. public int hodinova_sazba;
  684.  
  685. public int getHodinova_sazba() {
  686. return this.hodinova_sazba;
  687. }
  688.  
  689. public String nazev_profese;
  690.  
  691. public String getNazev_profese() {
  692. return this.nazev_profese;
  693. }
  694.  
  695. @Override
  696. public int hashCode() {
  697. if (this.hashCodeDirty) {
  698. final int prime = PRIME;
  699. int result = DEFAULT_HASHCODE;
  700.  
  701. result = prime * result + (int) this.cislo_zamestnance;
  702.  
  703. this.hashCode = result;
  704. this.hashCodeDirty = false;
  705. }
  706. return this.hashCode;
  707. }
  708.  
  709. @Override
  710. public boolean equals(Object obj) {
  711. if (this == obj)
  712. return true;
  713. if (obj == null)
  714. return false;
  715. if (getClass() != obj.getClass())
  716. return false;
  717. final zamestnanecStruct other = (zamestnanecStruct) obj;
  718.  
  719. if (this.cislo_zamestnance != other.cislo_zamestnance)
  720. return false;
  721.  
  722. return true;
  723. }
  724.  
  725. public void copyDataTo(zamestnanecStruct other) {
  726.  
  727. other.idzamestnanci = this.idzamestnanci;
  728. other.idpracoviste = this.idpracoviste;
  729. other.cislo_zamestnance = this.cislo_zamestnance;
  730. other.osobni_priplatek = this.osobni_priplatek;
  731. other.hodinova_sazba = this.hodinova_sazba;
  732. other.nazev_profese = this.nazev_profese;
  733.  
  734. }
  735.  
  736. public void copyKeysDataTo(zamestnanecStruct other) {
  737.  
  738. other.cislo_zamestnance = this.cislo_zamestnance;
  739.  
  740. }
  741.  
  742. private Integer readInteger(DataInputStream dis, ObjectInputStream ois)
  743. throws IOException {
  744. Integer intReturn;
  745. int length = 0;
  746. length = dis.readByte();
  747. if (length == -1) {
  748. intReturn = null;
  749. } else {
  750. intReturn = dis.readInt();
  751. }
  752. return intReturn;
  753. }
  754.  
  755. private void writeInteger(Integer intNum, DataOutputStream dos,
  756. ObjectOutputStream oos) throws IOException {
  757. if (intNum == null) {
  758. dos.writeByte(-1);
  759. } else {
  760. dos.writeByte(0);
  761. dos.writeInt(intNum);
  762. }
  763. }
  764.  
  765. private String readString(DataInputStream dis, ObjectInputStream ois)
  766. throws IOException {
  767. String strReturn = null;
  768. int length = 0;
  769. length = dis.readInt();
  770. if (length == -1) {
  771. strReturn = null;
  772. } else {
  773. byte[] byteArray = new byte[length];
  774. dis.read(byteArray);
  775. strReturn = new String(byteArray, utf8Charset);
  776. }
  777. return strReturn;
  778. }
  779.  
  780. private void writeString(String str, DataOutputStream dos,
  781. ObjectOutputStream oos) throws IOException {
  782. if (str == null) {
  783. dos.writeInt(-1);
  784. } else {
  785. byte[] byteArray = str.getBytes(utf8Charset);
  786. dos.writeInt(byteArray.length);
  787. dos.write(byteArray);
  788. }
  789. }
  790.  
  791. public void readKeysData(ObjectInputStream dis) {
  792.  
  793. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  794.  
  795. try {
  796.  
  797. int length = 0;
  798.  
  799. this.cislo_zamestnance = dis.readInt();
  800.  
  801. } catch (IOException e) {
  802. throw new RuntimeException(e);
  803.  
  804. }
  805.  
  806. }
  807.  
  808. }
  809.  
  810. public void writeKeysData(ObjectOutputStream dos) {
  811. try {
  812.  
  813. // int
  814.  
  815. dos.writeInt(this.cislo_zamestnance);
  816.  
  817. } catch (IOException e) {
  818. throw new RuntimeException(e);
  819. }
  820.  
  821. }
  822.  
  823. /**
  824. * Fill Values data by reading ObjectInputStream.
  825. */
  826. public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
  827. try {
  828.  
  829. int length = 0;
  830.  
  831. this.idzamestnanci = dis.readInt();
  832.  
  833. this.idpracoviste = dis.readInt();
  834.  
  835. this.osobni_priplatek = readInteger(dis, ois);
  836.  
  837. this.hodinova_sazba = dis.readInt();
  838.  
  839. this.nazev_profese = readString(dis, ois);
  840.  
  841. } catch (IOException e) {
  842. throw new RuntimeException(e);
  843.  
  844. }
  845.  
  846. }
  847.  
  848. /**
  849. * Return a byte array which represents Values data.
  850. */
  851. public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
  852. try {
  853.  
  854. dos.writeInt(this.idzamestnanci);
  855.  
  856. dos.writeInt(this.idpracoviste);
  857.  
  858. writeInteger(this.osobni_priplatek, dos, oos);
  859.  
  860. dos.writeInt(this.hodinova_sazba);
  861.  
  862. writeString(this.nazev_profese, dos, oos);
  863.  
  864. } catch (IOException e) {
  865. throw new RuntimeException(e);
  866. }
  867.  
  868. }
  869.  
  870. public String toString() {
  871.  
  872. StringBuilder sb = new StringBuilder();
  873. sb.append(super.toString());
  874. sb.append("[");
  875. sb.append("idzamestnanci=" + String.valueOf(idzamestnanci));
  876. sb.append(",idpracoviste=" + String.valueOf(idpracoviste));
  877. sb.append(",cislo_zamestnance=" + String.valueOf(cislo_zamestnance));
  878. sb.append(",osobni_priplatek=" + String.valueOf(osobni_priplatek));
  879. sb.append(",hodinova_sazba=" + String.valueOf(hodinova_sazba));
  880. sb.append(",nazev_profese=" + nazev_profese);
  881. sb.append("]");
  882.  
  883. return sb.toString();
  884. }
  885.  
  886. /**
  887. * Compare keys
  888. */
  889. public int compareTo(zamestnanecStruct other) {
  890.  
  891. int returnValue = -1;
  892.  
  893. returnValue = checkNullsAndCompare(this.cislo_zamestnance,
  894. other.cislo_zamestnance);
  895. if (returnValue != 0) {
  896. return returnValue;
  897. }
  898.  
  899. return returnValue;
  900. }
  901.  
  902. private int checkNullsAndCompare(Object object1, Object object2) {
  903. int returnValue = 0;
  904. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  905. returnValue = ((Comparable) object1).compareTo(object2);
  906. } else if (object1 != null && object2 != null) {
  907. returnValue = compareStrings(object1.toString(),
  908. object2.toString());
  909. } else if (object1 == null && object2 != null) {
  910. returnValue = 1;
  911. } else if (object1 != null && object2 == null) {
  912. returnValue = -1;
  913. } else {
  914. returnValue = 0;
  915. }
  916.  
  917. return returnValue;
  918. }
  919.  
  920. private int compareStrings(String string1, String string2) {
  921. return string1.compareTo(string2);
  922. }
  923.  
  924. }
  925.  
  926. public static class row1Struct implements
  927. routines.system.IPersistableRow<row1Struct> {
  928. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  929. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  930.  
  931. public int idzamestnanci;
  932.  
  933. public int getIdzamestnanci() {
  934. return this.idzamestnanci;
  935. }
  936.  
  937. public int cislo_zamestnance;
  938.  
  939. public int getCislo_zamestnance() {
  940. return this.cislo_zamestnance;
  941. }
  942.  
  943. public String zkratka;
  944.  
  945. public String getZkratka() {
  946. return this.zkratka;
  947. }
  948.  
  949. public String jmeno;
  950.  
  951. public String getJmeno() {
  952. return this.jmeno;
  953. }
  954.  
  955. public String prijmeni;
  956.  
  957. public String getPrijmeni() {
  958. return this.prijmeni;
  959. }
  960.  
  961. public String kontaktni_email;
  962.  
  963. public String getKontaktni_email() {
  964. return this.kontaktni_email;
  965. }
  966.  
  967. public String ulice;
  968.  
  969. public String getUlice() {
  970. return this.ulice;
  971. }
  972.  
  973. public String cp;
  974.  
  975. public String getCp() {
  976. return this.cp;
  977. }
  978.  
  979. public String psc;
  980.  
  981. public String getPsc() {
  982. return this.psc;
  983. }
  984.  
  985. public String mesto;
  986.  
  987. public String getMesto() {
  988. return this.mesto;
  989. }
  990.  
  991. private String readString(ObjectInputStream dis) throws IOException {
  992. String strReturn = null;
  993. int length = 0;
  994. length = dis.readInt();
  995. if (length == -1) {
  996. strReturn = null;
  997. } else {
  998. if (length > commonByteArray_BI_FACT_snimek_dochazky.length) {
  999. if (length < 1024
  1000. && commonByteArray_BI_FACT_snimek_dochazky.length == 0) {
  1001. commonByteArray_BI_FACT_snimek_dochazky = new byte[1024];
  1002. } else {
  1003. commonByteArray_BI_FACT_snimek_dochazky = new byte[2 * length];
  1004. }
  1005. }
  1006. dis.readFully(commonByteArray_BI_FACT_snimek_dochazky, 0,
  1007. length);
  1008. strReturn = new String(commonByteArray_BI_FACT_snimek_dochazky,
  1009. 0, length, utf8Charset);
  1010. }
  1011. return strReturn;
  1012. }
  1013.  
  1014. private void writeString(String str, ObjectOutputStream dos)
  1015. throws IOException {
  1016. if (str == null) {
  1017. dos.writeInt(-1);
  1018. } else {
  1019. byte[] byteArray = str.getBytes(utf8Charset);
  1020. dos.writeInt(byteArray.length);
  1021. dos.write(byteArray);
  1022. }
  1023. }
  1024.  
  1025. public void readData(ObjectInputStream dis) {
  1026.  
  1027. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  1028.  
  1029. try {
  1030.  
  1031. int length = 0;
  1032.  
  1033. this.idzamestnanci = dis.readInt();
  1034.  
  1035. this.cislo_zamestnance = dis.readInt();
  1036.  
  1037. this.zkratka = readString(dis);
  1038.  
  1039. this.jmeno = readString(dis);
  1040.  
  1041. this.prijmeni = readString(dis);
  1042.  
  1043. this.kontaktni_email = readString(dis);
  1044.  
  1045. this.ulice = readString(dis);
  1046.  
  1047. this.cp = readString(dis);
  1048.  
  1049. this.psc = readString(dis);
  1050.  
  1051. this.mesto = readString(dis);
  1052.  
  1053. } catch (IOException e) {
  1054. throw new RuntimeException(e);
  1055.  
  1056. }
  1057.  
  1058. }
  1059.  
  1060. }
  1061.  
  1062. public void writeData(ObjectOutputStream dos) {
  1063. try {
  1064.  
  1065. // int
  1066.  
  1067. dos.writeInt(this.idzamestnanci);
  1068.  
  1069. // int
  1070.  
  1071. dos.writeInt(this.cislo_zamestnance);
  1072.  
  1073. // String
  1074.  
  1075. writeString(this.zkratka, dos);
  1076.  
  1077. // String
  1078.  
  1079. writeString(this.jmeno, dos);
  1080.  
  1081. // String
  1082.  
  1083. writeString(this.prijmeni, dos);
  1084.  
  1085. // String
  1086.  
  1087. writeString(this.kontaktni_email, dos);
  1088.  
  1089. // String
  1090.  
  1091. writeString(this.ulice, dos);
  1092.  
  1093. // String
  1094.  
  1095. writeString(this.cp, dos);
  1096.  
  1097. // String
  1098.  
  1099. writeString(this.psc, dos);
  1100.  
  1101. // String
  1102.  
  1103. writeString(this.mesto, dos);
  1104.  
  1105. } catch (IOException e) {
  1106. throw new RuntimeException(e);
  1107. }
  1108.  
  1109. }
  1110.  
  1111. public String toString() {
  1112.  
  1113. StringBuilder sb = new StringBuilder();
  1114. sb.append(super.toString());
  1115. sb.append("[");
  1116. sb.append("idzamestnanci=" + String.valueOf(idzamestnanci));
  1117. sb.append(",cislo_zamestnance=" + String.valueOf(cislo_zamestnance));
  1118. sb.append(",zkratka=" + zkratka);
  1119. sb.append(",jmeno=" + jmeno);
  1120. sb.append(",prijmeni=" + prijmeni);
  1121. sb.append(",kontaktni_email=" + kontaktni_email);
  1122. sb.append(",ulice=" + ulice);
  1123. sb.append(",cp=" + cp);
  1124. sb.append(",psc=" + psc);
  1125. sb.append(",mesto=" + mesto);
  1126. sb.append("]");
  1127.  
  1128. return sb.toString();
  1129. }
  1130.  
  1131. /**
  1132. * Compare keys
  1133. */
  1134. public int compareTo(row1Struct other) {
  1135.  
  1136. int returnValue = -1;
  1137.  
  1138. return returnValue;
  1139. }
  1140.  
  1141. private int checkNullsAndCompare(Object object1, Object object2) {
  1142. int returnValue = 0;
  1143. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  1144. returnValue = ((Comparable) object1).compareTo(object2);
  1145. } else if (object1 != null && object2 != null) {
  1146. returnValue = compareStrings(object1.toString(),
  1147. object2.toString());
  1148. } else if (object1 == null && object2 != null) {
  1149. returnValue = 1;
  1150. } else if (object1 != null && object2 == null) {
  1151. returnValue = -1;
  1152. } else {
  1153. returnValue = 0;
  1154. }
  1155.  
  1156. return returnValue;
  1157. }
  1158.  
  1159. private int compareStrings(String string1, String string2) {
  1160. return string1.compareTo(string2);
  1161. }
  1162.  
  1163. }
  1164.  
  1165. public static class after_tDBInput_1Struct implements
  1166. routines.system.IPersistableRow<after_tDBInput_1Struct> {
  1167. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  1168. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  1169. protected static final int DEFAULT_HASHCODE = 1;
  1170. protected static final int PRIME = 31;
  1171. protected int hashCode = DEFAULT_HASHCODE;
  1172. public boolean hashCodeDirty = true;
  1173.  
  1174. public String loopKey;
  1175.  
  1176. public int idzamestnanci;
  1177.  
  1178. public int getIdzamestnanci() {
  1179. return this.idzamestnanci;
  1180. }
  1181.  
  1182. public int cislo_zamestnance;
  1183.  
  1184. public int getCislo_zamestnance() {
  1185. return this.cislo_zamestnance;
  1186. }
  1187.  
  1188. public String zkratka;
  1189.  
  1190. public String getZkratka() {
  1191. return this.zkratka;
  1192. }
  1193.  
  1194. public String jmeno;
  1195.  
  1196. public String getJmeno() {
  1197. return this.jmeno;
  1198. }
  1199.  
  1200. public String prijmeni;
  1201.  
  1202. public String getPrijmeni() {
  1203. return this.prijmeni;
  1204. }
  1205.  
  1206. public String kontaktni_email;
  1207.  
  1208. public String getKontaktni_email() {
  1209. return this.kontaktni_email;
  1210. }
  1211.  
  1212. public String ulice;
  1213.  
  1214. public String getUlice() {
  1215. return this.ulice;
  1216. }
  1217.  
  1218. public String cp;
  1219.  
  1220. public String getCp() {
  1221. return this.cp;
  1222. }
  1223.  
  1224. public String psc;
  1225.  
  1226. public String getPsc() {
  1227. return this.psc;
  1228. }
  1229.  
  1230. public String mesto;
  1231.  
  1232. public String getMesto() {
  1233. return this.mesto;
  1234. }
  1235.  
  1236. @Override
  1237. public int hashCode() {
  1238. if (this.hashCodeDirty) {
  1239. final int prime = PRIME;
  1240. int result = DEFAULT_HASHCODE;
  1241.  
  1242. result = prime * result + (int) this.idzamestnanci;
  1243.  
  1244. this.hashCode = result;
  1245. this.hashCodeDirty = false;
  1246. }
  1247. return this.hashCode;
  1248. }
  1249.  
  1250. @Override
  1251. public boolean equals(Object obj) {
  1252. if (this == obj)
  1253. return true;
  1254. if (obj == null)
  1255. return false;
  1256. if (getClass() != obj.getClass())
  1257. return false;
  1258. final after_tDBInput_1Struct other = (after_tDBInput_1Struct) obj;
  1259.  
  1260. if (this.idzamestnanci != other.idzamestnanci)
  1261. return false;
  1262.  
  1263. return true;
  1264. }
  1265.  
  1266. public void copyDataTo(after_tDBInput_1Struct other) {
  1267.  
  1268. other.idzamestnanci = this.idzamestnanci;
  1269. other.cislo_zamestnance = this.cislo_zamestnance;
  1270. other.zkratka = this.zkratka;
  1271. other.jmeno = this.jmeno;
  1272. other.prijmeni = this.prijmeni;
  1273. other.kontaktni_email = this.kontaktni_email;
  1274. other.ulice = this.ulice;
  1275. other.cp = this.cp;
  1276. other.psc = this.psc;
  1277. other.mesto = this.mesto;
  1278.  
  1279. }
  1280.  
  1281. public void copyKeysDataTo(after_tDBInput_1Struct other) {
  1282.  
  1283. other.idzamestnanci = this.idzamestnanci;
  1284.  
  1285. }
  1286.  
  1287. private String readString(ObjectInputStream dis) throws IOException {
  1288. String strReturn = null;
  1289. int length = 0;
  1290. length = dis.readInt();
  1291. if (length == -1) {
  1292. strReturn = null;
  1293. } else {
  1294. if (length > commonByteArray_BI_FACT_snimek_dochazky.length) {
  1295. if (length < 1024
  1296. && commonByteArray_BI_FACT_snimek_dochazky.length == 0) {
  1297. commonByteArray_BI_FACT_snimek_dochazky = new byte[1024];
  1298. } else {
  1299. commonByteArray_BI_FACT_snimek_dochazky = new byte[2 * length];
  1300. }
  1301. }
  1302. dis.readFully(commonByteArray_BI_FACT_snimek_dochazky, 0,
  1303. length);
  1304. strReturn = new String(commonByteArray_BI_FACT_snimek_dochazky,
  1305. 0, length, utf8Charset);
  1306. }
  1307. return strReturn;
  1308. }
  1309.  
  1310. private void writeString(String str, ObjectOutputStream dos)
  1311. throws IOException {
  1312. if (str == null) {
  1313. dos.writeInt(-1);
  1314. } else {
  1315. byte[] byteArray = str.getBytes(utf8Charset);
  1316. dos.writeInt(byteArray.length);
  1317. dos.write(byteArray);
  1318. }
  1319. }
  1320.  
  1321. public void readData(ObjectInputStream dis) {
  1322.  
  1323. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  1324.  
  1325. try {
  1326.  
  1327. int length = 0;
  1328.  
  1329. this.idzamestnanci = dis.readInt();
  1330.  
  1331. this.cislo_zamestnance = dis.readInt();
  1332.  
  1333. this.zkratka = readString(dis);
  1334.  
  1335. this.jmeno = readString(dis);
  1336.  
  1337. this.prijmeni = readString(dis);
  1338.  
  1339. this.kontaktni_email = readString(dis);
  1340.  
  1341. this.ulice = readString(dis);
  1342.  
  1343. this.cp = readString(dis);
  1344.  
  1345. this.psc = readString(dis);
  1346.  
  1347. this.mesto = readString(dis);
  1348.  
  1349. } catch (IOException e) {
  1350. throw new RuntimeException(e);
  1351.  
  1352. }
  1353.  
  1354. }
  1355.  
  1356. }
  1357.  
  1358. public void writeData(ObjectOutputStream dos) {
  1359. try {
  1360.  
  1361. // int
  1362.  
  1363. dos.writeInt(this.idzamestnanci);
  1364.  
  1365. // int
  1366.  
  1367. dos.writeInt(this.cislo_zamestnance);
  1368.  
  1369. // String
  1370.  
  1371. writeString(this.zkratka, dos);
  1372.  
  1373. // String
  1374.  
  1375. writeString(this.jmeno, dos);
  1376.  
  1377. // String
  1378.  
  1379. writeString(this.prijmeni, dos);
  1380.  
  1381. // String
  1382.  
  1383. writeString(this.kontaktni_email, dos);
  1384.  
  1385. // String
  1386.  
  1387. writeString(this.ulice, dos);
  1388.  
  1389. // String
  1390.  
  1391. writeString(this.cp, dos);
  1392.  
  1393. // String
  1394.  
  1395. writeString(this.psc, dos);
  1396.  
  1397. // String
  1398.  
  1399. writeString(this.mesto, dos);
  1400.  
  1401. } catch (IOException e) {
  1402. throw new RuntimeException(e);
  1403. }
  1404.  
  1405. }
  1406.  
  1407. public String toString() {
  1408.  
  1409. StringBuilder sb = new StringBuilder();
  1410. sb.append(super.toString());
  1411. sb.append("[");
  1412. sb.append("idzamestnanci=" + String.valueOf(idzamestnanci));
  1413. sb.append(",cislo_zamestnance=" + String.valueOf(cislo_zamestnance));
  1414. sb.append(",zkratka=" + zkratka);
  1415. sb.append(",jmeno=" + jmeno);
  1416. sb.append(",prijmeni=" + prijmeni);
  1417. sb.append(",kontaktni_email=" + kontaktni_email);
  1418. sb.append(",ulice=" + ulice);
  1419. sb.append(",cp=" + cp);
  1420. sb.append(",psc=" + psc);
  1421. sb.append(",mesto=" + mesto);
  1422. sb.append("]");
  1423.  
  1424. return sb.toString();
  1425. }
  1426.  
  1427. /**
  1428. * Compare keys
  1429. */
  1430. public int compareTo(after_tDBInput_1Struct other) {
  1431.  
  1432. int returnValue = -1;
  1433.  
  1434. returnValue = checkNullsAndCompare(this.idzamestnanci,
  1435. other.idzamestnanci);
  1436. if (returnValue != 0) {
  1437. return returnValue;
  1438. }
  1439.  
  1440. return returnValue;
  1441. }
  1442.  
  1443. private int checkNullsAndCompare(Object object1, Object object2) {
  1444. int returnValue = 0;
  1445. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  1446. returnValue = ((Comparable) object1).compareTo(object2);
  1447. } else if (object1 != null && object2 != null) {
  1448. returnValue = compareStrings(object1.toString(),
  1449. object2.toString());
  1450. } else if (object1 == null && object2 != null) {
  1451. returnValue = 1;
  1452. } else if (object1 != null && object2 == null) {
  1453. returnValue = -1;
  1454. } else {
  1455. returnValue = 0;
  1456. }
  1457.  
  1458. return returnValue;
  1459. }
  1460.  
  1461. private int compareStrings(String string1, String string2) {
  1462. return string1.compareTo(string2);
  1463. }
  1464.  
  1465. }
  1466.  
  1467. public void tDBInput_1Process(final java.util.Map<String, Object> globalMap)
  1468. throws TalendException {
  1469. globalMap.put("tDBInput_1_SUBPROCESS_STATE", 0);
  1470.  
  1471. final boolean execStat = this.execStat;
  1472.  
  1473. String iterateId = "";
  1474.  
  1475. String currentComponent = "";
  1476. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  1477.  
  1478. try {
  1479. // TDI-39566 avoid throwing an useless Exception
  1480. boolean resumeIt = true;
  1481. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  1482. String currentMethodName = new java.lang.Exception()
  1483. .getStackTrace()[0].getMethodName();
  1484. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  1485. }
  1486. if (resumeIt || globalResumeTicket) { // start the resume
  1487. globalResumeTicket = true;
  1488.  
  1489. tDBInput_2Process(globalMap);
  1490. tDBInput_4Process(globalMap);
  1491.  
  1492. row1Struct row1 = new row1Struct();
  1493. zamestnanecStruct zamestnanec = new zamestnanecStruct();
  1494.  
  1495. /**
  1496. * [tAdvancedHash_zamestnanec begin ] start
  1497. */
  1498.  
  1499. ok_Hash.put("tAdvancedHash_zamestnanec", false);
  1500. start_Hash.put("tAdvancedHash_zamestnanec",
  1501. System.currentTimeMillis());
  1502.  
  1503. currentComponent = "tAdvancedHash_zamestnanec";
  1504.  
  1505. if (execStat) {
  1506. if (resourceMap.get("inIterateVComp") == null) {
  1507.  
  1508. runStat.updateStatOnConnection("zamestnanec"
  1509. + iterateId, 0, 0);
  1510.  
  1511. }
  1512. }
  1513.  
  1514. int tos_count_tAdvancedHash_zamestnanec = 0;
  1515.  
  1516. // connection name:zamestnanec
  1517. // source node:tMap_1 - inputs:(row1,row2,row3)
  1518. // outputs:(zamestnanec,zamestnanec) | target
  1519. // node:tAdvancedHash_zamestnanec - inputs:(zamestnanec)
  1520. // outputs:()
  1521. // linked node: tMap_2 -
  1522. // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
  1523. // outputs:(out2)
  1524.  
  1525. org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_zamestnanec = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
  1526.  
  1527. org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<zamestnanecStruct> tHash_Lookup_zamestnanec = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
  1528. .<zamestnanecStruct> getLookup(matchingModeEnum_zamestnanec);
  1529.  
  1530. globalMap.put("tHash_Lookup_zamestnanec",
  1531. tHash_Lookup_zamestnanec);
  1532.  
  1533. /**
  1534. * [tAdvancedHash_zamestnanec begin ] stop
  1535. */
  1536.  
  1537. /**
  1538. * [tMap_1 begin ] start
  1539. */
  1540.  
  1541. ok_Hash.put("tMap_1", false);
  1542. start_Hash.put("tMap_1", System.currentTimeMillis());
  1543.  
  1544. currentComponent = "tMap_1";
  1545.  
  1546. if (execStat) {
  1547. if (resourceMap.get("inIterateVComp") == null) {
  1548.  
  1549. runStat.updateStatOnConnection("row1" + iterateId, 0, 0);
  1550.  
  1551. }
  1552. }
  1553.  
  1554. int tos_count_tMap_1 = 0;
  1555.  
  1556. // ###############################
  1557. // # Lookup's keys initialization
  1558.  
  1559. 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
  1560. .get("tHash_Lookup_row2"));
  1561.  
  1562. row2Struct row2HashKey = new row2Struct();
  1563. row2Struct row2Default = new row2Struct();
  1564.  
  1565. 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
  1566. .get("tHash_Lookup_row3"));
  1567.  
  1568. row3Struct row3HashKey = new row3Struct();
  1569. row3Struct row3Default = new row3Struct();
  1570. // ###############################
  1571.  
  1572. // ###############################
  1573. // # Vars initialization
  1574. class Var__tMap_1__Struct {
  1575. }
  1576. Var__tMap_1__Struct Var__tMap_1 = new Var__tMap_1__Struct();
  1577. // ###############################
  1578.  
  1579. // ###############################
  1580. // # Outputs initialization
  1581. zamestnanecStruct zamestnanec_tmp = new zamestnanecStruct();
  1582. // ###############################
  1583.  
  1584. /**
  1585. * [tMap_1 begin ] stop
  1586. */
  1587.  
  1588. /**
  1589. * [tDBInput_1 begin ] start
  1590. */
  1591.  
  1592. ok_Hash.put("tDBInput_1", false);
  1593. start_Hash.put("tDBInput_1", System.currentTimeMillis());
  1594.  
  1595. currentComponent = "tDBInput_1";
  1596.  
  1597. int tos_count_tDBInput_1 = 0;
  1598.  
  1599. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_1 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  1600. .getMSSqlGenerateTimestampUtil();
  1601.  
  1602. java.util.List<String> talendToDBList_tDBInput_1 = new java.util.ArrayList();
  1603. String[] talendToDBArray_tDBInput_1 = new String[] { "FLOAT",
  1604. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  1605. "DECIMAL IDENTITY", "REAL" };
  1606. java.util.Collections.addAll(talendToDBList_tDBInput_1,
  1607. talendToDBArray_tDBInput_1);
  1608. int nb_line_tDBInput_1 = 0;
  1609. java.sql.Connection conn_tDBInput_1 = null;
  1610. String driverClass_tDBInput_1 = "net.sourceforge.jtds.jdbc.Driver";
  1611. java.lang.Class.forName(driverClass_tDBInput_1);
  1612. String dbUser_tDBInput_1 = "tym1";
  1613.  
  1614. final String decryptedPassword_tDBInput_1 = routines.system.PasswordEncryptUtil
  1615. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  1616.  
  1617. String dbPwd_tDBInput_1 = decryptedPassword_tDBInput_1;
  1618.  
  1619. String port_tDBInput_1 = "1433";
  1620. String dbname_tDBInput_1 = "tym1";
  1621. String url_tDBInput_1 = "jdbc:jtds:sqlserver://"
  1622. + "158.196.160.60";
  1623. if (!"".equals(port_tDBInput_1)) {
  1624. url_tDBInput_1 += ":" + "1433";
  1625. }
  1626. if (!"".equals(dbname_tDBInput_1)) {
  1627. url_tDBInput_1 += "//" + "tym1";
  1628. }
  1629. url_tDBInput_1 += ";appName=" + projectName + ";" + "";
  1630. String dbschema_tDBInput_1 = "";
  1631.  
  1632. conn_tDBInput_1 = java.sql.DriverManager.getConnection(
  1633. url_tDBInput_1, dbUser_tDBInput_1, dbPwd_tDBInput_1);
  1634.  
  1635. java.sql.Statement stmt_tDBInput_1 = conn_tDBInput_1
  1636. .createStatement();
  1637.  
  1638. String dbquery_tDBInput_1 = "SELECT DIM_zamestnanci.idzamestnanci,\n DIM_zamestnanci.cislo_zamestnance,\n DIM_zamestnanci.zkratka,\n DIM_zamestnanci"
  1639. + ".jmeno,\n DIM_zamestnanci.prijmeni,\n DIM_zamestnanci.kontaktni_email,\n DIM_zamestnanci.ulice,\n DIM_zamestnanci.cp,\n "
  1640. + "DIM_zamestnanci.psc,\n DIM_zamestnanci.mesto\nFROM DIM_zamestnanci";
  1641.  
  1642. globalMap.put("tDBInput_1_QUERY", dbquery_tDBInput_1);
  1643. java.sql.ResultSet rs_tDBInput_1 = null;
  1644.  
  1645. try {
  1646. rs_tDBInput_1 = stmt_tDBInput_1
  1647. .executeQuery(dbquery_tDBInput_1);
  1648. java.sql.ResultSetMetaData rsmd_tDBInput_1 = rs_tDBInput_1
  1649. .getMetaData();
  1650. int colQtyInRs_tDBInput_1 = rsmd_tDBInput_1
  1651. .getColumnCount();
  1652.  
  1653. String tmpContent_tDBInput_1 = null;
  1654.  
  1655. while (rs_tDBInput_1.next()) {
  1656. nb_line_tDBInput_1++;
  1657.  
  1658. if (colQtyInRs_tDBInput_1 < 1) {
  1659. row1.idzamestnanci = 0;
  1660. } else {
  1661.  
  1662. if (rs_tDBInput_1.getObject(1) != null) {
  1663. row1.idzamestnanci = rs_tDBInput_1.getInt(1);
  1664. } else {
  1665. throw new RuntimeException(
  1666. "Null value in non-Nullable column");
  1667. }
  1668. }
  1669. if (colQtyInRs_tDBInput_1 < 2) {
  1670. row1.cislo_zamestnance = 0;
  1671. } else {
  1672.  
  1673. if (rs_tDBInput_1.getObject(2) != null) {
  1674. row1.cislo_zamestnance = rs_tDBInput_1
  1675. .getInt(2);
  1676. } else {
  1677. throw new RuntimeException(
  1678. "Null value in non-Nullable column");
  1679. }
  1680. }
  1681. if (colQtyInRs_tDBInput_1 < 3) {
  1682. row1.zkratka = null;
  1683. } else {
  1684.  
  1685. tmpContent_tDBInput_1 = rs_tDBInput_1.getString(3);
  1686. if (tmpContent_tDBInput_1 != null) {
  1687. if (talendToDBList_tDBInput_1
  1688. .contains(rsmd_tDBInput_1
  1689. .getColumnTypeName(3)
  1690. .toUpperCase(
  1691. java.util.Locale.ENGLISH))) {
  1692. row1.zkratka = FormatterUtils
  1693. .formatUnwithE(tmpContent_tDBInput_1);
  1694. } else {
  1695. row1.zkratka = tmpContent_tDBInput_1;
  1696. }
  1697. } else {
  1698. row1.zkratka = null;
  1699. }
  1700. }
  1701. if (colQtyInRs_tDBInput_1 < 4) {
  1702. row1.jmeno = null;
  1703. } else {
  1704.  
  1705. tmpContent_tDBInput_1 = rs_tDBInput_1.getString(4);
  1706. if (tmpContent_tDBInput_1 != null) {
  1707. if (talendToDBList_tDBInput_1
  1708. .contains(rsmd_tDBInput_1
  1709. .getColumnTypeName(4)
  1710. .toUpperCase(
  1711. java.util.Locale.ENGLISH))) {
  1712. row1.jmeno = FormatterUtils
  1713. .formatUnwithE(tmpContent_tDBInput_1);
  1714. } else {
  1715. row1.jmeno = tmpContent_tDBInput_1;
  1716. }
  1717. } else {
  1718. row1.jmeno = null;
  1719. }
  1720. }
  1721. if (colQtyInRs_tDBInput_1 < 5) {
  1722. row1.prijmeni = null;
  1723. } else {
  1724.  
  1725. tmpContent_tDBInput_1 = rs_tDBInput_1.getString(5);
  1726. if (tmpContent_tDBInput_1 != null) {
  1727. if (talendToDBList_tDBInput_1
  1728. .contains(rsmd_tDBInput_1
  1729. .getColumnTypeName(5)
  1730. .toUpperCase(
  1731. java.util.Locale.ENGLISH))) {
  1732. row1.prijmeni = FormatterUtils
  1733. .formatUnwithE(tmpContent_tDBInput_1);
  1734. } else {
  1735. row1.prijmeni = tmpContent_tDBInput_1;
  1736. }
  1737. } else {
  1738. row1.prijmeni = null;
  1739. }
  1740. }
  1741. if (colQtyInRs_tDBInput_1 < 6) {
  1742. row1.kontaktni_email = null;
  1743. } else {
  1744.  
  1745. tmpContent_tDBInput_1 = rs_tDBInput_1.getString(6);
  1746. if (tmpContent_tDBInput_1 != null) {
  1747. if (talendToDBList_tDBInput_1
  1748. .contains(rsmd_tDBInput_1
  1749. .getColumnTypeName(6)
  1750. .toUpperCase(
  1751. java.util.Locale.ENGLISH))) {
  1752. row1.kontaktni_email = FormatterUtils
  1753. .formatUnwithE(tmpContent_tDBInput_1);
  1754. } else {
  1755. row1.kontaktni_email = tmpContent_tDBInput_1;
  1756. }
  1757. } else {
  1758. row1.kontaktni_email = null;
  1759. }
  1760. }
  1761. if (colQtyInRs_tDBInput_1 < 7) {
  1762. row1.ulice = null;
  1763. } else {
  1764.  
  1765. tmpContent_tDBInput_1 = rs_tDBInput_1.getString(7);
  1766. if (tmpContent_tDBInput_1 != null) {
  1767. if (talendToDBList_tDBInput_1
  1768. .contains(rsmd_tDBInput_1
  1769. .getColumnTypeName(7)
  1770. .toUpperCase(
  1771. java.util.Locale.ENGLISH))) {
  1772. row1.ulice = FormatterUtils
  1773. .formatUnwithE(tmpContent_tDBInput_1);
  1774. } else {
  1775. row1.ulice = tmpContent_tDBInput_1;
  1776. }
  1777. } else {
  1778. row1.ulice = null;
  1779. }
  1780. }
  1781. if (colQtyInRs_tDBInput_1 < 8) {
  1782. row1.cp = null;
  1783. } else {
  1784.  
  1785. tmpContent_tDBInput_1 = rs_tDBInput_1.getString(8);
  1786. if (tmpContent_tDBInput_1 != null) {
  1787. if (talendToDBList_tDBInput_1
  1788. .contains(rsmd_tDBInput_1
  1789. .getColumnTypeName(8)
  1790. .toUpperCase(
  1791. java.util.Locale.ENGLISH))) {
  1792. row1.cp = FormatterUtils
  1793. .formatUnwithE(tmpContent_tDBInput_1);
  1794. } else {
  1795. row1.cp = tmpContent_tDBInput_1;
  1796. }
  1797. } else {
  1798. row1.cp = null;
  1799. }
  1800. }
  1801. if (colQtyInRs_tDBInput_1 < 9) {
  1802. row1.psc = null;
  1803. } else {
  1804.  
  1805. tmpContent_tDBInput_1 = rs_tDBInput_1.getString(9);
  1806. if (tmpContent_tDBInput_1 != null) {
  1807. if (talendToDBList_tDBInput_1
  1808. .contains(rsmd_tDBInput_1
  1809. .getColumnTypeName(9)
  1810. .toUpperCase(
  1811. java.util.Locale.ENGLISH))) {
  1812. row1.psc = FormatterUtils
  1813. .formatUnwithE(tmpContent_tDBInput_1);
  1814. } else {
  1815. row1.psc = tmpContent_tDBInput_1;
  1816. }
  1817. } else {
  1818. row1.psc = null;
  1819. }
  1820. }
  1821. if (colQtyInRs_tDBInput_1 < 10) {
  1822. row1.mesto = null;
  1823. } else {
  1824.  
  1825. tmpContent_tDBInput_1 = rs_tDBInput_1.getString(10);
  1826. if (tmpContent_tDBInput_1 != null) {
  1827. if (talendToDBList_tDBInput_1
  1828. .contains(rsmd_tDBInput_1
  1829. .getColumnTypeName(10)
  1830. .toUpperCase(
  1831. java.util.Locale.ENGLISH))) {
  1832. row1.mesto = FormatterUtils
  1833. .formatUnwithE(tmpContent_tDBInput_1);
  1834. } else {
  1835. row1.mesto = tmpContent_tDBInput_1;
  1836. }
  1837. } else {
  1838. row1.mesto = null;
  1839. }
  1840. }
  1841.  
  1842. /**
  1843. * [tDBInput_1 begin ] stop
  1844. */
  1845.  
  1846. /**
  1847. * [tDBInput_1 main ] start
  1848. */
  1849.  
  1850. currentComponent = "tDBInput_1";
  1851.  
  1852. tos_count_tDBInput_1++;
  1853.  
  1854. /**
  1855. * [tDBInput_1 main ] stop
  1856. */
  1857.  
  1858. /**
  1859. * [tDBInput_1 process_data_begin ] start
  1860. */
  1861.  
  1862. currentComponent = "tDBInput_1";
  1863.  
  1864. /**
  1865. * [tDBInput_1 process_data_begin ] stop
  1866. */
  1867.  
  1868. /**
  1869. * [tMap_1 main ] start
  1870. */
  1871.  
  1872. currentComponent = "tMap_1";
  1873.  
  1874. // row1
  1875. // row1
  1876.  
  1877. if (execStat) {
  1878. runStat.updateStatOnConnection("row1" + iterateId,
  1879. 1, 1);
  1880. }
  1881.  
  1882. boolean hasCasePrimitiveKeyWithNull_tMap_1 = false;
  1883.  
  1884. // ###############################
  1885. // # Input tables (lookups)
  1886. boolean rejectedInnerJoin_tMap_1 = false;
  1887. boolean mainRowRejected_tMap_1 = false;
  1888.  
  1889. // /////////////////////////////////////////////
  1890. // Starting Lookup Table "row2"
  1891. // /////////////////////////////////////////////
  1892.  
  1893. boolean forceLooprow2 = false;
  1894.  
  1895. row2Struct row2ObjectFromLookup = null;
  1896.  
  1897. if (!rejectedInnerJoin_tMap_1) { // G_TM_M_020
  1898.  
  1899. hasCasePrimitiveKeyWithNull_tMap_1 = false;
  1900.  
  1901. Object exprKeyValue_row2__idzamestnanci = row1.cislo_zamestnance;
  1902. if (exprKeyValue_row2__idzamestnanci == null) {
  1903. hasCasePrimitiveKeyWithNull_tMap_1 = true;
  1904. } else {
  1905. row2HashKey.idzamestnanci = (int) (Integer) exprKeyValue_row2__idzamestnanci;
  1906. }
  1907.  
  1908. row2HashKey.hashCodeDirty = true;
  1909.  
  1910. if (!hasCasePrimitiveKeyWithNull_tMap_1) { // G_TM_M_091
  1911.  
  1912. tHash_Lookup_row2.lookup(row2HashKey);
  1913.  
  1914. } // G_TM_M_091
  1915.  
  1916. if (hasCasePrimitiveKeyWithNull_tMap_1
  1917. || !tHash_Lookup_row2.hasNext()) { // G_TM_M_090
  1918.  
  1919. rejectedInnerJoin_tMap_1 = true;
  1920.  
  1921. } // G_TM_M_090
  1922.  
  1923. } // G_TM_M_020
  1924.  
  1925. if (tHash_Lookup_row2 != null
  1926. && tHash_Lookup_row2.getCount(row2HashKey) > 1) { // G
  1927. // 071
  1928.  
  1929. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row2' and it contains more one result from keys : row2.idzamestnanci = '"
  1930. // + row2HashKey.idzamestnanci + "'");
  1931. } // G 071
  1932.  
  1933. row2Struct row2 = null;
  1934.  
  1935. row2Struct fromLookup_row2 = null;
  1936. row2 = row2Default;
  1937.  
  1938. if (tHash_Lookup_row2 != null
  1939. && tHash_Lookup_row2.hasNext()) { // G 099
  1940.  
  1941. fromLookup_row2 = tHash_Lookup_row2.next();
  1942.  
  1943. } // G 099
  1944.  
  1945. if (fromLookup_row2 != null) {
  1946. row2 = fromLookup_row2;
  1947. }
  1948.  
  1949. // /////////////////////////////////////////////
  1950. // Starting Lookup Table "row3"
  1951. // /////////////////////////////////////////////
  1952.  
  1953. boolean forceLooprow3 = false;
  1954.  
  1955. row3Struct row3ObjectFromLookup = null;
  1956.  
  1957. if (!rejectedInnerJoin_tMap_1) { // G_TM_M_020
  1958.  
  1959. hasCasePrimitiveKeyWithNull_tMap_1 = false;
  1960.  
  1961. Object exprKeyValue_row3__idsazby = row2.idsazby;
  1962. if (exprKeyValue_row3__idsazby == null) {
  1963. hasCasePrimitiveKeyWithNull_tMap_1 = true;
  1964. } else {
  1965. row3HashKey.idsazby = (int) (Integer) exprKeyValue_row3__idsazby;
  1966. }
  1967.  
  1968. row3HashKey.hashCodeDirty = true;
  1969.  
  1970. if (!hasCasePrimitiveKeyWithNull_tMap_1) { // G_TM_M_091
  1971.  
  1972. tHash_Lookup_row3.lookup(row3HashKey);
  1973.  
  1974. } // G_TM_M_091
  1975.  
  1976. if (hasCasePrimitiveKeyWithNull_tMap_1
  1977. || !tHash_Lookup_row3.hasNext()) { // G_TM_M_090
  1978.  
  1979. rejectedInnerJoin_tMap_1 = true;
  1980.  
  1981. } // G_TM_M_090
  1982.  
  1983. } // G_TM_M_020
  1984.  
  1985. if (tHash_Lookup_row3 != null
  1986. && tHash_Lookup_row3.getCount(row3HashKey) > 1) { // G
  1987. // 071
  1988.  
  1989. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row3' and it contains more one result from keys : row3.idsazby = '"
  1990. // + row3HashKey.idsazby + "'");
  1991. } // G 071
  1992.  
  1993. row3Struct row3 = null;
  1994.  
  1995. row3Struct fromLookup_row3 = null;
  1996. row3 = row3Default;
  1997.  
  1998. if (tHash_Lookup_row3 != null
  1999. && tHash_Lookup_row3.hasNext()) { // G 099
  2000.  
  2001. fromLookup_row3 = tHash_Lookup_row3.next();
  2002.  
  2003. } // G 099
  2004.  
  2005. if (fromLookup_row3 != null) {
  2006. row3 = fromLookup_row3;
  2007. }
  2008.  
  2009. // ###############################
  2010. { // start of Var scope
  2011.  
  2012. // ###############################
  2013. // # Vars tables
  2014.  
  2015. Var__tMap_1__Struct Var = Var__tMap_1;// ###############################
  2016. // ###############################
  2017. // # Output tables
  2018.  
  2019. zamestnanec = null;
  2020.  
  2021. if (!rejectedInnerJoin_tMap_1) {
  2022.  
  2023. // # Output table : 'zamestnanec'
  2024. zamestnanec_tmp.idzamestnanci = row1.idzamestnanci;
  2025. zamestnanec_tmp.idpracoviste = row2.idpracoviste;
  2026. zamestnanec_tmp.cislo_zamestnance = row1.cislo_zamestnance;
  2027. zamestnanec_tmp.osobni_priplatek = row2.osobni_priplatek;
  2028. zamestnanec_tmp.hodinova_sazba = row3.hodinova_sazba;
  2029. zamestnanec_tmp.nazev_profese = row3.nazev_profese;
  2030. zamestnanec = zamestnanec_tmp;
  2031. } // closing inner join bracket (2)
  2032. // ###############################
  2033.  
  2034. } // end of Var scope
  2035.  
  2036. rejectedInnerJoin_tMap_1 = false;
  2037.  
  2038. tos_count_tMap_1++;
  2039.  
  2040. /**
  2041. * [tMap_1 main ] stop
  2042. */
  2043.  
  2044. /**
  2045. * [tMap_1 process_data_begin ] start
  2046. */
  2047.  
  2048. currentComponent = "tMap_1";
  2049.  
  2050. /**
  2051. * [tMap_1 process_data_begin ] stop
  2052. */
  2053. // Start of branch "zamestnanec"
  2054. if (zamestnanec != null) {
  2055.  
  2056. /**
  2057. * [tAdvancedHash_zamestnanec main ] start
  2058. */
  2059.  
  2060. currentComponent = "tAdvancedHash_zamestnanec";
  2061.  
  2062. // zamestnanec
  2063. // zamestnanec
  2064.  
  2065. if (execStat) {
  2066. runStat.updateStatOnConnection("zamestnanec"
  2067. + iterateId, 1, 1);
  2068. }
  2069.  
  2070. zamestnanecStruct zamestnanec_HashRow = new zamestnanecStruct();
  2071.  
  2072. zamestnanec_HashRow.idzamestnanci = zamestnanec.idzamestnanci;
  2073.  
  2074. zamestnanec_HashRow.idpracoviste = zamestnanec.idpracoviste;
  2075.  
  2076. zamestnanec_HashRow.cislo_zamestnance = zamestnanec.cislo_zamestnance;
  2077.  
  2078. zamestnanec_HashRow.osobni_priplatek = zamestnanec.osobni_priplatek;
  2079.  
  2080. zamestnanec_HashRow.hodinova_sazba = zamestnanec.hodinova_sazba;
  2081.  
  2082. zamestnanec_HashRow.nazev_profese = zamestnanec.nazev_profese;
  2083.  
  2084. tHash_Lookup_zamestnanec.put(zamestnanec_HashRow);
  2085.  
  2086. tos_count_tAdvancedHash_zamestnanec++;
  2087.  
  2088. /**
  2089. * [tAdvancedHash_zamestnanec main ] stop
  2090. */
  2091.  
  2092. /**
  2093. * [tAdvancedHash_zamestnanec process_data_begin ]
  2094. * start
  2095. */
  2096.  
  2097. currentComponent = "tAdvancedHash_zamestnanec";
  2098.  
  2099. /**
  2100. * [tAdvancedHash_zamestnanec process_data_begin ]
  2101. * stop
  2102. */
  2103.  
  2104. /**
  2105. * [tAdvancedHash_zamestnanec process_data_end ]
  2106. * start
  2107. */
  2108.  
  2109. currentComponent = "tAdvancedHash_zamestnanec";
  2110.  
  2111. /**
  2112. * [tAdvancedHash_zamestnanec process_data_end ]
  2113. * stop
  2114. */
  2115.  
  2116. } // End of branch "zamestnanec"
  2117.  
  2118. /**
  2119. * [tMap_1 process_data_end ] start
  2120. */
  2121.  
  2122. currentComponent = "tMap_1";
  2123.  
  2124. /**
  2125. * [tMap_1 process_data_end ] stop
  2126. */
  2127.  
  2128. /**
  2129. * [tDBInput_1 process_data_end ] start
  2130. */
  2131.  
  2132. currentComponent = "tDBInput_1";
  2133.  
  2134. /**
  2135. * [tDBInput_1 process_data_end ] stop
  2136. */
  2137.  
  2138. /**
  2139. * [tDBInput_1 end ] start
  2140. */
  2141.  
  2142. currentComponent = "tDBInput_1";
  2143.  
  2144. }
  2145. } finally {
  2146. if (rs_tDBInput_1 != null) {
  2147. rs_tDBInput_1.close();
  2148. }
  2149. if (stmt_tDBInput_1 != null) {
  2150. stmt_tDBInput_1.close();
  2151. }
  2152. if (conn_tDBInput_1 != null && !conn_tDBInput_1.isClosed()) {
  2153.  
  2154. conn_tDBInput_1.close();
  2155.  
  2156. }
  2157. }
  2158. globalMap.put("tDBInput_1_NB_LINE", nb_line_tDBInput_1);
  2159.  
  2160. ok_Hash.put("tDBInput_1", true);
  2161. end_Hash.put("tDBInput_1", System.currentTimeMillis());
  2162.  
  2163. /**
  2164. * [tDBInput_1 end ] stop
  2165. */
  2166.  
  2167. /**
  2168. * [tMap_1 end ] start
  2169. */
  2170.  
  2171. currentComponent = "tMap_1";
  2172.  
  2173. // ###############################
  2174. // # Lookup hashes releasing
  2175. if (tHash_Lookup_row2 != null) {
  2176. tHash_Lookup_row2.endGet();
  2177. }
  2178. globalMap.remove("tHash_Lookup_row2");
  2179.  
  2180. if (tHash_Lookup_row3 != null) {
  2181. tHash_Lookup_row3.endGet();
  2182. }
  2183. globalMap.remove("tHash_Lookup_row3");
  2184.  
  2185. // ###############################
  2186.  
  2187. if (execStat) {
  2188. if (resourceMap.get("inIterateVComp") == null
  2189. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  2190. runStat.updateStatOnConnection("row1" + iterateId, 2, 0);
  2191. }
  2192. }
  2193.  
  2194. ok_Hash.put("tMap_1", true);
  2195. end_Hash.put("tMap_1", System.currentTimeMillis());
  2196.  
  2197. /**
  2198. * [tMap_1 end ] stop
  2199. */
  2200.  
  2201. /**
  2202. * [tAdvancedHash_zamestnanec end ] start
  2203. */
  2204.  
  2205. currentComponent = "tAdvancedHash_zamestnanec";
  2206.  
  2207. tHash_Lookup_zamestnanec.endPut();
  2208.  
  2209. if (execStat) {
  2210. if (resourceMap.get("inIterateVComp") == null
  2211. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  2212. runStat.updateStatOnConnection("zamestnanec"
  2213. + iterateId, 2, 0);
  2214. }
  2215. }
  2216.  
  2217. ok_Hash.put("tAdvancedHash_zamestnanec", true);
  2218. end_Hash.put("tAdvancedHash_zamestnanec",
  2219. System.currentTimeMillis());
  2220.  
  2221. /**
  2222. * [tAdvancedHash_zamestnanec end ] stop
  2223. */
  2224.  
  2225. }// end the resume
  2226.  
  2227. } catch (java.lang.Exception e) {
  2228.  
  2229. TalendException te = new TalendException(e, currentComponent,
  2230. globalMap);
  2231.  
  2232. throw te;
  2233. } catch (java.lang.Error error) {
  2234.  
  2235. runStat.stopThreadStat();
  2236.  
  2237. throw error;
  2238. } finally {
  2239.  
  2240. // free memory for "tMap_1"
  2241. globalMap.remove("tHash_Lookup_row2");
  2242.  
  2243. // free memory for "tMap_1"
  2244. globalMap.remove("tHash_Lookup_row3");
  2245.  
  2246. try {
  2247.  
  2248. /**
  2249. * [tDBInput_1 finally ] start
  2250. */
  2251.  
  2252. currentComponent = "tDBInput_1";
  2253.  
  2254. /**
  2255. * [tDBInput_1 finally ] stop
  2256. */
  2257.  
  2258. /**
  2259. * [tMap_1 finally ] start
  2260. */
  2261.  
  2262. currentComponent = "tMap_1";
  2263.  
  2264. /**
  2265. * [tMap_1 finally ] stop
  2266. */
  2267.  
  2268. /**
  2269. * [tAdvancedHash_zamestnanec finally ] start
  2270. */
  2271.  
  2272. currentComponent = "tAdvancedHash_zamestnanec";
  2273.  
  2274. /**
  2275. * [tAdvancedHash_zamestnanec finally ] stop
  2276. */
  2277.  
  2278. } catch (java.lang.Exception e) {
  2279. // ignore
  2280. } catch (java.lang.Error error) {
  2281. // ignore
  2282. }
  2283. resourceMap = null;
  2284. }
  2285.  
  2286. globalMap.put("tDBInput_1_SUBPROCESS_STATE", 1);
  2287. }
  2288.  
  2289. public static class row2Struct implements
  2290. routines.system.IPersistableComparableLookupRow<row2Struct> {
  2291. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  2292. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  2293. protected static final int DEFAULT_HASHCODE = 1;
  2294. protected static final int PRIME = 31;
  2295. protected int hashCode = DEFAULT_HASHCODE;
  2296. public boolean hashCodeDirty = true;
  2297.  
  2298. public String loopKey;
  2299.  
  2300. public int idzamestnanci;
  2301.  
  2302. public int getIdzamestnanci() {
  2303. return this.idzamestnanci;
  2304. }
  2305.  
  2306. public int idsazby;
  2307.  
  2308. public int getIdsazby() {
  2309. return this.idsazby;
  2310. }
  2311.  
  2312. public int idpracoviste;
  2313.  
  2314. public int getIdpracoviste() {
  2315. return this.idpracoviste;
  2316. }
  2317.  
  2318. public String jmeno;
  2319.  
  2320. public String getJmeno() {
  2321. return this.jmeno;
  2322. }
  2323.  
  2324. public String prijmeni;
  2325.  
  2326. public String getPrijmeni() {
  2327. return this.prijmeni;
  2328. }
  2329.  
  2330. public String kontaktni_email;
  2331.  
  2332. public String getKontaktni_email() {
  2333. return this.kontaktni_email;
  2334. }
  2335.  
  2336. public String zkratka;
  2337.  
  2338. public String getZkratka() {
  2339. return this.zkratka;
  2340. }
  2341.  
  2342. public Integer osobni_priplatek;
  2343.  
  2344. public Integer getOsobni_priplatek() {
  2345. return this.osobni_priplatek;
  2346. }
  2347.  
  2348. @Override
  2349. public int hashCode() {
  2350. if (this.hashCodeDirty) {
  2351. final int prime = PRIME;
  2352. int result = DEFAULT_HASHCODE;
  2353.  
  2354. result = prime * result + (int) this.idzamestnanci;
  2355.  
  2356. this.hashCode = result;
  2357. this.hashCodeDirty = false;
  2358. }
  2359. return this.hashCode;
  2360. }
  2361.  
  2362. @Override
  2363. public boolean equals(Object obj) {
  2364. if (this == obj)
  2365. return true;
  2366. if (obj == null)
  2367. return false;
  2368. if (getClass() != obj.getClass())
  2369. return false;
  2370. final row2Struct other = (row2Struct) obj;
  2371.  
  2372. if (this.idzamestnanci != other.idzamestnanci)
  2373. return false;
  2374.  
  2375. return true;
  2376. }
  2377.  
  2378. public void copyDataTo(row2Struct other) {
  2379.  
  2380. other.idzamestnanci = this.idzamestnanci;
  2381. other.idsazby = this.idsazby;
  2382. other.idpracoviste = this.idpracoviste;
  2383. other.jmeno = this.jmeno;
  2384. other.prijmeni = this.prijmeni;
  2385. other.kontaktni_email = this.kontaktni_email;
  2386. other.zkratka = this.zkratka;
  2387. other.osobni_priplatek = this.osobni_priplatek;
  2388.  
  2389. }
  2390.  
  2391. public void copyKeysDataTo(row2Struct other) {
  2392.  
  2393. other.idzamestnanci = this.idzamestnanci;
  2394.  
  2395. }
  2396.  
  2397. private String readString(DataInputStream dis, ObjectInputStream ois)
  2398. throws IOException {
  2399. String strReturn = null;
  2400. int length = 0;
  2401. length = dis.readInt();
  2402. if (length == -1) {
  2403. strReturn = null;
  2404. } else {
  2405. byte[] byteArray = new byte[length];
  2406. dis.read(byteArray);
  2407. strReturn = new String(byteArray, utf8Charset);
  2408. }
  2409. return strReturn;
  2410. }
  2411.  
  2412. private void writeString(String str, DataOutputStream dos,
  2413. ObjectOutputStream oos) throws IOException {
  2414. if (str == null) {
  2415. dos.writeInt(-1);
  2416. } else {
  2417. byte[] byteArray = str.getBytes(utf8Charset);
  2418. dos.writeInt(byteArray.length);
  2419. dos.write(byteArray);
  2420. }
  2421. }
  2422.  
  2423. private Integer readInteger(DataInputStream dis, ObjectInputStream ois)
  2424. throws IOException {
  2425. Integer intReturn;
  2426. int length = 0;
  2427. length = dis.readByte();
  2428. if (length == -1) {
  2429. intReturn = null;
  2430. } else {
  2431. intReturn = dis.readInt();
  2432. }
  2433. return intReturn;
  2434. }
  2435.  
  2436. private void writeInteger(Integer intNum, DataOutputStream dos,
  2437. ObjectOutputStream oos) throws IOException {
  2438. if (intNum == null) {
  2439. dos.writeByte(-1);
  2440. } else {
  2441. dos.writeByte(0);
  2442. dos.writeInt(intNum);
  2443. }
  2444. }
  2445.  
  2446. public void readKeysData(ObjectInputStream dis) {
  2447.  
  2448. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  2449.  
  2450. try {
  2451.  
  2452. int length = 0;
  2453.  
  2454. this.idzamestnanci = dis.readInt();
  2455.  
  2456. } catch (IOException e) {
  2457. throw new RuntimeException(e);
  2458.  
  2459. }
  2460.  
  2461. }
  2462.  
  2463. }
  2464.  
  2465. public void writeKeysData(ObjectOutputStream dos) {
  2466. try {
  2467.  
  2468. // int
  2469.  
  2470. dos.writeInt(this.idzamestnanci);
  2471.  
  2472. } catch (IOException e) {
  2473. throw new RuntimeException(e);
  2474. }
  2475.  
  2476. }
  2477.  
  2478. /**
  2479. * Fill Values data by reading ObjectInputStream.
  2480. */
  2481. public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
  2482. try {
  2483.  
  2484. int length = 0;
  2485.  
  2486. this.idsazby = dis.readInt();
  2487.  
  2488. this.idpracoviste = dis.readInt();
  2489.  
  2490. this.jmeno = readString(dis, ois);
  2491.  
  2492. this.prijmeni = readString(dis, ois);
  2493.  
  2494. this.kontaktni_email = readString(dis, ois);
  2495.  
  2496. this.zkratka = readString(dis, ois);
  2497.  
  2498. this.osobni_priplatek = readInteger(dis, ois);
  2499.  
  2500. } catch (IOException e) {
  2501. throw new RuntimeException(e);
  2502.  
  2503. }
  2504.  
  2505. }
  2506.  
  2507. /**
  2508. * Return a byte array which represents Values data.
  2509. */
  2510. public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
  2511. try {
  2512.  
  2513. dos.writeInt(this.idsazby);
  2514.  
  2515. dos.writeInt(this.idpracoviste);
  2516.  
  2517. writeString(this.jmeno, dos, oos);
  2518.  
  2519. writeString(this.prijmeni, dos, oos);
  2520.  
  2521. writeString(this.kontaktni_email, dos, oos);
  2522.  
  2523. writeString(this.zkratka, dos, oos);
  2524.  
  2525. writeInteger(this.osobni_priplatek, dos, oos);
  2526.  
  2527. } catch (IOException e) {
  2528. throw new RuntimeException(e);
  2529. }
  2530.  
  2531. }
  2532.  
  2533. public String toString() {
  2534.  
  2535. StringBuilder sb = new StringBuilder();
  2536. sb.append(super.toString());
  2537. sb.append("[");
  2538. sb.append("idzamestnanci=" + String.valueOf(idzamestnanci));
  2539. sb.append(",idsazby=" + String.valueOf(idsazby));
  2540. sb.append(",idpracoviste=" + String.valueOf(idpracoviste));
  2541. sb.append(",jmeno=" + jmeno);
  2542. sb.append(",prijmeni=" + prijmeni);
  2543. sb.append(",kontaktni_email=" + kontaktni_email);
  2544. sb.append(",zkratka=" + zkratka);
  2545. sb.append(",osobni_priplatek=" + String.valueOf(osobni_priplatek));
  2546. sb.append("]");
  2547.  
  2548. return sb.toString();
  2549. }
  2550.  
  2551. /**
  2552. * Compare keys
  2553. */
  2554. public int compareTo(row2Struct other) {
  2555.  
  2556. int returnValue = -1;
  2557.  
  2558. returnValue = checkNullsAndCompare(this.idzamestnanci,
  2559. other.idzamestnanci);
  2560. if (returnValue != 0) {
  2561. return returnValue;
  2562. }
  2563.  
  2564. return returnValue;
  2565. }
  2566.  
  2567. private int checkNullsAndCompare(Object object1, Object object2) {
  2568. int returnValue = 0;
  2569. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  2570. returnValue = ((Comparable) object1).compareTo(object2);
  2571. } else if (object1 != null && object2 != null) {
  2572. returnValue = compareStrings(object1.toString(),
  2573. object2.toString());
  2574. } else if (object1 == null && object2 != null) {
  2575. returnValue = 1;
  2576. } else if (object1 != null && object2 == null) {
  2577. returnValue = -1;
  2578. } else {
  2579. returnValue = 0;
  2580. }
  2581.  
  2582. return returnValue;
  2583. }
  2584.  
  2585. private int compareStrings(String string1, String string2) {
  2586. return string1.compareTo(string2);
  2587. }
  2588.  
  2589. }
  2590.  
  2591. public void tDBInput_2Process(final java.util.Map<String, Object> globalMap)
  2592. throws TalendException {
  2593. globalMap.put("tDBInput_2_SUBPROCESS_STATE", 0);
  2594.  
  2595. final boolean execStat = this.execStat;
  2596.  
  2597. String iterateId = "";
  2598.  
  2599. String currentComponent = "";
  2600. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  2601.  
  2602. try {
  2603. // TDI-39566 avoid throwing an useless Exception
  2604. boolean resumeIt = true;
  2605. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  2606. String currentMethodName = new java.lang.Exception()
  2607. .getStackTrace()[0].getMethodName();
  2608. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  2609. }
  2610. if (resumeIt || globalResumeTicket) { // start the resume
  2611. globalResumeTicket = true;
  2612.  
  2613. row2Struct row2 = new row2Struct();
  2614.  
  2615. /**
  2616. * [tAdvancedHash_row2 begin ] start
  2617. */
  2618.  
  2619. ok_Hash.put("tAdvancedHash_row2", false);
  2620. start_Hash
  2621. .put("tAdvancedHash_row2", System.currentTimeMillis());
  2622.  
  2623. currentComponent = "tAdvancedHash_row2";
  2624.  
  2625. if (execStat) {
  2626. if (resourceMap.get("inIterateVComp") == null) {
  2627.  
  2628. runStat.updateStatOnConnection("row2" + iterateId, 0, 0);
  2629.  
  2630. }
  2631. }
  2632.  
  2633. int tos_count_tAdvancedHash_row2 = 0;
  2634.  
  2635. // connection name:row2
  2636. // source node:tDBInput_2 - inputs:(after_tDBInput_1)
  2637. // outputs:(row2,row2) | target node:tAdvancedHash_row2 -
  2638. // inputs:(row2) outputs:()
  2639. // linked node: tMap_1 - inputs:(row1,row2,row3)
  2640. // outputs:(zamestnanec,zamestnanec)
  2641.  
  2642. org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row2 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
  2643.  
  2644. org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row2Struct> tHash_Lookup_row2 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
  2645. .<row2Struct> getLookup(matchingModeEnum_row2);
  2646.  
  2647. globalMap.put("tHash_Lookup_row2", tHash_Lookup_row2);
  2648.  
  2649. /**
  2650. * [tAdvancedHash_row2 begin ] stop
  2651. */
  2652.  
  2653. /**
  2654. * [tDBInput_2 begin ] start
  2655. */
  2656.  
  2657. ok_Hash.put("tDBInput_2", false);
  2658. start_Hash.put("tDBInput_2", System.currentTimeMillis());
  2659.  
  2660. currentComponent = "tDBInput_2";
  2661.  
  2662. int tos_count_tDBInput_2 = 0;
  2663.  
  2664. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_2 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  2665. .getMSSqlGenerateTimestampUtil();
  2666.  
  2667. java.util.List<String> talendToDBList_tDBInput_2 = new java.util.ArrayList();
  2668. String[] talendToDBArray_tDBInput_2 = new String[] { "FLOAT",
  2669. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  2670. "DECIMAL IDENTITY", "REAL" };
  2671. java.util.Collections.addAll(talendToDBList_tDBInput_2,
  2672. talendToDBArray_tDBInput_2);
  2673. int nb_line_tDBInput_2 = 0;
  2674. java.sql.Connection conn_tDBInput_2 = null;
  2675. String driverClass_tDBInput_2 = "net.sourceforge.jtds.jdbc.Driver";
  2676. java.lang.Class.forName(driverClass_tDBInput_2);
  2677. String dbUser_tDBInput_2 = "tym1";
  2678.  
  2679. final String decryptedPassword_tDBInput_2 = routines.system.PasswordEncryptUtil
  2680. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  2681.  
  2682. String dbPwd_tDBInput_2 = decryptedPassword_tDBInput_2;
  2683.  
  2684. String port_tDBInput_2 = "1433";
  2685. String dbname_tDBInput_2 = "bi_zdroj01";
  2686. String url_tDBInput_2 = "jdbc:jtds:sqlserver://"
  2687. + "158.196.160.60";
  2688. if (!"".equals(port_tDBInput_2)) {
  2689. url_tDBInput_2 += ":" + "1433";
  2690. }
  2691. if (!"".equals(dbname_tDBInput_2)) {
  2692. url_tDBInput_2 += "//" + "bi_zdroj01";
  2693. }
  2694. url_tDBInput_2 += ";appName=" + projectName + ";" + "";
  2695. String dbschema_tDBInput_2 = "";
  2696.  
  2697. conn_tDBInput_2 = java.sql.DriverManager.getConnection(
  2698. url_tDBInput_2, dbUser_tDBInput_2, dbPwd_tDBInput_2);
  2699.  
  2700. java.sql.Statement stmt_tDBInput_2 = conn_tDBInput_2
  2701. .createStatement();
  2702.  
  2703. String dbquery_tDBInput_2 = "SELECT zamestnanci.idzamestnanci,\n zamestnanci.idsazby,\n zamestnanci.idpracoviste,\n zamestnanci.jmeno,\n zamestnanci"
  2704. + ".prijmeni,\n zamestnanci.kontaktni_email,\n zamestnanci.zkratka,\n zamestnanci.osobni_priplatek\nFROM zamestnanci";
  2705.  
  2706. globalMap.put("tDBInput_2_QUERY", dbquery_tDBInput_2);
  2707. java.sql.ResultSet rs_tDBInput_2 = null;
  2708.  
  2709. try {
  2710. rs_tDBInput_2 = stmt_tDBInput_2
  2711. .executeQuery(dbquery_tDBInput_2);
  2712. java.sql.ResultSetMetaData rsmd_tDBInput_2 = rs_tDBInput_2
  2713. .getMetaData();
  2714. int colQtyInRs_tDBInput_2 = rsmd_tDBInput_2
  2715. .getColumnCount();
  2716.  
  2717. String tmpContent_tDBInput_2 = null;
  2718.  
  2719. while (rs_tDBInput_2.next()) {
  2720. nb_line_tDBInput_2++;
  2721.  
  2722. if (colQtyInRs_tDBInput_2 < 1) {
  2723. row2.idzamestnanci = 0;
  2724. } else {
  2725.  
  2726. if (rs_tDBInput_2.getObject(1) != null) {
  2727. row2.idzamestnanci = rs_tDBInput_2.getInt(1);
  2728. } else {
  2729. throw new RuntimeException(
  2730. "Null value in non-Nullable column");
  2731. }
  2732. }
  2733. if (colQtyInRs_tDBInput_2 < 2) {
  2734. row2.idsazby = 0;
  2735. } else {
  2736.  
  2737. if (rs_tDBInput_2.getObject(2) != null) {
  2738. row2.idsazby = rs_tDBInput_2.getInt(2);
  2739. } else {
  2740. throw new RuntimeException(
  2741. "Null value in non-Nullable column");
  2742. }
  2743. }
  2744. if (colQtyInRs_tDBInput_2 < 3) {
  2745. row2.idpracoviste = 0;
  2746. } else {
  2747.  
  2748. if (rs_tDBInput_2.getObject(3) != null) {
  2749. row2.idpracoviste = rs_tDBInput_2.getInt(3);
  2750. } else {
  2751. throw new RuntimeException(
  2752. "Null value in non-Nullable column");
  2753. }
  2754. }
  2755. if (colQtyInRs_tDBInput_2 < 4) {
  2756. row2.jmeno = null;
  2757. } else {
  2758.  
  2759. tmpContent_tDBInput_2 = rs_tDBInput_2.getString(4);
  2760. if (tmpContent_tDBInput_2 != null) {
  2761. if (talendToDBList_tDBInput_2
  2762. .contains(rsmd_tDBInput_2
  2763. .getColumnTypeName(4)
  2764. .toUpperCase(
  2765. java.util.Locale.ENGLISH))) {
  2766. row2.jmeno = FormatterUtils
  2767. .formatUnwithE(tmpContent_tDBInput_2);
  2768. } else {
  2769. row2.jmeno = tmpContent_tDBInput_2;
  2770. }
  2771. } else {
  2772. row2.jmeno = null;
  2773. }
  2774. }
  2775. if (colQtyInRs_tDBInput_2 < 5) {
  2776. row2.prijmeni = null;
  2777. } else {
  2778.  
  2779. tmpContent_tDBInput_2 = rs_tDBInput_2.getString(5);
  2780. if (tmpContent_tDBInput_2 != null) {
  2781. if (talendToDBList_tDBInput_2
  2782. .contains(rsmd_tDBInput_2
  2783. .getColumnTypeName(5)
  2784. .toUpperCase(
  2785. java.util.Locale.ENGLISH))) {
  2786. row2.prijmeni = FormatterUtils
  2787. .formatUnwithE(tmpContent_tDBInput_2);
  2788. } else {
  2789. row2.prijmeni = tmpContent_tDBInput_2;
  2790. }
  2791. } else {
  2792. row2.prijmeni = null;
  2793. }
  2794. }
  2795. if (colQtyInRs_tDBInput_2 < 6) {
  2796. row2.kontaktni_email = null;
  2797. } else {
  2798.  
  2799. tmpContent_tDBInput_2 = rs_tDBInput_2.getString(6);
  2800. if (tmpContent_tDBInput_2 != null) {
  2801. if (talendToDBList_tDBInput_2
  2802. .contains(rsmd_tDBInput_2
  2803. .getColumnTypeName(6)
  2804. .toUpperCase(
  2805. java.util.Locale.ENGLISH))) {
  2806. row2.kontaktni_email = FormatterUtils
  2807. .formatUnwithE(tmpContent_tDBInput_2);
  2808. } else {
  2809. row2.kontaktni_email = tmpContent_tDBInput_2;
  2810. }
  2811. } else {
  2812. row2.kontaktni_email = null;
  2813. }
  2814. }
  2815. if (colQtyInRs_tDBInput_2 < 7) {
  2816. row2.zkratka = null;
  2817. } else {
  2818.  
  2819. tmpContent_tDBInput_2 = rs_tDBInput_2.getString(7);
  2820. if (tmpContent_tDBInput_2 != null) {
  2821. if (talendToDBList_tDBInput_2
  2822. .contains(rsmd_tDBInput_2
  2823. .getColumnTypeName(7)
  2824. .toUpperCase(
  2825. java.util.Locale.ENGLISH))) {
  2826. row2.zkratka = FormatterUtils
  2827. .formatUnwithE(tmpContent_tDBInput_2);
  2828. } else {
  2829. row2.zkratka = tmpContent_tDBInput_2;
  2830. }
  2831. } else {
  2832. row2.zkratka = null;
  2833. }
  2834. }
  2835. if (colQtyInRs_tDBInput_2 < 8) {
  2836. row2.osobni_priplatek = null;
  2837. } else {
  2838.  
  2839. if (rs_tDBInput_2.getObject(8) != null) {
  2840. row2.osobni_priplatek = rs_tDBInput_2.getInt(8);
  2841. } else {
  2842. row2.osobni_priplatek = null;
  2843. }
  2844. }
  2845.  
  2846. /**
  2847. * [tDBInput_2 begin ] stop
  2848. */
  2849.  
  2850. /**
  2851. * [tDBInput_2 main ] start
  2852. */
  2853.  
  2854. currentComponent = "tDBInput_2";
  2855.  
  2856. tos_count_tDBInput_2++;
  2857.  
  2858. /**
  2859. * [tDBInput_2 main ] stop
  2860. */
  2861.  
  2862. /**
  2863. * [tDBInput_2 process_data_begin ] start
  2864. */
  2865.  
  2866. currentComponent = "tDBInput_2";
  2867.  
  2868. /**
  2869. * [tDBInput_2 process_data_begin ] stop
  2870. */
  2871.  
  2872. /**
  2873. * [tAdvancedHash_row2 main ] start
  2874. */
  2875.  
  2876. currentComponent = "tAdvancedHash_row2";
  2877.  
  2878. // row2
  2879. // row2
  2880.  
  2881. if (execStat) {
  2882. runStat.updateStatOnConnection("row2" + iterateId,
  2883. 1, 1);
  2884. }
  2885.  
  2886. row2Struct row2_HashRow = new row2Struct();
  2887.  
  2888. row2_HashRow.idzamestnanci = row2.idzamestnanci;
  2889.  
  2890. row2_HashRow.idsazby = row2.idsazby;
  2891.  
  2892. row2_HashRow.idpracoviste = row2.idpracoviste;
  2893.  
  2894. row2_HashRow.jmeno = row2.jmeno;
  2895.  
  2896. row2_HashRow.prijmeni = row2.prijmeni;
  2897.  
  2898. row2_HashRow.kontaktni_email = row2.kontaktni_email;
  2899.  
  2900. row2_HashRow.zkratka = row2.zkratka;
  2901.  
  2902. row2_HashRow.osobni_priplatek = row2.osobni_priplatek;
  2903.  
  2904. tHash_Lookup_row2.put(row2_HashRow);
  2905.  
  2906. tos_count_tAdvancedHash_row2++;
  2907.  
  2908. /**
  2909. * [tAdvancedHash_row2 main ] stop
  2910. */
  2911.  
  2912. /**
  2913. * [tAdvancedHash_row2 process_data_begin ] start
  2914. */
  2915.  
  2916. currentComponent = "tAdvancedHash_row2";
  2917.  
  2918. /**
  2919. * [tAdvancedHash_row2 process_data_begin ] stop
  2920. */
  2921.  
  2922. /**
  2923. * [tAdvancedHash_row2 process_data_end ] start
  2924. */
  2925.  
  2926. currentComponent = "tAdvancedHash_row2";
  2927.  
  2928. /**
  2929. * [tAdvancedHash_row2 process_data_end ] stop
  2930. */
  2931.  
  2932. /**
  2933. * [tDBInput_2 process_data_end ] start
  2934. */
  2935.  
  2936. currentComponent = "tDBInput_2";
  2937.  
  2938. /**
  2939. * [tDBInput_2 process_data_end ] stop
  2940. */
  2941.  
  2942. /**
  2943. * [tDBInput_2 end ] start
  2944. */
  2945.  
  2946. currentComponent = "tDBInput_2";
  2947.  
  2948. }
  2949. } finally {
  2950. if (rs_tDBInput_2 != null) {
  2951. rs_tDBInput_2.close();
  2952. }
  2953. if (stmt_tDBInput_2 != null) {
  2954. stmt_tDBInput_2.close();
  2955. }
  2956. if (conn_tDBInput_2 != null && !conn_tDBInput_2.isClosed()) {
  2957.  
  2958. conn_tDBInput_2.close();
  2959.  
  2960. }
  2961. }
  2962. globalMap.put("tDBInput_2_NB_LINE", nb_line_tDBInput_2);
  2963.  
  2964. ok_Hash.put("tDBInput_2", true);
  2965. end_Hash.put("tDBInput_2", System.currentTimeMillis());
  2966.  
  2967. /**
  2968. * [tDBInput_2 end ] stop
  2969. */
  2970.  
  2971. /**
  2972. * [tAdvancedHash_row2 end ] start
  2973. */
  2974.  
  2975. currentComponent = "tAdvancedHash_row2";
  2976.  
  2977. tHash_Lookup_row2.endPut();
  2978.  
  2979. if (execStat) {
  2980. if (resourceMap.get("inIterateVComp") == null
  2981. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  2982. runStat.updateStatOnConnection("row2" + iterateId, 2, 0);
  2983. }
  2984. }
  2985.  
  2986. ok_Hash.put("tAdvancedHash_row2", true);
  2987. end_Hash.put("tAdvancedHash_row2", System.currentTimeMillis());
  2988.  
  2989. /**
  2990. * [tAdvancedHash_row2 end ] stop
  2991. */
  2992.  
  2993. }// end the resume
  2994.  
  2995. } catch (java.lang.Exception e) {
  2996.  
  2997. TalendException te = new TalendException(e, currentComponent,
  2998. globalMap);
  2999.  
  3000. throw te;
  3001. } catch (java.lang.Error error) {
  3002.  
  3003. runStat.stopThreadStat();
  3004.  
  3005. throw error;
  3006. } finally {
  3007.  
  3008. try {
  3009.  
  3010. /**
  3011. * [tDBInput_2 finally ] start
  3012. */
  3013.  
  3014. currentComponent = "tDBInput_2";
  3015.  
  3016. /**
  3017. * [tDBInput_2 finally ] stop
  3018. */
  3019.  
  3020. /**
  3021. * [tAdvancedHash_row2 finally ] start
  3022. */
  3023.  
  3024. currentComponent = "tAdvancedHash_row2";
  3025.  
  3026. /**
  3027. * [tAdvancedHash_row2 finally ] stop
  3028. */
  3029.  
  3030. } catch (java.lang.Exception e) {
  3031. // ignore
  3032. } catch (java.lang.Error error) {
  3033. // ignore
  3034. }
  3035. resourceMap = null;
  3036. }
  3037.  
  3038. globalMap.put("tDBInput_2_SUBPROCESS_STATE", 1);
  3039. }
  3040.  
  3041. public static class row11Struct implements
  3042. routines.system.IPersistableComparableLookupRow<row11Struct> {
  3043. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  3044. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  3045. protected static final int DEFAULT_HASHCODE = 1;
  3046. protected static final int PRIME = 31;
  3047. protected int hashCode = DEFAULT_HASHCODE;
  3048. public boolean hashCodeDirty = true;
  3049.  
  3050. public String loopKey;
  3051.  
  3052. public int idodmeny;
  3053.  
  3054. public int getIdodmeny() {
  3055. return this.idodmeny;
  3056. }
  3057.  
  3058. public int idzamestnanci;
  3059.  
  3060. public int getIdzamestnanci() {
  3061. return this.idzamestnanci;
  3062. }
  3063.  
  3064. public short mesic;
  3065.  
  3066. public short getMesic() {
  3067. return this.mesic;
  3068. }
  3069.  
  3070. public short rok;
  3071.  
  3072. public short getRok() {
  3073. return this.rok;
  3074. }
  3075.  
  3076. public int odmena;
  3077.  
  3078. public int getOdmena() {
  3079. return this.odmena;
  3080. }
  3081.  
  3082. @Override
  3083. public int hashCode() {
  3084. if (this.hashCodeDirty) {
  3085. final int prime = PRIME;
  3086. int result = DEFAULT_HASHCODE;
  3087.  
  3088. result = prime * result + (int) this.idzamestnanci;
  3089.  
  3090. result = prime * result + (int) this.mesic;
  3091.  
  3092. result = prime * result + (int) this.rok;
  3093.  
  3094. this.hashCode = result;
  3095. this.hashCodeDirty = false;
  3096. }
  3097. return this.hashCode;
  3098. }
  3099.  
  3100. @Override
  3101. public boolean equals(Object obj) {
  3102. if (this == obj)
  3103. return true;
  3104. if (obj == null)
  3105. return false;
  3106. if (getClass() != obj.getClass())
  3107. return false;
  3108. final row11Struct other = (row11Struct) obj;
  3109.  
  3110. if (this.idzamestnanci != other.idzamestnanci)
  3111. return false;
  3112.  
  3113. if (this.mesic != other.mesic)
  3114. return false;
  3115.  
  3116. if (this.rok != other.rok)
  3117. return false;
  3118.  
  3119. return true;
  3120. }
  3121.  
  3122. public void copyDataTo(row11Struct other) {
  3123.  
  3124. other.idodmeny = this.idodmeny;
  3125. other.idzamestnanci = this.idzamestnanci;
  3126. other.mesic = this.mesic;
  3127. other.rok = this.rok;
  3128. other.odmena = this.odmena;
  3129.  
  3130. }
  3131.  
  3132. public void copyKeysDataTo(row11Struct other) {
  3133.  
  3134. other.idzamestnanci = this.idzamestnanci;
  3135. other.mesic = this.mesic;
  3136. other.rok = this.rok;
  3137.  
  3138. }
  3139.  
  3140. public void readKeysData(ObjectInputStream dis) {
  3141.  
  3142. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  3143.  
  3144. try {
  3145.  
  3146. int length = 0;
  3147.  
  3148. this.idzamestnanci = dis.readInt();
  3149.  
  3150. this.mesic = dis.readShort();
  3151.  
  3152. this.rok = dis.readShort();
  3153.  
  3154. } catch (IOException e) {
  3155. throw new RuntimeException(e);
  3156.  
  3157. }
  3158.  
  3159. }
  3160.  
  3161. }
  3162.  
  3163. public void writeKeysData(ObjectOutputStream dos) {
  3164. try {
  3165.  
  3166. // int
  3167.  
  3168. dos.writeInt(this.idzamestnanci);
  3169.  
  3170. // short
  3171.  
  3172. dos.writeShort(this.mesic);
  3173.  
  3174. // short
  3175.  
  3176. dos.writeShort(this.rok);
  3177.  
  3178. } catch (IOException e) {
  3179. throw new RuntimeException(e);
  3180. }
  3181.  
  3182. }
  3183.  
  3184. /**
  3185. * Fill Values data by reading ObjectInputStream.
  3186. */
  3187. public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
  3188. try {
  3189.  
  3190. int length = 0;
  3191.  
  3192. this.idodmeny = dis.readInt();
  3193.  
  3194. this.odmena = dis.readInt();
  3195.  
  3196. } catch (IOException e) {
  3197. throw new RuntimeException(e);
  3198.  
  3199. }
  3200.  
  3201. }
  3202.  
  3203. /**
  3204. * Return a byte array which represents Values data.
  3205. */
  3206. public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
  3207. try {
  3208.  
  3209. dos.writeInt(this.idodmeny);
  3210.  
  3211. dos.writeInt(this.odmena);
  3212.  
  3213. } catch (IOException e) {
  3214. throw new RuntimeException(e);
  3215. }
  3216.  
  3217. }
  3218.  
  3219. public String toString() {
  3220.  
  3221. StringBuilder sb = new StringBuilder();
  3222. sb.append(super.toString());
  3223. sb.append("[");
  3224. sb.append("idodmeny=" + String.valueOf(idodmeny));
  3225. sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
  3226. sb.append(",mesic=" + String.valueOf(mesic));
  3227. sb.append(",rok=" + String.valueOf(rok));
  3228. sb.append(",odmena=" + String.valueOf(odmena));
  3229. sb.append("]");
  3230.  
  3231. return sb.toString();
  3232. }
  3233.  
  3234. /**
  3235. * Compare keys
  3236. */
  3237. public int compareTo(row11Struct other) {
  3238.  
  3239. int returnValue = -1;
  3240.  
  3241. returnValue = checkNullsAndCompare(this.idzamestnanci,
  3242. other.idzamestnanci);
  3243. if (returnValue != 0) {
  3244. return returnValue;
  3245. }
  3246.  
  3247. returnValue = checkNullsAndCompare(this.mesic, other.mesic);
  3248. if (returnValue != 0) {
  3249. return returnValue;
  3250. }
  3251.  
  3252. returnValue = checkNullsAndCompare(this.rok, other.rok);
  3253. if (returnValue != 0) {
  3254. return returnValue;
  3255. }
  3256.  
  3257. return returnValue;
  3258. }
  3259.  
  3260. private int checkNullsAndCompare(Object object1, Object object2) {
  3261. int returnValue = 0;
  3262. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  3263. returnValue = ((Comparable) object1).compareTo(object2);
  3264. } else if (object1 != null && object2 != null) {
  3265. returnValue = compareStrings(object1.toString(),
  3266. object2.toString());
  3267. } else if (object1 == null && object2 != null) {
  3268. returnValue = 1;
  3269. } else if (object1 != null && object2 == null) {
  3270. returnValue = -1;
  3271. } else {
  3272. returnValue = 0;
  3273. }
  3274.  
  3275. return returnValue;
  3276. }
  3277.  
  3278. private int compareStrings(String string1, String string2) {
  3279. return string1.compareTo(string2);
  3280. }
  3281.  
  3282. }
  3283.  
  3284. public void tDBInput_3Process(final java.util.Map<String, Object> globalMap)
  3285. throws TalendException {
  3286. globalMap.put("tDBInput_3_SUBPROCESS_STATE", 0);
  3287.  
  3288. final boolean execStat = this.execStat;
  3289.  
  3290. String iterateId = "";
  3291.  
  3292. String currentComponent = "";
  3293. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  3294.  
  3295. try {
  3296. // TDI-39566 avoid throwing an useless Exception
  3297. boolean resumeIt = true;
  3298. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  3299. String currentMethodName = new java.lang.Exception()
  3300. .getStackTrace()[0].getMethodName();
  3301. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  3302. }
  3303. if (resumeIt || globalResumeTicket) { // start the resume
  3304. globalResumeTicket = true;
  3305.  
  3306. row11Struct row11 = new row11Struct();
  3307.  
  3308. /**
  3309. * [tAdvancedHash_row11 begin ] start
  3310. */
  3311.  
  3312. ok_Hash.put("tAdvancedHash_row11", false);
  3313. start_Hash.put("tAdvancedHash_row11",
  3314. System.currentTimeMillis());
  3315.  
  3316. currentComponent = "tAdvancedHash_row11";
  3317.  
  3318. if (execStat) {
  3319. if (resourceMap.get("inIterateVComp") == null) {
  3320.  
  3321. runStat.updateStatOnConnection("row11" + iterateId, 0,
  3322. 0);
  3323.  
  3324. }
  3325. }
  3326.  
  3327. int tos_count_tAdvancedHash_row11 = 0;
  3328.  
  3329. // connection name:row11
  3330. // source node:tDBInput_3 - inputs:(after_tDBInput_6)
  3331. // outputs:(row11,row11) | target node:tAdvancedHash_row11 -
  3332. // inputs:(row11) outputs:()
  3333. // linked node: tMap_2 -
  3334. // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
  3335. // outputs:(out2)
  3336.  
  3337. org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row11 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
  3338.  
  3339. org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row11Struct> tHash_Lookup_row11 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
  3340. .<row11Struct> getLookup(matchingModeEnum_row11);
  3341.  
  3342. globalMap.put("tHash_Lookup_row11", tHash_Lookup_row11);
  3343.  
  3344. /**
  3345. * [tAdvancedHash_row11 begin ] stop
  3346. */
  3347.  
  3348. /**
  3349. * [tDBInput_3 begin ] start
  3350. */
  3351.  
  3352. ok_Hash.put("tDBInput_3", false);
  3353. start_Hash.put("tDBInput_3", System.currentTimeMillis());
  3354.  
  3355. currentComponent = "tDBInput_3";
  3356.  
  3357. int tos_count_tDBInput_3 = 0;
  3358.  
  3359. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_3 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  3360. .getMSSqlGenerateTimestampUtil();
  3361.  
  3362. java.util.List<String> talendToDBList_tDBInput_3 = new java.util.ArrayList();
  3363. String[] talendToDBArray_tDBInput_3 = new String[] { "FLOAT",
  3364. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  3365. "DECIMAL IDENTITY", "REAL" };
  3366. java.util.Collections.addAll(talendToDBList_tDBInput_3,
  3367. talendToDBArray_tDBInput_3);
  3368. int nb_line_tDBInput_3 = 0;
  3369. java.sql.Connection conn_tDBInput_3 = null;
  3370. String driverClass_tDBInput_3 = "net.sourceforge.jtds.jdbc.Driver";
  3371. java.lang.Class.forName(driverClass_tDBInput_3);
  3372. String dbUser_tDBInput_3 = "tym1";
  3373.  
  3374. final String decryptedPassword_tDBInput_3 = routines.system.PasswordEncryptUtil
  3375. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  3376.  
  3377. String dbPwd_tDBInput_3 = decryptedPassword_tDBInput_3;
  3378.  
  3379. String port_tDBInput_3 = "1433";
  3380. String dbname_tDBInput_3 = "bi_zdroj01";
  3381. String url_tDBInput_3 = "jdbc:jtds:sqlserver://"
  3382. + "158.196.160.60";
  3383. if (!"".equals(port_tDBInput_3)) {
  3384. url_tDBInput_3 += ":" + "1433";
  3385. }
  3386. if (!"".equals(dbname_tDBInput_3)) {
  3387. url_tDBInput_3 += "//" + "bi_zdroj01";
  3388. }
  3389. url_tDBInput_3 += ";appName=" + projectName + ";" + "";
  3390. String dbschema_tDBInput_3 = "";
  3391.  
  3392. conn_tDBInput_3 = java.sql.DriverManager.getConnection(
  3393. url_tDBInput_3, dbUser_tDBInput_3, dbPwd_tDBInput_3);
  3394.  
  3395. java.sql.Statement stmt_tDBInput_3 = conn_tDBInput_3
  3396. .createStatement();
  3397.  
  3398. String dbquery_tDBInput_3 = "SELECT odmeny.idodmeny,\n odmeny.idzamestnanci,\n odmeny.mesic,\n odmeny.rok,\n odmeny.odmena\nFROM odmeny";
  3399.  
  3400. globalMap.put("tDBInput_3_QUERY", dbquery_tDBInput_3);
  3401. java.sql.ResultSet rs_tDBInput_3 = null;
  3402.  
  3403. try {
  3404. rs_tDBInput_3 = stmt_tDBInput_3
  3405. .executeQuery(dbquery_tDBInput_3);
  3406. java.sql.ResultSetMetaData rsmd_tDBInput_3 = rs_tDBInput_3
  3407. .getMetaData();
  3408. int colQtyInRs_tDBInput_3 = rsmd_tDBInput_3
  3409. .getColumnCount();
  3410.  
  3411. String tmpContent_tDBInput_3 = null;
  3412.  
  3413. while (rs_tDBInput_3.next()) {
  3414. nb_line_tDBInput_3++;
  3415.  
  3416. if (colQtyInRs_tDBInput_3 < 1) {
  3417. row11.idodmeny = 0;
  3418. } else {
  3419.  
  3420. if (rs_tDBInput_3.getObject(1) != null) {
  3421. row11.idodmeny = rs_tDBInput_3.getInt(1);
  3422. } else {
  3423. throw new RuntimeException(
  3424. "Null value in non-Nullable column");
  3425. }
  3426. }
  3427. if (colQtyInRs_tDBInput_3 < 2) {
  3428. row11.idzamestnanci = 0;
  3429. } else {
  3430.  
  3431. if (rs_tDBInput_3.getObject(2) != null) {
  3432. row11.idzamestnanci = rs_tDBInput_3.getInt(2);
  3433. } else {
  3434. throw new RuntimeException(
  3435. "Null value in non-Nullable column");
  3436. }
  3437. }
  3438. if (colQtyInRs_tDBInput_3 < 3) {
  3439. row11.mesic = 0;
  3440. } else {
  3441.  
  3442. if (rs_tDBInput_3.getObject(3) != null) {
  3443. row11.mesic = rs_tDBInput_3.getShort(3);
  3444. } else {
  3445. throw new RuntimeException(
  3446. "Null value in non-Nullable column");
  3447. }
  3448. }
  3449. if (colQtyInRs_tDBInput_3 < 4) {
  3450. row11.rok = 0;
  3451. } else {
  3452.  
  3453. if (rs_tDBInput_3.getObject(4) != null) {
  3454. row11.rok = rs_tDBInput_3.getShort(4);
  3455. } else {
  3456. throw new RuntimeException(
  3457. "Null value in non-Nullable column");
  3458. }
  3459. }
  3460. if (colQtyInRs_tDBInput_3 < 5) {
  3461. row11.odmena = 0;
  3462. } else {
  3463.  
  3464. if (rs_tDBInput_3.getObject(5) != null) {
  3465. row11.odmena = rs_tDBInput_3.getInt(5);
  3466. } else {
  3467. throw new RuntimeException(
  3468. "Null value in non-Nullable column");
  3469. }
  3470. }
  3471.  
  3472. /**
  3473. * [tDBInput_3 begin ] stop
  3474. */
  3475.  
  3476. /**
  3477. * [tDBInput_3 main ] start
  3478. */
  3479.  
  3480. currentComponent = "tDBInput_3";
  3481.  
  3482. tos_count_tDBInput_3++;
  3483.  
  3484. /**
  3485. * [tDBInput_3 main ] stop
  3486. */
  3487.  
  3488. /**
  3489. * [tDBInput_3 process_data_begin ] start
  3490. */
  3491.  
  3492. currentComponent = "tDBInput_3";
  3493.  
  3494. /**
  3495. * [tDBInput_3 process_data_begin ] stop
  3496. */
  3497.  
  3498. /**
  3499. * [tAdvancedHash_row11 main ] start
  3500. */
  3501.  
  3502. currentComponent = "tAdvancedHash_row11";
  3503.  
  3504. // row11
  3505. // row11
  3506.  
  3507. if (execStat) {
  3508. runStat.updateStatOnConnection("row11" + iterateId,
  3509. 1, 1);
  3510. }
  3511.  
  3512. row11Struct row11_HashRow = new row11Struct();
  3513.  
  3514. row11_HashRow.idodmeny = row11.idodmeny;
  3515.  
  3516. row11_HashRow.idzamestnanci = row11.idzamestnanci;
  3517.  
  3518. row11_HashRow.mesic = row11.mesic;
  3519.  
  3520. row11_HashRow.rok = row11.rok;
  3521.  
  3522. row11_HashRow.odmena = row11.odmena;
  3523.  
  3524. tHash_Lookup_row11.put(row11_HashRow);
  3525.  
  3526. tos_count_tAdvancedHash_row11++;
  3527.  
  3528. /**
  3529. * [tAdvancedHash_row11 main ] stop
  3530. */
  3531.  
  3532. /**
  3533. * [tAdvancedHash_row11 process_data_begin ] start
  3534. */
  3535.  
  3536. currentComponent = "tAdvancedHash_row11";
  3537.  
  3538. /**
  3539. * [tAdvancedHash_row11 process_data_begin ] stop
  3540. */
  3541.  
  3542. /**
  3543. * [tAdvancedHash_row11 process_data_end ] start
  3544. */
  3545.  
  3546. currentComponent = "tAdvancedHash_row11";
  3547.  
  3548. /**
  3549. * [tAdvancedHash_row11 process_data_end ] stop
  3550. */
  3551.  
  3552. /**
  3553. * [tDBInput_3 process_data_end ] start
  3554. */
  3555.  
  3556. currentComponent = "tDBInput_3";
  3557.  
  3558. /**
  3559. * [tDBInput_3 process_data_end ] stop
  3560. */
  3561.  
  3562. /**
  3563. * [tDBInput_3 end ] start
  3564. */
  3565.  
  3566. currentComponent = "tDBInput_3";
  3567.  
  3568. }
  3569. } finally {
  3570. if (rs_tDBInput_3 != null) {
  3571. rs_tDBInput_3.close();
  3572. }
  3573. if (stmt_tDBInput_3 != null) {
  3574. stmt_tDBInput_3.close();
  3575. }
  3576. if (conn_tDBInput_3 != null && !conn_tDBInput_3.isClosed()) {
  3577.  
  3578. conn_tDBInput_3.close();
  3579.  
  3580. }
  3581. }
  3582. globalMap.put("tDBInput_3_NB_LINE", nb_line_tDBInput_3);
  3583.  
  3584. ok_Hash.put("tDBInput_3", true);
  3585. end_Hash.put("tDBInput_3", System.currentTimeMillis());
  3586.  
  3587. /**
  3588. * [tDBInput_3 end ] stop
  3589. */
  3590.  
  3591. /**
  3592. * [tAdvancedHash_row11 end ] start
  3593. */
  3594.  
  3595. currentComponent = "tAdvancedHash_row11";
  3596.  
  3597. tHash_Lookup_row11.endPut();
  3598.  
  3599. if (execStat) {
  3600. if (resourceMap.get("inIterateVComp") == null
  3601. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  3602. runStat.updateStatOnConnection("row11" + iterateId, 2,
  3603. 0);
  3604. }
  3605. }
  3606.  
  3607. ok_Hash.put("tAdvancedHash_row11", true);
  3608. end_Hash.put("tAdvancedHash_row11", System.currentTimeMillis());
  3609.  
  3610. /**
  3611. * [tAdvancedHash_row11 end ] stop
  3612. */
  3613.  
  3614. }// end the resume
  3615.  
  3616. } catch (java.lang.Exception e) {
  3617.  
  3618. TalendException te = new TalendException(e, currentComponent,
  3619. globalMap);
  3620.  
  3621. throw te;
  3622. } catch (java.lang.Error error) {
  3623.  
  3624. runStat.stopThreadStat();
  3625.  
  3626. throw error;
  3627. } finally {
  3628.  
  3629. try {
  3630.  
  3631. /**
  3632. * [tDBInput_3 finally ] start
  3633. */
  3634.  
  3635. currentComponent = "tDBInput_3";
  3636.  
  3637. /**
  3638. * [tDBInput_3 finally ] stop
  3639. */
  3640.  
  3641. /**
  3642. * [tAdvancedHash_row11 finally ] start
  3643. */
  3644.  
  3645. currentComponent = "tAdvancedHash_row11";
  3646.  
  3647. /**
  3648. * [tAdvancedHash_row11 finally ] stop
  3649. */
  3650.  
  3651. } catch (java.lang.Exception e) {
  3652. // ignore
  3653. } catch (java.lang.Error error) {
  3654. // ignore
  3655. }
  3656. resourceMap = null;
  3657. }
  3658.  
  3659. globalMap.put("tDBInput_3_SUBPROCESS_STATE", 1);
  3660. }
  3661.  
  3662. public static class row3Struct implements
  3663. routines.system.IPersistableComparableLookupRow<row3Struct> {
  3664. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  3665. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  3666. protected static final int DEFAULT_HASHCODE = 1;
  3667. protected static final int PRIME = 31;
  3668. protected int hashCode = DEFAULT_HASHCODE;
  3669. public boolean hashCodeDirty = true;
  3670.  
  3671. public String loopKey;
  3672.  
  3673. public int idsazby;
  3674.  
  3675. public int getIdsazby() {
  3676. return this.idsazby;
  3677. }
  3678.  
  3679. public String nazev_profese;
  3680.  
  3681. public String getNazev_profese() {
  3682. return this.nazev_profese;
  3683. }
  3684.  
  3685. public int hodinova_sazba;
  3686.  
  3687. public int getHodinova_sazba() {
  3688. return this.hodinova_sazba;
  3689. }
  3690.  
  3691. @Override
  3692. public int hashCode() {
  3693. if (this.hashCodeDirty) {
  3694. final int prime = PRIME;
  3695. int result = DEFAULT_HASHCODE;
  3696.  
  3697. result = prime * result + (int) this.idsazby;
  3698.  
  3699. this.hashCode = result;
  3700. this.hashCodeDirty = false;
  3701. }
  3702. return this.hashCode;
  3703. }
  3704.  
  3705. @Override
  3706. public boolean equals(Object obj) {
  3707. if (this == obj)
  3708. return true;
  3709. if (obj == null)
  3710. return false;
  3711. if (getClass() != obj.getClass())
  3712. return false;
  3713. final row3Struct other = (row3Struct) obj;
  3714.  
  3715. if (this.idsazby != other.idsazby)
  3716. return false;
  3717.  
  3718. return true;
  3719. }
  3720.  
  3721. public void copyDataTo(row3Struct other) {
  3722.  
  3723. other.idsazby = this.idsazby;
  3724. other.nazev_profese = this.nazev_profese;
  3725. other.hodinova_sazba = this.hodinova_sazba;
  3726.  
  3727. }
  3728.  
  3729. public void copyKeysDataTo(row3Struct other) {
  3730.  
  3731. other.idsazby = this.idsazby;
  3732.  
  3733. }
  3734.  
  3735. private String readString(DataInputStream dis, ObjectInputStream ois)
  3736. throws IOException {
  3737. String strReturn = null;
  3738. int length = 0;
  3739. length = dis.readInt();
  3740. if (length == -1) {
  3741. strReturn = null;
  3742. } else {
  3743. byte[] byteArray = new byte[length];
  3744. dis.read(byteArray);
  3745. strReturn = new String(byteArray, utf8Charset);
  3746. }
  3747. return strReturn;
  3748. }
  3749.  
  3750. private void writeString(String str, DataOutputStream dos,
  3751. ObjectOutputStream oos) throws IOException {
  3752. if (str == null) {
  3753. dos.writeInt(-1);
  3754. } else {
  3755. byte[] byteArray = str.getBytes(utf8Charset);
  3756. dos.writeInt(byteArray.length);
  3757. dos.write(byteArray);
  3758. }
  3759. }
  3760.  
  3761. public void readKeysData(ObjectInputStream dis) {
  3762.  
  3763. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  3764.  
  3765. try {
  3766.  
  3767. int length = 0;
  3768.  
  3769. this.idsazby = dis.readInt();
  3770.  
  3771. } catch (IOException e) {
  3772. throw new RuntimeException(e);
  3773.  
  3774. }
  3775.  
  3776. }
  3777.  
  3778. }
  3779.  
  3780. public void writeKeysData(ObjectOutputStream dos) {
  3781. try {
  3782.  
  3783. // int
  3784.  
  3785. dos.writeInt(this.idsazby);
  3786.  
  3787. } catch (IOException e) {
  3788. throw new RuntimeException(e);
  3789. }
  3790.  
  3791. }
  3792.  
  3793. /**
  3794. * Fill Values data by reading ObjectInputStream.
  3795. */
  3796. public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
  3797. try {
  3798.  
  3799. int length = 0;
  3800.  
  3801. this.nazev_profese = readString(dis, ois);
  3802.  
  3803. this.hodinova_sazba = dis.readInt();
  3804.  
  3805. } catch (IOException e) {
  3806. throw new RuntimeException(e);
  3807.  
  3808. }
  3809.  
  3810. }
  3811.  
  3812. /**
  3813. * Return a byte array which represents Values data.
  3814. */
  3815. public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
  3816. try {
  3817.  
  3818. writeString(this.nazev_profese, dos, oos);
  3819.  
  3820. dos.writeInt(this.hodinova_sazba);
  3821.  
  3822. } catch (IOException e) {
  3823. throw new RuntimeException(e);
  3824. }
  3825.  
  3826. }
  3827.  
  3828. public String toString() {
  3829.  
  3830. StringBuilder sb = new StringBuilder();
  3831. sb.append(super.toString());
  3832. sb.append("[");
  3833. sb.append("idsazby=" + String.valueOf(idsazby));
  3834. sb.append(",nazev_profese=" + nazev_profese);
  3835. sb.append(",hodinova_sazba=" + String.valueOf(hodinova_sazba));
  3836. sb.append("]");
  3837.  
  3838. return sb.toString();
  3839. }
  3840.  
  3841. /**
  3842. * Compare keys
  3843. */
  3844. public int compareTo(row3Struct other) {
  3845.  
  3846. int returnValue = -1;
  3847.  
  3848. returnValue = checkNullsAndCompare(this.idsazby, other.idsazby);
  3849. if (returnValue != 0) {
  3850. return returnValue;
  3851. }
  3852.  
  3853. return returnValue;
  3854. }
  3855.  
  3856. private int checkNullsAndCompare(Object object1, Object object2) {
  3857. int returnValue = 0;
  3858. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  3859. returnValue = ((Comparable) object1).compareTo(object2);
  3860. } else if (object1 != null && object2 != null) {
  3861. returnValue = compareStrings(object1.toString(),
  3862. object2.toString());
  3863. } else if (object1 == null && object2 != null) {
  3864. returnValue = 1;
  3865. } else if (object1 != null && object2 == null) {
  3866. returnValue = -1;
  3867. } else {
  3868. returnValue = 0;
  3869. }
  3870.  
  3871. return returnValue;
  3872. }
  3873.  
  3874. private int compareStrings(String string1, String string2) {
  3875. return string1.compareTo(string2);
  3876. }
  3877.  
  3878. }
  3879.  
  3880. public void tDBInput_4Process(final java.util.Map<String, Object> globalMap)
  3881. throws TalendException {
  3882. globalMap.put("tDBInput_4_SUBPROCESS_STATE", 0);
  3883.  
  3884. final boolean execStat = this.execStat;
  3885.  
  3886. String iterateId = "";
  3887.  
  3888. String currentComponent = "";
  3889. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  3890.  
  3891. try {
  3892. // TDI-39566 avoid throwing an useless Exception
  3893. boolean resumeIt = true;
  3894. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  3895. String currentMethodName = new java.lang.Exception()
  3896. .getStackTrace()[0].getMethodName();
  3897. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  3898. }
  3899. if (resumeIt || globalResumeTicket) { // start the resume
  3900. globalResumeTicket = true;
  3901.  
  3902. row3Struct row3 = new row3Struct();
  3903.  
  3904. /**
  3905. * [tAdvancedHash_row3 begin ] start
  3906. */
  3907.  
  3908. ok_Hash.put("tAdvancedHash_row3", false);
  3909. start_Hash
  3910. .put("tAdvancedHash_row3", System.currentTimeMillis());
  3911.  
  3912. currentComponent = "tAdvancedHash_row3";
  3913.  
  3914. if (execStat) {
  3915. if (resourceMap.get("inIterateVComp") == null) {
  3916.  
  3917. runStat.updateStatOnConnection("row3" + iterateId, 0, 0);
  3918.  
  3919. }
  3920. }
  3921.  
  3922. int tos_count_tAdvancedHash_row3 = 0;
  3923.  
  3924. // connection name:row3
  3925. // source node:tDBInput_4 - inputs:(after_tDBInput_1)
  3926. // outputs:(row3,row3) | target node:tAdvancedHash_row3 -
  3927. // inputs:(row3) outputs:()
  3928. // linked node: tMap_1 - inputs:(row1,row2,row3)
  3929. // outputs:(zamestnanec,zamestnanec)
  3930.  
  3931. org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row3 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
  3932.  
  3933. org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row3Struct> tHash_Lookup_row3 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
  3934. .<row3Struct> getLookup(matchingModeEnum_row3);
  3935.  
  3936. globalMap.put("tHash_Lookup_row3", tHash_Lookup_row3);
  3937.  
  3938. /**
  3939. * [tAdvancedHash_row3 begin ] stop
  3940. */
  3941.  
  3942. /**
  3943. * [tDBInput_4 begin ] start
  3944. */
  3945.  
  3946. ok_Hash.put("tDBInput_4", false);
  3947. start_Hash.put("tDBInput_4", System.currentTimeMillis());
  3948.  
  3949. currentComponent = "tDBInput_4";
  3950.  
  3951. int tos_count_tDBInput_4 = 0;
  3952.  
  3953. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_4 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  3954. .getMSSqlGenerateTimestampUtil();
  3955.  
  3956. java.util.List<String> talendToDBList_tDBInput_4 = new java.util.ArrayList();
  3957. String[] talendToDBArray_tDBInput_4 = new String[] { "FLOAT",
  3958. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  3959. "DECIMAL IDENTITY", "REAL" };
  3960. java.util.Collections.addAll(talendToDBList_tDBInput_4,
  3961. talendToDBArray_tDBInput_4);
  3962. int nb_line_tDBInput_4 = 0;
  3963. java.sql.Connection conn_tDBInput_4 = null;
  3964. String driverClass_tDBInput_4 = "net.sourceforge.jtds.jdbc.Driver";
  3965. java.lang.Class.forName(driverClass_tDBInput_4);
  3966. String dbUser_tDBInput_4 = "tym1";
  3967.  
  3968. final String decryptedPassword_tDBInput_4 = routines.system.PasswordEncryptUtil
  3969. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  3970.  
  3971. String dbPwd_tDBInput_4 = decryptedPassword_tDBInput_4;
  3972.  
  3973. String port_tDBInput_4 = "1433";
  3974. String dbname_tDBInput_4 = "bi_zdroj01";
  3975. String url_tDBInput_4 = "jdbc:jtds:sqlserver://"
  3976. + "158.196.160.60";
  3977. if (!"".equals(port_tDBInput_4)) {
  3978. url_tDBInput_4 += ":" + "1433";
  3979. }
  3980. if (!"".equals(dbname_tDBInput_4)) {
  3981. url_tDBInput_4 += "//" + "bi_zdroj01";
  3982. }
  3983. url_tDBInput_4 += ";appName=" + projectName + ";" + "";
  3984. String dbschema_tDBInput_4 = "";
  3985.  
  3986. conn_tDBInput_4 = java.sql.DriverManager.getConnection(
  3987. url_tDBInput_4, dbUser_tDBInput_4, dbPwd_tDBInput_4);
  3988.  
  3989. java.sql.Statement stmt_tDBInput_4 = conn_tDBInput_4
  3990. .createStatement();
  3991.  
  3992. String dbquery_tDBInput_4 = "SELECT mzdove_sazby.idsazby,\n mzdove_sazby.nazev_profese,\n mzdove_sazby.hodinova_sazba\nFROM mzdove_sazby";
  3993.  
  3994. globalMap.put("tDBInput_4_QUERY", dbquery_tDBInput_4);
  3995. java.sql.ResultSet rs_tDBInput_4 = null;
  3996.  
  3997. try {
  3998. rs_tDBInput_4 = stmt_tDBInput_4
  3999. .executeQuery(dbquery_tDBInput_4);
  4000. java.sql.ResultSetMetaData rsmd_tDBInput_4 = rs_tDBInput_4
  4001. .getMetaData();
  4002. int colQtyInRs_tDBInput_4 = rsmd_tDBInput_4
  4003. .getColumnCount();
  4004.  
  4005. String tmpContent_tDBInput_4 = null;
  4006.  
  4007. while (rs_tDBInput_4.next()) {
  4008. nb_line_tDBInput_4++;
  4009.  
  4010. if (colQtyInRs_tDBInput_4 < 1) {
  4011. row3.idsazby = 0;
  4012. } else {
  4013.  
  4014. if (rs_tDBInput_4.getObject(1) != null) {
  4015. row3.idsazby = rs_tDBInput_4.getInt(1);
  4016. } else {
  4017. throw new RuntimeException(
  4018. "Null value in non-Nullable column");
  4019. }
  4020. }
  4021. if (colQtyInRs_tDBInput_4 < 2) {
  4022. row3.nazev_profese = null;
  4023. } else {
  4024.  
  4025. tmpContent_tDBInput_4 = rs_tDBInput_4.getString(2);
  4026. if (tmpContent_tDBInput_4 != null) {
  4027. if (talendToDBList_tDBInput_4
  4028. .contains(rsmd_tDBInput_4
  4029. .getColumnTypeName(2)
  4030. .toUpperCase(
  4031. java.util.Locale.ENGLISH))) {
  4032. row3.nazev_profese = FormatterUtils
  4033. .formatUnwithE(tmpContent_tDBInput_4);
  4034. } else {
  4035. row3.nazev_profese = tmpContent_tDBInput_4;
  4036. }
  4037. } else {
  4038. row3.nazev_profese = null;
  4039. }
  4040. }
  4041. if (colQtyInRs_tDBInput_4 < 3) {
  4042. row3.hodinova_sazba = 0;
  4043. } else {
  4044.  
  4045. if (rs_tDBInput_4.getObject(3) != null) {
  4046. row3.hodinova_sazba = rs_tDBInput_4.getInt(3);
  4047. } else {
  4048. throw new RuntimeException(
  4049. "Null value in non-Nullable column");
  4050. }
  4051. }
  4052.  
  4053. /**
  4054. * [tDBInput_4 begin ] stop
  4055. */
  4056.  
  4057. /**
  4058. * [tDBInput_4 main ] start
  4059. */
  4060.  
  4061. currentComponent = "tDBInput_4";
  4062.  
  4063. tos_count_tDBInput_4++;
  4064.  
  4065. /**
  4066. * [tDBInput_4 main ] stop
  4067. */
  4068.  
  4069. /**
  4070. * [tDBInput_4 process_data_begin ] start
  4071. */
  4072.  
  4073. currentComponent = "tDBInput_4";
  4074.  
  4075. /**
  4076. * [tDBInput_4 process_data_begin ] stop
  4077. */
  4078.  
  4079. /**
  4080. * [tAdvancedHash_row3 main ] start
  4081. */
  4082.  
  4083. currentComponent = "tAdvancedHash_row3";
  4084.  
  4085. // row3
  4086. // row3
  4087.  
  4088. if (execStat) {
  4089. runStat.updateStatOnConnection("row3" + iterateId,
  4090. 1, 1);
  4091. }
  4092.  
  4093. row3Struct row3_HashRow = new row3Struct();
  4094.  
  4095. row3_HashRow.idsazby = row3.idsazby;
  4096.  
  4097. row3_HashRow.nazev_profese = row3.nazev_profese;
  4098.  
  4099. row3_HashRow.hodinova_sazba = row3.hodinova_sazba;
  4100.  
  4101. tHash_Lookup_row3.put(row3_HashRow);
  4102.  
  4103. tos_count_tAdvancedHash_row3++;
  4104.  
  4105. /**
  4106. * [tAdvancedHash_row3 main ] stop
  4107. */
  4108.  
  4109. /**
  4110. * [tAdvancedHash_row3 process_data_begin ] start
  4111. */
  4112.  
  4113. currentComponent = "tAdvancedHash_row3";
  4114.  
  4115. /**
  4116. * [tAdvancedHash_row3 process_data_begin ] stop
  4117. */
  4118.  
  4119. /**
  4120. * [tAdvancedHash_row3 process_data_end ] start
  4121. */
  4122.  
  4123. currentComponent = "tAdvancedHash_row3";
  4124.  
  4125. /**
  4126. * [tAdvancedHash_row3 process_data_end ] stop
  4127. */
  4128.  
  4129. /**
  4130. * [tDBInput_4 process_data_end ] start
  4131. */
  4132.  
  4133. currentComponent = "tDBInput_4";
  4134.  
  4135. /**
  4136. * [tDBInput_4 process_data_end ] stop
  4137. */
  4138.  
  4139. /**
  4140. * [tDBInput_4 end ] start
  4141. */
  4142.  
  4143. currentComponent = "tDBInput_4";
  4144.  
  4145. }
  4146. } finally {
  4147. if (rs_tDBInput_4 != null) {
  4148. rs_tDBInput_4.close();
  4149. }
  4150. if (stmt_tDBInput_4 != null) {
  4151. stmt_tDBInput_4.close();
  4152. }
  4153. if (conn_tDBInput_4 != null && !conn_tDBInput_4.isClosed()) {
  4154.  
  4155. conn_tDBInput_4.close();
  4156.  
  4157. }
  4158. }
  4159. globalMap.put("tDBInput_4_NB_LINE", nb_line_tDBInput_4);
  4160.  
  4161. ok_Hash.put("tDBInput_4", true);
  4162. end_Hash.put("tDBInput_4", System.currentTimeMillis());
  4163.  
  4164. /**
  4165. * [tDBInput_4 end ] stop
  4166. */
  4167.  
  4168. /**
  4169. * [tAdvancedHash_row3 end ] start
  4170. */
  4171.  
  4172. currentComponent = "tAdvancedHash_row3";
  4173.  
  4174. tHash_Lookup_row3.endPut();
  4175.  
  4176. if (execStat) {
  4177. if (resourceMap.get("inIterateVComp") == null
  4178. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  4179. runStat.updateStatOnConnection("row3" + iterateId, 2, 0);
  4180. }
  4181. }
  4182.  
  4183. ok_Hash.put("tAdvancedHash_row3", true);
  4184. end_Hash.put("tAdvancedHash_row3", System.currentTimeMillis());
  4185.  
  4186. /**
  4187. * [tAdvancedHash_row3 end ] stop
  4188. */
  4189.  
  4190. }// end the resume
  4191.  
  4192. } catch (java.lang.Exception e) {
  4193.  
  4194. TalendException te = new TalendException(e, currentComponent,
  4195. globalMap);
  4196.  
  4197. throw te;
  4198. } catch (java.lang.Error error) {
  4199.  
  4200. runStat.stopThreadStat();
  4201.  
  4202. throw error;
  4203. } finally {
  4204.  
  4205. try {
  4206.  
  4207. /**
  4208. * [tDBInput_4 finally ] start
  4209. */
  4210.  
  4211. currentComponent = "tDBInput_4";
  4212.  
  4213. /**
  4214. * [tDBInput_4 finally ] stop
  4215. */
  4216.  
  4217. /**
  4218. * [tAdvancedHash_row3 finally ] start
  4219. */
  4220.  
  4221. currentComponent = "tAdvancedHash_row3";
  4222.  
  4223. /**
  4224. * [tAdvancedHash_row3 finally ] stop
  4225. */
  4226.  
  4227. } catch (java.lang.Exception e) {
  4228. // ignore
  4229. } catch (java.lang.Error error) {
  4230. // ignore
  4231. }
  4232. resourceMap = null;
  4233. }
  4234.  
  4235. globalMap.put("tDBInput_4_SUBPROCESS_STATE", 1);
  4236. }
  4237.  
  4238. public static class row5Struct implements
  4239. routines.system.IPersistableComparableLookupRow<row5Struct> {
  4240. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  4241. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  4242. protected static final int DEFAULT_HASHCODE = 1;
  4243. protected static final int PRIME = 31;
  4244. protected int hashCode = DEFAULT_HASHCODE;
  4245. public boolean hashCodeDirty = true;
  4246.  
  4247. public String loopKey;
  4248.  
  4249. public int idpredpis;
  4250.  
  4251. public int getIdpredpis() {
  4252. return this.idpredpis;
  4253. }
  4254.  
  4255. public int idzamestnanci;
  4256.  
  4257. public int getIdzamestnanci() {
  4258. return this.idzamestnanci;
  4259. }
  4260.  
  4261. public Short rok;
  4262.  
  4263. public Short getRok() {
  4264. return this.rok;
  4265. }
  4266.  
  4267. public Short dovolena_celkem;
  4268.  
  4269. public Short getDovolena_celkem() {
  4270. return this.dovolena_celkem;
  4271. }
  4272.  
  4273. @Override
  4274. public int hashCode() {
  4275. if (this.hashCodeDirty) {
  4276. final int prime = PRIME;
  4277. int result = DEFAULT_HASHCODE;
  4278.  
  4279. result = prime * result + (int) this.idzamestnanci;
  4280.  
  4281. result = prime * result
  4282. + ((this.rok == null) ? 0 : this.rok.hashCode());
  4283.  
  4284. this.hashCode = result;
  4285. this.hashCodeDirty = false;
  4286. }
  4287. return this.hashCode;
  4288. }
  4289.  
  4290. @Override
  4291. public boolean equals(Object obj) {
  4292. if (this == obj)
  4293. return true;
  4294. if (obj == null)
  4295. return false;
  4296. if (getClass() != obj.getClass())
  4297. return false;
  4298. final row5Struct other = (row5Struct) obj;
  4299.  
  4300. if (this.idzamestnanci != other.idzamestnanci)
  4301. return false;
  4302.  
  4303. if (this.rok == null) {
  4304. if (other.rok != null)
  4305. return false;
  4306.  
  4307. } else if (!this.rok.equals(other.rok))
  4308.  
  4309. return false;
  4310.  
  4311. return true;
  4312. }
  4313.  
  4314. public void copyDataTo(row5Struct other) {
  4315.  
  4316. other.idpredpis = this.idpredpis;
  4317. other.idzamestnanci = this.idzamestnanci;
  4318. other.rok = this.rok;
  4319. other.dovolena_celkem = this.dovolena_celkem;
  4320.  
  4321. }
  4322.  
  4323. public void copyKeysDataTo(row5Struct other) {
  4324.  
  4325. other.idzamestnanci = this.idzamestnanci;
  4326. other.rok = this.rok;
  4327.  
  4328. }
  4329.  
  4330. public void readKeysData(ObjectInputStream dis) {
  4331.  
  4332. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  4333.  
  4334. try {
  4335.  
  4336. int length = 0;
  4337.  
  4338. this.idzamestnanci = dis.readInt();
  4339.  
  4340. length = dis.readByte();
  4341. if (length == -1) {
  4342. this.rok = null;
  4343. } else {
  4344. this.rok = dis.readShort();
  4345. }
  4346.  
  4347. } catch (IOException e) {
  4348. throw new RuntimeException(e);
  4349.  
  4350. }
  4351.  
  4352. }
  4353.  
  4354. }
  4355.  
  4356. public void writeKeysData(ObjectOutputStream dos) {
  4357. try {
  4358.  
  4359. // int
  4360.  
  4361. dos.writeInt(this.idzamestnanci);
  4362.  
  4363. // Short
  4364.  
  4365. if (this.rok == null) {
  4366. dos.writeByte(-1);
  4367. } else {
  4368. dos.writeByte(0);
  4369. dos.writeShort(this.rok);
  4370. }
  4371.  
  4372. } catch (IOException e) {
  4373. throw new RuntimeException(e);
  4374. }
  4375.  
  4376. }
  4377.  
  4378. /**
  4379. * Fill Values data by reading ObjectInputStream.
  4380. */
  4381. public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
  4382. try {
  4383.  
  4384. int length = 0;
  4385.  
  4386. this.idpredpis = dis.readInt();
  4387.  
  4388. length = dis.readByte();
  4389. if (length == -1) {
  4390. this.dovolena_celkem = null;
  4391. } else {
  4392. this.dovolena_celkem = dis.readShort();
  4393. }
  4394.  
  4395. } catch (IOException e) {
  4396. throw new RuntimeException(e);
  4397.  
  4398. }
  4399.  
  4400. }
  4401.  
  4402. /**
  4403. * Return a byte array which represents Values data.
  4404. */
  4405. public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
  4406. try {
  4407.  
  4408. dos.writeInt(this.idpredpis);
  4409.  
  4410. if (this.dovolena_celkem == null) {
  4411. dos.writeByte(-1);
  4412. } else {
  4413. dos.writeByte(0);
  4414. dos.writeShort(this.dovolena_celkem);
  4415. }
  4416.  
  4417. } catch (IOException e) {
  4418. throw new RuntimeException(e);
  4419. }
  4420.  
  4421. }
  4422.  
  4423. public String toString() {
  4424.  
  4425. StringBuilder sb = new StringBuilder();
  4426. sb.append(super.toString());
  4427. sb.append("[");
  4428. sb.append("idpredpis=" + String.valueOf(idpredpis));
  4429. sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
  4430. sb.append(",rok=" + String.valueOf(rok));
  4431. sb.append(",dovolena_celkem=" + String.valueOf(dovolena_celkem));
  4432. sb.append("]");
  4433.  
  4434. return sb.toString();
  4435. }
  4436.  
  4437. /**
  4438. * Compare keys
  4439. */
  4440. public int compareTo(row5Struct other) {
  4441.  
  4442. int returnValue = -1;
  4443.  
  4444. returnValue = checkNullsAndCompare(this.idzamestnanci,
  4445. other.idzamestnanci);
  4446. if (returnValue != 0) {
  4447. return returnValue;
  4448. }
  4449.  
  4450. returnValue = checkNullsAndCompare(this.rok, other.rok);
  4451. if (returnValue != 0) {
  4452. return returnValue;
  4453. }
  4454.  
  4455. return returnValue;
  4456. }
  4457.  
  4458. private int checkNullsAndCompare(Object object1, Object object2) {
  4459. int returnValue = 0;
  4460. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  4461. returnValue = ((Comparable) object1).compareTo(object2);
  4462. } else if (object1 != null && object2 != null) {
  4463. returnValue = compareStrings(object1.toString(),
  4464. object2.toString());
  4465. } else if (object1 == null && object2 != null) {
  4466. returnValue = 1;
  4467. } else if (object1 != null && object2 == null) {
  4468. returnValue = -1;
  4469. } else {
  4470. returnValue = 0;
  4471. }
  4472.  
  4473. return returnValue;
  4474. }
  4475.  
  4476. private int compareStrings(String string1, String string2) {
  4477. return string1.compareTo(string2);
  4478. }
  4479.  
  4480. }
  4481.  
  4482. public void tDBInput_5Process(final java.util.Map<String, Object> globalMap)
  4483. throws TalendException {
  4484. globalMap.put("tDBInput_5_SUBPROCESS_STATE", 0);
  4485.  
  4486. final boolean execStat = this.execStat;
  4487.  
  4488. String iterateId = "";
  4489.  
  4490. String currentComponent = "";
  4491. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  4492.  
  4493. try {
  4494. // TDI-39566 avoid throwing an useless Exception
  4495. boolean resumeIt = true;
  4496. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  4497. String currentMethodName = new java.lang.Exception()
  4498. .getStackTrace()[0].getMethodName();
  4499. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  4500. }
  4501. if (resumeIt || globalResumeTicket) { // start the resume
  4502. globalResumeTicket = true;
  4503.  
  4504. row5Struct row5 = new row5Struct();
  4505.  
  4506. /**
  4507. * [tAdvancedHash_row5 begin ] start
  4508. */
  4509.  
  4510. ok_Hash.put("tAdvancedHash_row5", false);
  4511. start_Hash
  4512. .put("tAdvancedHash_row5", System.currentTimeMillis());
  4513.  
  4514. currentComponent = "tAdvancedHash_row5";
  4515.  
  4516. if (execStat) {
  4517. if (resourceMap.get("inIterateVComp") == null) {
  4518.  
  4519. runStat.updateStatOnConnection("row5" + iterateId, 0, 0);
  4520.  
  4521. }
  4522. }
  4523.  
  4524. int tos_count_tAdvancedHash_row5 = 0;
  4525.  
  4526. // connection name:row5
  4527. // source node:tDBInput_5 - inputs:(after_tDBInput_6)
  4528. // outputs:(row5,row5) | target node:tAdvancedHash_row5 -
  4529. // inputs:(row5) outputs:()
  4530. // linked node: tMap_2 -
  4531. // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
  4532. // outputs:(out2)
  4533.  
  4534. org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row5 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
  4535.  
  4536. org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row5Struct> tHash_Lookup_row5 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
  4537. .<row5Struct> getLookup(matchingModeEnum_row5);
  4538.  
  4539. globalMap.put("tHash_Lookup_row5", tHash_Lookup_row5);
  4540.  
  4541. /**
  4542. * [tAdvancedHash_row5 begin ] stop
  4543. */
  4544.  
  4545. /**
  4546. * [tDBInput_5 begin ] start
  4547. */
  4548.  
  4549. ok_Hash.put("tDBInput_5", false);
  4550. start_Hash.put("tDBInput_5", System.currentTimeMillis());
  4551.  
  4552. currentComponent = "tDBInput_5";
  4553.  
  4554. int tos_count_tDBInput_5 = 0;
  4555.  
  4556. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_5 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  4557. .getMSSqlGenerateTimestampUtil();
  4558.  
  4559. java.util.List<String> talendToDBList_tDBInput_5 = new java.util.ArrayList();
  4560. String[] talendToDBArray_tDBInput_5 = new String[] { "FLOAT",
  4561. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  4562. "DECIMAL IDENTITY", "REAL" };
  4563. java.util.Collections.addAll(talendToDBList_tDBInput_5,
  4564. talendToDBArray_tDBInput_5);
  4565. int nb_line_tDBInput_5 = 0;
  4566. java.sql.Connection conn_tDBInput_5 = null;
  4567. String driverClass_tDBInput_5 = "net.sourceforge.jtds.jdbc.Driver";
  4568. java.lang.Class.forName(driverClass_tDBInput_5);
  4569. String dbUser_tDBInput_5 = "tym1";
  4570.  
  4571. final String decryptedPassword_tDBInput_5 = routines.system.PasswordEncryptUtil
  4572. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  4573.  
  4574. String dbPwd_tDBInput_5 = decryptedPassword_tDBInput_5;
  4575.  
  4576. String port_tDBInput_5 = "1433";
  4577. String dbname_tDBInput_5 = "bi_zdroj01";
  4578. String url_tDBInput_5 = "jdbc:jtds:sqlserver://"
  4579. + "158.196.160.60";
  4580. if (!"".equals(port_tDBInput_5)) {
  4581. url_tDBInput_5 += ":" + "1433";
  4582. }
  4583. if (!"".equals(dbname_tDBInput_5)) {
  4584. url_tDBInput_5 += "//" + "bi_zdroj01";
  4585. }
  4586. url_tDBInput_5 += ";appName=" + projectName + ";" + "";
  4587. String dbschema_tDBInput_5 = "";
  4588.  
  4589. conn_tDBInput_5 = java.sql.DriverManager.getConnection(
  4590. url_tDBInput_5, dbUser_tDBInput_5, dbPwd_tDBInput_5);
  4591.  
  4592. java.sql.Statement stmt_tDBInput_5 = conn_tDBInput_5
  4593. .createStatement();
  4594.  
  4595. String dbquery_tDBInput_5 = "SELECT predpis_dovolene.idpredpis,\n predpis_dovolene.idzamestnanci,\n predpis_dovolene.rok,\n predpis_dovolene.dovolen"
  4596. + "a_celkem\nFROM predpis_dovolene";
  4597.  
  4598. globalMap.put("tDBInput_5_QUERY", dbquery_tDBInput_5);
  4599. java.sql.ResultSet rs_tDBInput_5 = null;
  4600.  
  4601. try {
  4602. rs_tDBInput_5 = stmt_tDBInput_5
  4603. .executeQuery(dbquery_tDBInput_5);
  4604. java.sql.ResultSetMetaData rsmd_tDBInput_5 = rs_tDBInput_5
  4605. .getMetaData();
  4606. int colQtyInRs_tDBInput_5 = rsmd_tDBInput_5
  4607. .getColumnCount();
  4608.  
  4609. String tmpContent_tDBInput_5 = null;
  4610.  
  4611. while (rs_tDBInput_5.next()) {
  4612. nb_line_tDBInput_5++;
  4613.  
  4614. if (colQtyInRs_tDBInput_5 < 1) {
  4615. row5.idpredpis = 0;
  4616. } else {
  4617.  
  4618. if (rs_tDBInput_5.getObject(1) != null) {
  4619. row5.idpredpis = rs_tDBInput_5.getInt(1);
  4620. } else {
  4621. throw new RuntimeException(
  4622. "Null value in non-Nullable column");
  4623. }
  4624. }
  4625. if (colQtyInRs_tDBInput_5 < 2) {
  4626. row5.idzamestnanci = 0;
  4627. } else {
  4628.  
  4629. if (rs_tDBInput_5.getObject(2) != null) {
  4630. row5.idzamestnanci = rs_tDBInput_5.getInt(2);
  4631. } else {
  4632. throw new RuntimeException(
  4633. "Null value in non-Nullable column");
  4634. }
  4635. }
  4636. if (colQtyInRs_tDBInput_5 < 3) {
  4637. row5.rok = null;
  4638. } else {
  4639.  
  4640. if (rs_tDBInput_5.getObject(3) != null) {
  4641. row5.rok = rs_tDBInput_5.getShort(3);
  4642. } else {
  4643. row5.rok = null;
  4644. }
  4645. }
  4646. if (colQtyInRs_tDBInput_5 < 4) {
  4647. row5.dovolena_celkem = null;
  4648. } else {
  4649.  
  4650. if (rs_tDBInput_5.getObject(4) != null) {
  4651. row5.dovolena_celkem = rs_tDBInput_5
  4652. .getShort(4);
  4653. } else {
  4654. row5.dovolena_celkem = null;
  4655. }
  4656. }
  4657.  
  4658. /**
  4659. * [tDBInput_5 begin ] stop
  4660. */
  4661.  
  4662. /**
  4663. * [tDBInput_5 main ] start
  4664. */
  4665.  
  4666. currentComponent = "tDBInput_5";
  4667.  
  4668. tos_count_tDBInput_5++;
  4669.  
  4670. /**
  4671. * [tDBInput_5 main ] stop
  4672. */
  4673.  
  4674. /**
  4675. * [tDBInput_5 process_data_begin ] start
  4676. */
  4677.  
  4678. currentComponent = "tDBInput_5";
  4679.  
  4680. /**
  4681. * [tDBInput_5 process_data_begin ] stop
  4682. */
  4683.  
  4684. /**
  4685. * [tAdvancedHash_row5 main ] start
  4686. */
  4687.  
  4688. currentComponent = "tAdvancedHash_row5";
  4689.  
  4690. // row5
  4691. // row5
  4692.  
  4693. if (execStat) {
  4694. runStat.updateStatOnConnection("row5" + iterateId,
  4695. 1, 1);
  4696. }
  4697.  
  4698. row5Struct row5_HashRow = new row5Struct();
  4699.  
  4700. row5_HashRow.idpredpis = row5.idpredpis;
  4701.  
  4702. row5_HashRow.idzamestnanci = row5.idzamestnanci;
  4703.  
  4704. row5_HashRow.rok = row5.rok;
  4705.  
  4706. row5_HashRow.dovolena_celkem = row5.dovolena_celkem;
  4707.  
  4708. tHash_Lookup_row5.put(row5_HashRow);
  4709.  
  4710. tos_count_tAdvancedHash_row5++;
  4711.  
  4712. /**
  4713. * [tAdvancedHash_row5 main ] stop
  4714. */
  4715.  
  4716. /**
  4717. * [tAdvancedHash_row5 process_data_begin ] start
  4718. */
  4719.  
  4720. currentComponent = "tAdvancedHash_row5";
  4721.  
  4722. /**
  4723. * [tAdvancedHash_row5 process_data_begin ] stop
  4724. */
  4725.  
  4726. /**
  4727. * [tAdvancedHash_row5 process_data_end ] start
  4728. */
  4729.  
  4730. currentComponent = "tAdvancedHash_row5";
  4731.  
  4732. /**
  4733. * [tAdvancedHash_row5 process_data_end ] stop
  4734. */
  4735.  
  4736. /**
  4737. * [tDBInput_5 process_data_end ] start
  4738. */
  4739.  
  4740. currentComponent = "tDBInput_5";
  4741.  
  4742. /**
  4743. * [tDBInput_5 process_data_end ] stop
  4744. */
  4745.  
  4746. /**
  4747. * [tDBInput_5 end ] start
  4748. */
  4749.  
  4750. currentComponent = "tDBInput_5";
  4751.  
  4752. }
  4753. } finally {
  4754. if (rs_tDBInput_5 != null) {
  4755. rs_tDBInput_5.close();
  4756. }
  4757. if (stmt_tDBInput_5 != null) {
  4758. stmt_tDBInput_5.close();
  4759. }
  4760. if (conn_tDBInput_5 != null && !conn_tDBInput_5.isClosed()) {
  4761.  
  4762. conn_tDBInput_5.close();
  4763.  
  4764. }
  4765. }
  4766. globalMap.put("tDBInput_5_NB_LINE", nb_line_tDBInput_5);
  4767.  
  4768. ok_Hash.put("tDBInput_5", true);
  4769. end_Hash.put("tDBInput_5", System.currentTimeMillis());
  4770.  
  4771. /**
  4772. * [tDBInput_5 end ] stop
  4773. */
  4774.  
  4775. /**
  4776. * [tAdvancedHash_row5 end ] start
  4777. */
  4778.  
  4779. currentComponent = "tAdvancedHash_row5";
  4780.  
  4781. tHash_Lookup_row5.endPut();
  4782.  
  4783. if (execStat) {
  4784. if (resourceMap.get("inIterateVComp") == null
  4785. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  4786. runStat.updateStatOnConnection("row5" + iterateId, 2, 0);
  4787. }
  4788. }
  4789.  
  4790. ok_Hash.put("tAdvancedHash_row5", true);
  4791. end_Hash.put("tAdvancedHash_row5", System.currentTimeMillis());
  4792.  
  4793. /**
  4794. * [tAdvancedHash_row5 end ] stop
  4795. */
  4796.  
  4797. }// end the resume
  4798.  
  4799. } catch (java.lang.Exception e) {
  4800.  
  4801. TalendException te = new TalendException(e, currentComponent,
  4802. globalMap);
  4803.  
  4804. throw te;
  4805. } catch (java.lang.Error error) {
  4806.  
  4807. runStat.stopThreadStat();
  4808.  
  4809. throw error;
  4810. } finally {
  4811.  
  4812. try {
  4813.  
  4814. /**
  4815. * [tDBInput_5 finally ] start
  4816. */
  4817.  
  4818. currentComponent = "tDBInput_5";
  4819.  
  4820. /**
  4821. * [tDBInput_5 finally ] stop
  4822. */
  4823.  
  4824. /**
  4825. * [tAdvancedHash_row5 finally ] start
  4826. */
  4827.  
  4828. currentComponent = "tAdvancedHash_row5";
  4829.  
  4830. /**
  4831. * [tAdvancedHash_row5 finally ] stop
  4832. */
  4833.  
  4834. } catch (java.lang.Exception e) {
  4835. // ignore
  4836. } catch (java.lang.Error error) {
  4837. // ignore
  4838. }
  4839. resourceMap = null;
  4840. }
  4841.  
  4842. globalMap.put("tDBInput_5_SUBPROCESS_STATE", 1);
  4843. }
  4844.  
  4845. public static class out2Struct implements
  4846. routines.system.IPersistableRow<out2Struct> {
  4847. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  4848. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  4849. protected static final int DEFAULT_HASHCODE = 1;
  4850. protected static final int PRIME = 31;
  4851. protected int hashCode = DEFAULT_HASHCODE;
  4852. public boolean hashCodeDirty = true;
  4853.  
  4854. public String loopKey;
  4855.  
  4856. public BigDecimal odpracovano_hodin;
  4857.  
  4858. public BigDecimal getOdpracovano_hodin() {
  4859. return this.odpracovano_hodin;
  4860. }
  4861.  
  4862. public BigDecimal prescasy;
  4863.  
  4864. public BigDecimal getPrescasy() {
  4865. return this.prescasy;
  4866. }
  4867.  
  4868. public BigDecimal celkova_mzda;
  4869.  
  4870. public BigDecimal getCelkova_mzda() {
  4871. return this.celkova_mzda;
  4872. }
  4873.  
  4874. public BigDecimal dovolena_vybrana;
  4875.  
  4876. public BigDecimal getDovolena_vybrana() {
  4877. return this.dovolena_vybrana;
  4878. }
  4879.  
  4880. public BigDecimal dovolena_zustatek;
  4881.  
  4882. public BigDecimal getDovolena_zustatek() {
  4883. return this.dovolena_zustatek;
  4884. }
  4885.  
  4886. public int dovolena_celkem;
  4887.  
  4888. public int getDovolena_celkem() {
  4889. return this.dovolena_celkem;
  4890. }
  4891.  
  4892. public int DIM_zamestnanci_idzamestnanci;
  4893.  
  4894. public int getDIM_zamestnanci_idzamestnanci() {
  4895. return this.DIM_zamestnanci_idzamestnanci;
  4896. }
  4897.  
  4898. public int DIM_pracoviste_idpracoviste;
  4899.  
  4900. public int getDIM_pracoviste_idpracoviste() {
  4901. return this.DIM_pracoviste_idpracoviste;
  4902. }
  4903.  
  4904. public int DIM_kalendar_idkalendare;
  4905.  
  4906. public int getDIM_kalendar_idkalendare() {
  4907. return this.DIM_kalendar_idkalendare;
  4908. }
  4909.  
  4910. public int DIM_mzdove_sazby_idsazby;
  4911.  
  4912. public int getDIM_mzdove_sazby_idsazby() {
  4913. return this.DIM_mzdove_sazby_idsazby;
  4914. }
  4915.  
  4916. @Override
  4917. public int hashCode() {
  4918. if (this.hashCodeDirty) {
  4919. final int prime = PRIME;
  4920. int result = DEFAULT_HASHCODE;
  4921.  
  4922. result = prime * result
  4923. + (int) this.DIM_zamestnanci_idzamestnanci;
  4924.  
  4925. result = prime * result
  4926. + (int) this.DIM_pracoviste_idpracoviste;
  4927.  
  4928. result = prime * result + (int) this.DIM_kalendar_idkalendare;
  4929.  
  4930. result = prime * result + (int) this.DIM_mzdove_sazby_idsazby;
  4931.  
  4932. this.hashCode = result;
  4933. this.hashCodeDirty = false;
  4934. }
  4935. return this.hashCode;
  4936. }
  4937.  
  4938. @Override
  4939. public boolean equals(Object obj) {
  4940. if (this == obj)
  4941. return true;
  4942. if (obj == null)
  4943. return false;
  4944. if (getClass() != obj.getClass())
  4945. return false;
  4946. final out2Struct other = (out2Struct) obj;
  4947.  
  4948. if (this.DIM_zamestnanci_idzamestnanci != other.DIM_zamestnanci_idzamestnanci)
  4949. return false;
  4950.  
  4951. if (this.DIM_pracoviste_idpracoviste != other.DIM_pracoviste_idpracoviste)
  4952. return false;
  4953.  
  4954. if (this.DIM_kalendar_idkalendare != other.DIM_kalendar_idkalendare)
  4955. return false;
  4956.  
  4957. if (this.DIM_mzdove_sazby_idsazby != other.DIM_mzdove_sazby_idsazby)
  4958. return false;
  4959.  
  4960. return true;
  4961. }
  4962.  
  4963. public void copyDataTo(out2Struct other) {
  4964.  
  4965. other.odpracovano_hodin = this.odpracovano_hodin;
  4966. other.prescasy = this.prescasy;
  4967. other.celkova_mzda = this.celkova_mzda;
  4968. other.dovolena_vybrana = this.dovolena_vybrana;
  4969. other.dovolena_zustatek = this.dovolena_zustatek;
  4970. other.dovolena_celkem = this.dovolena_celkem;
  4971. other.DIM_zamestnanci_idzamestnanci = this.DIM_zamestnanci_idzamestnanci;
  4972. other.DIM_pracoviste_idpracoviste = this.DIM_pracoviste_idpracoviste;
  4973. other.DIM_kalendar_idkalendare = this.DIM_kalendar_idkalendare;
  4974. other.DIM_mzdove_sazby_idsazby = this.DIM_mzdove_sazby_idsazby;
  4975.  
  4976. }
  4977.  
  4978. public void copyKeysDataTo(out2Struct other) {
  4979.  
  4980. other.DIM_zamestnanci_idzamestnanci = this.DIM_zamestnanci_idzamestnanci;
  4981. other.DIM_pracoviste_idpracoviste = this.DIM_pracoviste_idpracoviste;
  4982. other.DIM_kalendar_idkalendare = this.DIM_kalendar_idkalendare;
  4983. other.DIM_mzdove_sazby_idsazby = this.DIM_mzdove_sazby_idsazby;
  4984.  
  4985. }
  4986.  
  4987. public void readData(ObjectInputStream dis) {
  4988.  
  4989. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  4990.  
  4991. try {
  4992.  
  4993. int length = 0;
  4994.  
  4995. this.odpracovano_hodin = (BigDecimal) dis.readObject();
  4996.  
  4997. this.prescasy = (BigDecimal) dis.readObject();
  4998.  
  4999. this.celkova_mzda = (BigDecimal) dis.readObject();
  5000.  
  5001. this.dovolena_vybrana = (BigDecimal) dis.readObject();
  5002.  
  5003. this.dovolena_zustatek = (BigDecimal) dis.readObject();
  5004.  
  5005. this.dovolena_celkem = dis.readInt();
  5006.  
  5007. this.DIM_zamestnanci_idzamestnanci = dis.readInt();
  5008.  
  5009. this.DIM_pracoviste_idpracoviste = dis.readInt();
  5010.  
  5011. this.DIM_kalendar_idkalendare = dis.readInt();
  5012.  
  5013. this.DIM_mzdove_sazby_idsazby = dis.readInt();
  5014.  
  5015. } catch (IOException e) {
  5016. throw new RuntimeException(e);
  5017.  
  5018. } catch (ClassNotFoundException eCNFE) {
  5019. throw new RuntimeException(eCNFE);
  5020.  
  5021. }
  5022.  
  5023. }
  5024.  
  5025. }
  5026.  
  5027. public void writeData(ObjectOutputStream dos) {
  5028. try {
  5029.  
  5030. // BigDecimal
  5031.  
  5032. dos.writeObject(this.odpracovano_hodin);
  5033.  
  5034. // BigDecimal
  5035.  
  5036. dos.writeObject(this.prescasy);
  5037.  
  5038. // BigDecimal
  5039.  
  5040. dos.writeObject(this.celkova_mzda);
  5041.  
  5042. // BigDecimal
  5043.  
  5044. dos.writeObject(this.dovolena_vybrana);
  5045.  
  5046. // BigDecimal
  5047.  
  5048. dos.writeObject(this.dovolena_zustatek);
  5049.  
  5050. // int
  5051.  
  5052. dos.writeInt(this.dovolena_celkem);
  5053.  
  5054. // int
  5055.  
  5056. dos.writeInt(this.DIM_zamestnanci_idzamestnanci);
  5057.  
  5058. // int
  5059.  
  5060. dos.writeInt(this.DIM_pracoviste_idpracoviste);
  5061.  
  5062. // int
  5063.  
  5064. dos.writeInt(this.DIM_kalendar_idkalendare);
  5065.  
  5066. // int
  5067.  
  5068. dos.writeInt(this.DIM_mzdove_sazby_idsazby);
  5069.  
  5070. } catch (IOException e) {
  5071. throw new RuntimeException(e);
  5072. }
  5073.  
  5074. }
  5075.  
  5076. public String toString() {
  5077.  
  5078. StringBuilder sb = new StringBuilder();
  5079. sb.append(super.toString());
  5080. sb.append("[");
  5081. sb.append("odpracovano_hodin=" + String.valueOf(odpracovano_hodin));
  5082. sb.append(",prescasy=" + String.valueOf(prescasy));
  5083. sb.append(",celkova_mzda=" + String.valueOf(celkova_mzda));
  5084. sb.append(",dovolena_vybrana=" + String.valueOf(dovolena_vybrana));
  5085. sb.append(",dovolena_zustatek=" + String.valueOf(dovolena_zustatek));
  5086. sb.append(",dovolena_celkem=" + String.valueOf(dovolena_celkem));
  5087. sb.append(",DIM_zamestnanci_idzamestnanci="
  5088. + String.valueOf(DIM_zamestnanci_idzamestnanci));
  5089. sb.append(",DIM_pracoviste_idpracoviste="
  5090. + String.valueOf(DIM_pracoviste_idpracoviste));
  5091. sb.append(",DIM_kalendar_idkalendare="
  5092. + String.valueOf(DIM_kalendar_idkalendare));
  5093. sb.append(",DIM_mzdove_sazby_idsazby="
  5094. + String.valueOf(DIM_mzdove_sazby_idsazby));
  5095. sb.append("]");
  5096.  
  5097. return sb.toString();
  5098. }
  5099.  
  5100. /**
  5101. * Compare keys
  5102. */
  5103. public int compareTo(out2Struct other) {
  5104.  
  5105. int returnValue = -1;
  5106.  
  5107. returnValue = checkNullsAndCompare(
  5108. this.DIM_zamestnanci_idzamestnanci,
  5109. other.DIM_zamestnanci_idzamestnanci);
  5110. if (returnValue != 0) {
  5111. return returnValue;
  5112. }
  5113.  
  5114. returnValue = checkNullsAndCompare(
  5115. this.DIM_pracoviste_idpracoviste,
  5116. other.DIM_pracoviste_idpracoviste);
  5117. if (returnValue != 0) {
  5118. return returnValue;
  5119. }
  5120.  
  5121. returnValue = checkNullsAndCompare(this.DIM_kalendar_idkalendare,
  5122. other.DIM_kalendar_idkalendare);
  5123. if (returnValue != 0) {
  5124. return returnValue;
  5125. }
  5126.  
  5127. returnValue = checkNullsAndCompare(this.DIM_mzdove_sazby_idsazby,
  5128. other.DIM_mzdove_sazby_idsazby);
  5129. if (returnValue != 0) {
  5130. return returnValue;
  5131. }
  5132.  
  5133. return returnValue;
  5134. }
  5135.  
  5136. private int checkNullsAndCompare(Object object1, Object object2) {
  5137. int returnValue = 0;
  5138. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  5139. returnValue = ((Comparable) object1).compareTo(object2);
  5140. } else if (object1 != null && object2 != null) {
  5141. returnValue = compareStrings(object1.toString(),
  5142. object2.toString());
  5143. } else if (object1 == null && object2 != null) {
  5144. returnValue = 1;
  5145. } else if (object1 != null && object2 == null) {
  5146. returnValue = -1;
  5147. } else {
  5148. returnValue = 0;
  5149. }
  5150.  
  5151. return returnValue;
  5152. }
  5153.  
  5154. private int compareStrings(String string1, String string2) {
  5155. return string1.compareTo(string2);
  5156. }
  5157.  
  5158. }
  5159.  
  5160. public static class row4Struct implements
  5161. routines.system.IPersistableRow<row4Struct> {
  5162. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  5163. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  5164.  
  5165. public int zaznam_dochazky;
  5166.  
  5167. public int getZaznam_dochazky() {
  5168. return this.zaznam_dochazky;
  5169. }
  5170.  
  5171. public int idzamestnanci;
  5172.  
  5173. public int getIdzamestnanci() {
  5174. return this.idzamestnanci;
  5175. }
  5176.  
  5177. public short datum_rok;
  5178.  
  5179. public short getDatum_rok() {
  5180. return this.datum_rok;
  5181. }
  5182.  
  5183. public short datum_mesic;
  5184.  
  5185. public short getDatum_mesic() {
  5186. return this.datum_mesic;
  5187. }
  5188.  
  5189. public int doba_v_praci;
  5190.  
  5191. public int getDoba_v_praci() {
  5192. return this.doba_v_praci;
  5193. }
  5194.  
  5195. public int prescas;
  5196.  
  5197. public int getPrescas() {
  5198. return this.prescas;
  5199. }
  5200.  
  5201. public void readData(ObjectInputStream dis) {
  5202.  
  5203. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  5204.  
  5205. try {
  5206.  
  5207. int length = 0;
  5208.  
  5209. this.zaznam_dochazky = dis.readInt();
  5210.  
  5211. this.idzamestnanci = dis.readInt();
  5212.  
  5213. this.datum_rok = dis.readShort();
  5214.  
  5215. this.datum_mesic = dis.readShort();
  5216.  
  5217. this.doba_v_praci = dis.readInt();
  5218.  
  5219. this.prescas = dis.readInt();
  5220.  
  5221. } catch (IOException e) {
  5222. throw new RuntimeException(e);
  5223.  
  5224. }
  5225.  
  5226. }
  5227.  
  5228. }
  5229.  
  5230. public void writeData(ObjectOutputStream dos) {
  5231. try {
  5232.  
  5233. // int
  5234.  
  5235. dos.writeInt(this.zaznam_dochazky);
  5236.  
  5237. // int
  5238.  
  5239. dos.writeInt(this.idzamestnanci);
  5240.  
  5241. // short
  5242.  
  5243. dos.writeShort(this.datum_rok);
  5244.  
  5245. // short
  5246.  
  5247. dos.writeShort(this.datum_mesic);
  5248.  
  5249. // int
  5250.  
  5251. dos.writeInt(this.doba_v_praci);
  5252.  
  5253. // int
  5254.  
  5255. dos.writeInt(this.prescas);
  5256.  
  5257. } catch (IOException e) {
  5258. throw new RuntimeException(e);
  5259. }
  5260.  
  5261. }
  5262.  
  5263. public String toString() {
  5264.  
  5265. StringBuilder sb = new StringBuilder();
  5266. sb.append(super.toString());
  5267. sb.append("[");
  5268. sb.append("zaznam_dochazky=" + String.valueOf(zaznam_dochazky));
  5269. sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
  5270. sb.append(",datum_rok=" + String.valueOf(datum_rok));
  5271. sb.append(",datum_mesic=" + String.valueOf(datum_mesic));
  5272. sb.append(",doba_v_praci=" + String.valueOf(doba_v_praci));
  5273. sb.append(",prescas=" + String.valueOf(prescas));
  5274. sb.append("]");
  5275.  
  5276. return sb.toString();
  5277. }
  5278.  
  5279. /**
  5280. * Compare keys
  5281. */
  5282. public int compareTo(row4Struct other) {
  5283.  
  5284. int returnValue = -1;
  5285.  
  5286. return returnValue;
  5287. }
  5288.  
  5289. private int checkNullsAndCompare(Object object1, Object object2) {
  5290. int returnValue = 0;
  5291. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  5292. returnValue = ((Comparable) object1).compareTo(object2);
  5293. } else if (object1 != null && object2 != null) {
  5294. returnValue = compareStrings(object1.toString(),
  5295. object2.toString());
  5296. } else if (object1 == null && object2 != null) {
  5297. returnValue = 1;
  5298. } else if (object1 != null && object2 == null) {
  5299. returnValue = -1;
  5300. } else {
  5301. returnValue = 0;
  5302. }
  5303.  
  5304. return returnValue;
  5305. }
  5306.  
  5307. private int compareStrings(String string1, String string2) {
  5308. return string1.compareTo(string2);
  5309. }
  5310.  
  5311. }
  5312.  
  5313. public static class OnRowsEndStructtAggregateRow_1 implements
  5314. routines.system.IPersistableRow<OnRowsEndStructtAggregateRow_1> {
  5315. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  5316. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  5317. protected static final int DEFAULT_HASHCODE = 1;
  5318. protected static final int PRIME = 31;
  5319. protected int hashCode = DEFAULT_HASHCODE;
  5320. public boolean hashCodeDirty = true;
  5321.  
  5322. public String loopKey;
  5323.  
  5324. public int zaznam_dochazky;
  5325.  
  5326. public int getZaznam_dochazky() {
  5327. return this.zaznam_dochazky;
  5328. }
  5329.  
  5330. public int idzamestnanci;
  5331.  
  5332. public int getIdzamestnanci() {
  5333. return this.idzamestnanci;
  5334. }
  5335.  
  5336. public short datum_rok;
  5337.  
  5338. public short getDatum_rok() {
  5339. return this.datum_rok;
  5340. }
  5341.  
  5342. public short datum_mesic;
  5343.  
  5344. public short getDatum_mesic() {
  5345. return this.datum_mesic;
  5346. }
  5347.  
  5348. public int doba_v_praci;
  5349.  
  5350. public int getDoba_v_praci() {
  5351. return this.doba_v_praci;
  5352. }
  5353.  
  5354. public int prescas;
  5355.  
  5356. public int getPrescas() {
  5357. return this.prescas;
  5358. }
  5359.  
  5360. @Override
  5361. public int hashCode() {
  5362. if (this.hashCodeDirty) {
  5363. final int prime = PRIME;
  5364. int result = DEFAULT_HASHCODE;
  5365.  
  5366. result = prime * result + (int) this.zaznam_dochazky;
  5367.  
  5368. this.hashCode = result;
  5369. this.hashCodeDirty = false;
  5370. }
  5371. return this.hashCode;
  5372. }
  5373.  
  5374. @Override
  5375. public boolean equals(Object obj) {
  5376. if (this == obj)
  5377. return true;
  5378. if (obj == null)
  5379. return false;
  5380. if (getClass() != obj.getClass())
  5381. return false;
  5382. final OnRowsEndStructtAggregateRow_1 other = (OnRowsEndStructtAggregateRow_1) obj;
  5383.  
  5384. if (this.zaznam_dochazky != other.zaznam_dochazky)
  5385. return false;
  5386.  
  5387. return true;
  5388. }
  5389.  
  5390. public void copyDataTo(OnRowsEndStructtAggregateRow_1 other) {
  5391.  
  5392. other.zaznam_dochazky = this.zaznam_dochazky;
  5393. other.idzamestnanci = this.idzamestnanci;
  5394. other.datum_rok = this.datum_rok;
  5395. other.datum_mesic = this.datum_mesic;
  5396. other.doba_v_praci = this.doba_v_praci;
  5397. other.prescas = this.prescas;
  5398.  
  5399. }
  5400.  
  5401. public void copyKeysDataTo(OnRowsEndStructtAggregateRow_1 other) {
  5402.  
  5403. other.zaznam_dochazky = this.zaznam_dochazky;
  5404.  
  5405. }
  5406.  
  5407. public void readData(ObjectInputStream dis) {
  5408.  
  5409. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  5410.  
  5411. try {
  5412.  
  5413. int length = 0;
  5414.  
  5415. this.zaznam_dochazky = dis.readInt();
  5416.  
  5417. this.idzamestnanci = dis.readInt();
  5418.  
  5419. this.datum_rok = dis.readShort();
  5420.  
  5421. this.datum_mesic = dis.readShort();
  5422.  
  5423. this.doba_v_praci = dis.readInt();
  5424.  
  5425. this.prescas = dis.readInt();
  5426.  
  5427. } catch (IOException e) {
  5428. throw new RuntimeException(e);
  5429.  
  5430. }
  5431.  
  5432. }
  5433.  
  5434. }
  5435.  
  5436. public void writeData(ObjectOutputStream dos) {
  5437. try {
  5438.  
  5439. // int
  5440.  
  5441. dos.writeInt(this.zaznam_dochazky);
  5442.  
  5443. // int
  5444.  
  5445. dos.writeInt(this.idzamestnanci);
  5446.  
  5447. // short
  5448.  
  5449. dos.writeShort(this.datum_rok);
  5450.  
  5451. // short
  5452.  
  5453. dos.writeShort(this.datum_mesic);
  5454.  
  5455. // int
  5456.  
  5457. dos.writeInt(this.doba_v_praci);
  5458.  
  5459. // int
  5460.  
  5461. dos.writeInt(this.prescas);
  5462.  
  5463. } catch (IOException e) {
  5464. throw new RuntimeException(e);
  5465. }
  5466.  
  5467. }
  5468.  
  5469. public String toString() {
  5470.  
  5471. StringBuilder sb = new StringBuilder();
  5472. sb.append(super.toString());
  5473. sb.append("[");
  5474. sb.append("zaznam_dochazky=" + String.valueOf(zaznam_dochazky));
  5475. sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
  5476. sb.append(",datum_rok=" + String.valueOf(datum_rok));
  5477. sb.append(",datum_mesic=" + String.valueOf(datum_mesic));
  5478. sb.append(",doba_v_praci=" + String.valueOf(doba_v_praci));
  5479. sb.append(",prescas=" + String.valueOf(prescas));
  5480. sb.append("]");
  5481.  
  5482. return sb.toString();
  5483. }
  5484.  
  5485. /**
  5486. * Compare keys
  5487. */
  5488. public int compareTo(OnRowsEndStructtAggregateRow_1 other) {
  5489.  
  5490. int returnValue = -1;
  5491.  
  5492. returnValue = checkNullsAndCompare(this.zaznam_dochazky,
  5493. other.zaznam_dochazky);
  5494. if (returnValue != 0) {
  5495. return returnValue;
  5496. }
  5497.  
  5498. return returnValue;
  5499. }
  5500.  
  5501. private int checkNullsAndCompare(Object object1, Object object2) {
  5502. int returnValue = 0;
  5503. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  5504. returnValue = ((Comparable) object1).compareTo(object2);
  5505. } else if (object1 != null && object2 != null) {
  5506. returnValue = compareStrings(object1.toString(),
  5507. object2.toString());
  5508. } else if (object1 == null && object2 != null) {
  5509. returnValue = 1;
  5510. } else if (object1 != null && object2 == null) {
  5511. returnValue = -1;
  5512. } else {
  5513. returnValue = 0;
  5514. }
  5515.  
  5516. return returnValue;
  5517. }
  5518.  
  5519. private int compareStrings(String string1, String string2) {
  5520. return string1.compareTo(string2);
  5521. }
  5522.  
  5523. }
  5524.  
  5525. public static class row10Struct implements
  5526. routines.system.IPersistableRow<row10Struct> {
  5527. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  5528. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  5529. protected static final int DEFAULT_HASHCODE = 1;
  5530. protected static final int PRIME = 31;
  5531. protected int hashCode = DEFAULT_HASHCODE;
  5532. public boolean hashCodeDirty = true;
  5533.  
  5534. public String loopKey;
  5535.  
  5536. public int zaznam_dochazky;
  5537.  
  5538. public int getZaznam_dochazky() {
  5539. return this.zaznam_dochazky;
  5540. }
  5541.  
  5542. public int idzamestnanci;
  5543.  
  5544. public int getIdzamestnanci() {
  5545. return this.idzamestnanci;
  5546. }
  5547.  
  5548. public short datum_rok;
  5549.  
  5550. public short getDatum_rok() {
  5551. return this.datum_rok;
  5552. }
  5553.  
  5554. public short datum_mesic;
  5555.  
  5556. public short getDatum_mesic() {
  5557. return this.datum_mesic;
  5558. }
  5559.  
  5560. public int doba_v_praci;
  5561.  
  5562. public int getDoba_v_praci() {
  5563. return this.doba_v_praci;
  5564. }
  5565.  
  5566. public int prescas;
  5567.  
  5568. public int getPrescas() {
  5569. return this.prescas;
  5570. }
  5571.  
  5572. @Override
  5573. public int hashCode() {
  5574. if (this.hashCodeDirty) {
  5575. final int prime = PRIME;
  5576. int result = DEFAULT_HASHCODE;
  5577.  
  5578. result = prime * result + (int) this.zaznam_dochazky;
  5579.  
  5580. this.hashCode = result;
  5581. this.hashCodeDirty = false;
  5582. }
  5583. return this.hashCode;
  5584. }
  5585.  
  5586. @Override
  5587. public boolean equals(Object obj) {
  5588. if (this == obj)
  5589. return true;
  5590. if (obj == null)
  5591. return false;
  5592. if (getClass() != obj.getClass())
  5593. return false;
  5594. final row10Struct other = (row10Struct) obj;
  5595.  
  5596. if (this.zaznam_dochazky != other.zaznam_dochazky)
  5597. return false;
  5598.  
  5599. return true;
  5600. }
  5601.  
  5602. public void copyDataTo(row10Struct other) {
  5603.  
  5604. other.zaznam_dochazky = this.zaznam_dochazky;
  5605. other.idzamestnanci = this.idzamestnanci;
  5606. other.datum_rok = this.datum_rok;
  5607. other.datum_mesic = this.datum_mesic;
  5608. other.doba_v_praci = this.doba_v_praci;
  5609. other.prescas = this.prescas;
  5610.  
  5611. }
  5612.  
  5613. public void copyKeysDataTo(row10Struct other) {
  5614.  
  5615. other.zaznam_dochazky = this.zaznam_dochazky;
  5616.  
  5617. }
  5618.  
  5619. public void readData(ObjectInputStream dis) {
  5620.  
  5621. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  5622.  
  5623. try {
  5624.  
  5625. int length = 0;
  5626.  
  5627. this.zaznam_dochazky = dis.readInt();
  5628.  
  5629. this.idzamestnanci = dis.readInt();
  5630.  
  5631. this.datum_rok = dis.readShort();
  5632.  
  5633. this.datum_mesic = dis.readShort();
  5634.  
  5635. this.doba_v_praci = dis.readInt();
  5636.  
  5637. this.prescas = dis.readInt();
  5638.  
  5639. } catch (IOException e) {
  5640. throw new RuntimeException(e);
  5641.  
  5642. }
  5643.  
  5644. }
  5645.  
  5646. }
  5647.  
  5648. public void writeData(ObjectOutputStream dos) {
  5649. try {
  5650.  
  5651. // int
  5652.  
  5653. dos.writeInt(this.zaznam_dochazky);
  5654.  
  5655. // int
  5656.  
  5657. dos.writeInt(this.idzamestnanci);
  5658.  
  5659. // short
  5660.  
  5661. dos.writeShort(this.datum_rok);
  5662.  
  5663. // short
  5664.  
  5665. dos.writeShort(this.datum_mesic);
  5666.  
  5667. // int
  5668.  
  5669. dos.writeInt(this.doba_v_praci);
  5670.  
  5671. // int
  5672.  
  5673. dos.writeInt(this.prescas);
  5674.  
  5675. } catch (IOException e) {
  5676. throw new RuntimeException(e);
  5677. }
  5678.  
  5679. }
  5680.  
  5681. public String toString() {
  5682.  
  5683. StringBuilder sb = new StringBuilder();
  5684. sb.append(super.toString());
  5685. sb.append("[");
  5686. sb.append("zaznam_dochazky=" + String.valueOf(zaznam_dochazky));
  5687. sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
  5688. sb.append(",datum_rok=" + String.valueOf(datum_rok));
  5689. sb.append(",datum_mesic=" + String.valueOf(datum_mesic));
  5690. sb.append(",doba_v_praci=" + String.valueOf(doba_v_praci));
  5691. sb.append(",prescas=" + String.valueOf(prescas));
  5692. sb.append("]");
  5693.  
  5694. return sb.toString();
  5695. }
  5696.  
  5697. /**
  5698. * Compare keys
  5699. */
  5700. public int compareTo(row10Struct other) {
  5701.  
  5702. int returnValue = -1;
  5703.  
  5704. returnValue = checkNullsAndCompare(this.zaznam_dochazky,
  5705. other.zaznam_dochazky);
  5706. if (returnValue != 0) {
  5707. return returnValue;
  5708. }
  5709.  
  5710. return returnValue;
  5711. }
  5712.  
  5713. private int checkNullsAndCompare(Object object1, Object object2) {
  5714. int returnValue = 0;
  5715. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  5716. returnValue = ((Comparable) object1).compareTo(object2);
  5717. } else if (object1 != null && object2 != null) {
  5718. returnValue = compareStrings(object1.toString(),
  5719. object2.toString());
  5720. } else if (object1 == null && object2 != null) {
  5721. returnValue = 1;
  5722. } else if (object1 != null && object2 == null) {
  5723. returnValue = -1;
  5724. } else {
  5725. returnValue = 0;
  5726. }
  5727.  
  5728. return returnValue;
  5729. }
  5730.  
  5731. private int compareStrings(String string1, String string2) {
  5732. return string1.compareTo(string2);
  5733. }
  5734.  
  5735. }
  5736.  
  5737. public static class after_tDBInput_6Struct implements
  5738. routines.system.IPersistableRow<after_tDBInput_6Struct> {
  5739. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  5740. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  5741. protected static final int DEFAULT_HASHCODE = 1;
  5742. protected static final int PRIME = 31;
  5743. protected int hashCode = DEFAULT_HASHCODE;
  5744. public boolean hashCodeDirty = true;
  5745.  
  5746. public String loopKey;
  5747.  
  5748. public int zaznam_dochazky;
  5749.  
  5750. public int getZaznam_dochazky() {
  5751. return this.zaznam_dochazky;
  5752. }
  5753.  
  5754. public int idzamestnanci;
  5755.  
  5756. public int getIdzamestnanci() {
  5757. return this.idzamestnanci;
  5758. }
  5759.  
  5760. public short datum_rok;
  5761.  
  5762. public short getDatum_rok() {
  5763. return this.datum_rok;
  5764. }
  5765.  
  5766. public short datum_mesic;
  5767.  
  5768. public short getDatum_mesic() {
  5769. return this.datum_mesic;
  5770. }
  5771.  
  5772. public int doba_v_praci;
  5773.  
  5774. public int getDoba_v_praci() {
  5775. return this.doba_v_praci;
  5776. }
  5777.  
  5778. public int prescas;
  5779.  
  5780. public int getPrescas() {
  5781. return this.prescas;
  5782. }
  5783.  
  5784. @Override
  5785. public int hashCode() {
  5786. if (this.hashCodeDirty) {
  5787. final int prime = PRIME;
  5788. int result = DEFAULT_HASHCODE;
  5789.  
  5790. result = prime * result + (int) this.zaznam_dochazky;
  5791.  
  5792. this.hashCode = result;
  5793. this.hashCodeDirty = false;
  5794. }
  5795. return this.hashCode;
  5796. }
  5797.  
  5798. @Override
  5799. public boolean equals(Object obj) {
  5800. if (this == obj)
  5801. return true;
  5802. if (obj == null)
  5803. return false;
  5804. if (getClass() != obj.getClass())
  5805. return false;
  5806. final after_tDBInput_6Struct other = (after_tDBInput_6Struct) obj;
  5807.  
  5808. if (this.zaznam_dochazky != other.zaznam_dochazky)
  5809. return false;
  5810.  
  5811. return true;
  5812. }
  5813.  
  5814. public void copyDataTo(after_tDBInput_6Struct other) {
  5815.  
  5816. other.zaznam_dochazky = this.zaznam_dochazky;
  5817. other.idzamestnanci = this.idzamestnanci;
  5818. other.datum_rok = this.datum_rok;
  5819. other.datum_mesic = this.datum_mesic;
  5820. other.doba_v_praci = this.doba_v_praci;
  5821. other.prescas = this.prescas;
  5822.  
  5823. }
  5824.  
  5825. public void copyKeysDataTo(after_tDBInput_6Struct other) {
  5826.  
  5827. other.zaznam_dochazky = this.zaznam_dochazky;
  5828.  
  5829. }
  5830.  
  5831. public void readData(ObjectInputStream dis) {
  5832.  
  5833. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  5834.  
  5835. try {
  5836.  
  5837. int length = 0;
  5838.  
  5839. this.zaznam_dochazky = dis.readInt();
  5840.  
  5841. this.idzamestnanci = dis.readInt();
  5842.  
  5843. this.datum_rok = dis.readShort();
  5844.  
  5845. this.datum_mesic = dis.readShort();
  5846.  
  5847. this.doba_v_praci = dis.readInt();
  5848.  
  5849. this.prescas = dis.readInt();
  5850.  
  5851. } catch (IOException e) {
  5852. throw new RuntimeException(e);
  5853.  
  5854. }
  5855.  
  5856. }
  5857.  
  5858. }
  5859.  
  5860. public void writeData(ObjectOutputStream dos) {
  5861. try {
  5862.  
  5863. // int
  5864.  
  5865. dos.writeInt(this.zaznam_dochazky);
  5866.  
  5867. // int
  5868.  
  5869. dos.writeInt(this.idzamestnanci);
  5870.  
  5871. // short
  5872.  
  5873. dos.writeShort(this.datum_rok);
  5874.  
  5875. // short
  5876.  
  5877. dos.writeShort(this.datum_mesic);
  5878.  
  5879. // int
  5880.  
  5881. dos.writeInt(this.doba_v_praci);
  5882.  
  5883. // int
  5884.  
  5885. dos.writeInt(this.prescas);
  5886.  
  5887. } catch (IOException e) {
  5888. throw new RuntimeException(e);
  5889. }
  5890.  
  5891. }
  5892.  
  5893. public String toString() {
  5894.  
  5895. StringBuilder sb = new StringBuilder();
  5896. sb.append(super.toString());
  5897. sb.append("[");
  5898. sb.append("zaznam_dochazky=" + String.valueOf(zaznam_dochazky));
  5899. sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
  5900. sb.append(",datum_rok=" + String.valueOf(datum_rok));
  5901. sb.append(",datum_mesic=" + String.valueOf(datum_mesic));
  5902. sb.append(",doba_v_praci=" + String.valueOf(doba_v_praci));
  5903. sb.append(",prescas=" + String.valueOf(prescas));
  5904. sb.append("]");
  5905.  
  5906. return sb.toString();
  5907. }
  5908.  
  5909. /**
  5910. * Compare keys
  5911. */
  5912. public int compareTo(after_tDBInput_6Struct other) {
  5913.  
  5914. int returnValue = -1;
  5915.  
  5916. returnValue = checkNullsAndCompare(this.zaznam_dochazky,
  5917. other.zaznam_dochazky);
  5918. if (returnValue != 0) {
  5919. return returnValue;
  5920. }
  5921.  
  5922. return returnValue;
  5923. }
  5924.  
  5925. private int checkNullsAndCompare(Object object1, Object object2) {
  5926. int returnValue = 0;
  5927. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  5928. returnValue = ((Comparable) object1).compareTo(object2);
  5929. } else if (object1 != null && object2 != null) {
  5930. returnValue = compareStrings(object1.toString(),
  5931. object2.toString());
  5932. } else if (object1 == null && object2 != null) {
  5933. returnValue = 1;
  5934. } else if (object1 != null && object2 == null) {
  5935. returnValue = -1;
  5936. } else {
  5937. returnValue = 0;
  5938. }
  5939.  
  5940. return returnValue;
  5941. }
  5942.  
  5943. private int compareStrings(String string1, String string2) {
  5944. return string1.compareTo(string2);
  5945. }
  5946.  
  5947. }
  5948.  
  5949. public void tDBInput_6Process(final java.util.Map<String, Object> globalMap)
  5950. throws TalendException {
  5951. globalMap.put("tDBInput_6_SUBPROCESS_STATE", 0);
  5952.  
  5953. final boolean execStat = this.execStat;
  5954. String currentVirtualComponent = null;
  5955.  
  5956. String iterateId = "";
  5957.  
  5958. String currentComponent = "";
  5959. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  5960.  
  5961. try {
  5962. // TDI-39566 avoid throwing an useless Exception
  5963. boolean resumeIt = true;
  5964. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  5965. String currentMethodName = new java.lang.Exception()
  5966. .getStackTrace()[0].getMethodName();
  5967. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  5968. }
  5969. if (resumeIt || globalResumeTicket) { // start the resume
  5970. globalResumeTicket = true;
  5971.  
  5972. tDBInput_1Process(globalMap);
  5973. tDBInput_3Process(globalMap);
  5974. tDBInput_5Process(globalMap);
  5975. tDBInput_7Process(globalMap);
  5976. tDBInput_8Process(globalMap);
  5977. tDBInput_9Process(globalMap);
  5978. tDBInput_10Process(globalMap);
  5979.  
  5980. row10Struct row10 = new row10Struct();
  5981. row4Struct row4 = new row4Struct();
  5982. out2Struct out2 = new out2Struct();
  5983.  
  5984. /**
  5985. * [tAggregateRow_1_AGGOUT begin ] start
  5986. */
  5987.  
  5988. ok_Hash.put("tAggregateRow_1_AGGOUT", false);
  5989. start_Hash.put("tAggregateRow_1_AGGOUT",
  5990. System.currentTimeMillis());
  5991.  
  5992. currentVirtualComponent = "tAggregateRow_1";
  5993.  
  5994. currentComponent = "tAggregateRow_1_AGGOUT";
  5995.  
  5996. if (execStat) {
  5997. if (resourceMap.get("inIterateVComp") == null) {
  5998.  
  5999. runStat.updateStatOnConnection("row10" + iterateId, 0,
  6000. 0);
  6001.  
  6002. }
  6003. }
  6004.  
  6005. int tos_count_tAggregateRow_1_AGGOUT = 0;
  6006.  
  6007. // ------------ Seems it is not used
  6008.  
  6009. java.util.Map hashAggreg_tAggregateRow_1 = new java.util.HashMap();
  6010.  
  6011. // ------------
  6012.  
  6013. class UtilClass_tAggregateRow_1 { // G_OutBegin_AggR_144
  6014.  
  6015. public double sd(Double[] data) {
  6016. final int n = data.length;
  6017. if (n < 2) {
  6018. return Double.NaN;
  6019. }
  6020. double d1 = 0d;
  6021. double d2 = 0d;
  6022.  
  6023. for (int i = 0; i < data.length; i++) {
  6024. d1 += (data[i] * data[i]);
  6025. d2 += data[i];
  6026. }
  6027.  
  6028. return Math.sqrt((n * d1 - d2 * d2) / n / (n - 1));
  6029. }
  6030.  
  6031. public void checkedIADD(byte a, byte b,
  6032. boolean checkTypeOverFlow, boolean checkUlp) {
  6033. byte r = (byte) (a + b);
  6034. if (checkTypeOverFlow && ((a ^ r) & (b ^ r)) < 0) {
  6035. throw new RuntimeException(buildOverflowMessage(
  6036. String.valueOf(a), String.valueOf(b),
  6037. "'short/Short'", "'byte/Byte'"));
  6038. }
  6039. }
  6040.  
  6041. public void checkedIADD(short a, short b,
  6042. boolean checkTypeOverFlow, boolean checkUlp) {
  6043. short r = (short) (a + b);
  6044. if (checkTypeOverFlow && ((a ^ r) & (b ^ r)) < 0) {
  6045. throw new RuntimeException(buildOverflowMessage(
  6046. String.valueOf(a), String.valueOf(b),
  6047. "'int/Integer'", "'short/Short'"));
  6048. }
  6049. }
  6050.  
  6051. public void checkedIADD(int a, int b,
  6052. boolean checkTypeOverFlow, boolean checkUlp) {
  6053. int r = a + b;
  6054. if (checkTypeOverFlow && ((a ^ r) & (b ^ r)) < 0) {
  6055. throw new RuntimeException(buildOverflowMessage(
  6056. String.valueOf(a), String.valueOf(b),
  6057. "'long/Long'", "'int/Integer'"));
  6058. }
  6059. }
  6060.  
  6061. public void checkedIADD(long a, long b,
  6062. boolean checkTypeOverFlow, boolean checkUlp) {
  6063. long r = a + b;
  6064. if (checkTypeOverFlow && ((a ^ r) & (b ^ r)) < 0) {
  6065. throw new RuntimeException(buildOverflowMessage(
  6066. String.valueOf(a), String.valueOf(b),
  6067. "'BigDecimal'", "'long/Long'"));
  6068. }
  6069. }
  6070.  
  6071. public void checkedIADD(float a, float b,
  6072. boolean checkTypeOverFlow, boolean checkUlp) {
  6073.  
  6074. if (checkUlp) {
  6075. float minAddedValue = Math.ulp(a);
  6076. if (minAddedValue > Math.abs(b)) {
  6077. throw new RuntimeException(
  6078. buildPrecisionMessage(
  6079. String.valueOf(a),
  6080. String.valueOf(b),
  6081. "'double' or 'BigDecimal'",
  6082. "'float/Float'"));
  6083. }
  6084. }
  6085.  
  6086. if (checkTypeOverFlow
  6087. && ((double) a + (double) b > (double) Float.MAX_VALUE)
  6088. || ((double) a + (double) b < (double) -Float.MAX_VALUE)) {
  6089. throw new RuntimeException(
  6090. buildOverflowMessage(String.valueOf(a),
  6091. String.valueOf(b),
  6092. "'double' or 'BigDecimal'",
  6093. "'float/Float'"));
  6094. }
  6095. }
  6096.  
  6097. public void checkedIADD(double a, double b,
  6098. boolean checkTypeOverFlow, boolean checkUlp) {
  6099.  
  6100. if (checkUlp) {
  6101. double minAddedValue = Math.ulp(a);
  6102. if (minAddedValue > Math.abs(b)) {
  6103. throw new RuntimeException(
  6104. buildPrecisionMessage(
  6105. String.valueOf(a),
  6106. String.valueOf(a),
  6107. "'BigDecimal'",
  6108. "'double/Double'"));
  6109. }
  6110. }
  6111.  
  6112. if (checkTypeOverFlow
  6113. && (a + b > (double) Double.MAX_VALUE)
  6114. || (a + b < -Double.MAX_VALUE)) {
  6115. throw new RuntimeException(buildOverflowMessage(
  6116. String.valueOf(a), String.valueOf(b),
  6117. "'BigDecimal'", "'double/Double'"));
  6118. }
  6119. }
  6120.  
  6121. public void checkedIADD(double a, byte b,
  6122. boolean checkTypeOverFlow, boolean checkUlp) {
  6123.  
  6124. if (checkTypeOverFlow
  6125. && (a + b > (double) Double.MAX_VALUE)
  6126. || (a + b < -Double.MAX_VALUE)) {
  6127. throw new RuntimeException(buildOverflowMessage(
  6128. String.valueOf(a), String.valueOf(b),
  6129. "'BigDecimal'", "'double/Double'"));
  6130. }
  6131. }
  6132.  
  6133. public void checkedIADD(double a, short b,
  6134. boolean checkTypeOverFlow, boolean checkUlp) {
  6135.  
  6136. if (checkTypeOverFlow
  6137. && (a + b > (double) Double.MAX_VALUE)
  6138. || (a + b < -Double.MAX_VALUE)) {
  6139. throw new RuntimeException(buildOverflowMessage(
  6140. String.valueOf(a), String.valueOf(b),
  6141. "'BigDecimal'", "'double/Double'"));
  6142. }
  6143. }
  6144.  
  6145. public void checkedIADD(double a, int b,
  6146. boolean checkTypeOverFlow, boolean checkUlp) {
  6147.  
  6148. if (checkTypeOverFlow
  6149. && (a + b > (double) Double.MAX_VALUE)
  6150. || (a + b < -Double.MAX_VALUE)) {
  6151. throw new RuntimeException(buildOverflowMessage(
  6152. String.valueOf(a), String.valueOf(b),
  6153. "'BigDecimal'", "'double/Double'"));
  6154. }
  6155. }
  6156.  
  6157. public void checkedIADD(double a, float b,
  6158. boolean checkTypeOverFlow, boolean checkUlp) {
  6159.  
  6160. if (checkUlp) {
  6161. double minAddedValue = Math.ulp(a);
  6162. if (minAddedValue > Math.abs(b)) {
  6163. throw new RuntimeException(
  6164. buildPrecisionMessage(
  6165. String.valueOf(a),
  6166. String.valueOf(a),
  6167. "'BigDecimal'",
  6168. "'double/Double'"));
  6169. }
  6170. }
  6171.  
  6172. if (checkTypeOverFlow
  6173. && (a + b > (double) Double.MAX_VALUE)
  6174. || (a + b < -Double.MAX_VALUE)) {
  6175. throw new RuntimeException(buildOverflowMessage(
  6176. String.valueOf(a), String.valueOf(b),
  6177. "'BigDecimal'", "'double/Double'"));
  6178. }
  6179. }
  6180.  
  6181. private String buildOverflowMessage(String a, String b,
  6182. String advicedTypes, String originalType) {
  6183. return "Type overflow when adding "
  6184. + b
  6185. + " to "
  6186. + a
  6187. + ", to resolve this problem, increase the precision by using "
  6188. + advicedTypes + " type in place of "
  6189. + originalType + ".";
  6190. }
  6191.  
  6192. private String buildPrecisionMessage(String a, String b,
  6193. String advicedTypes, String originalType) {
  6194. return "The double precision is unsufficient to add the value "
  6195. + b
  6196. + " to "
  6197. + a
  6198. + ", to resolve this problem, increase the precision by using "
  6199. + advicedTypes
  6200. + " type in place of "
  6201. + originalType + ".";
  6202. }
  6203.  
  6204. } // G_OutBegin_AggR_144
  6205.  
  6206. UtilClass_tAggregateRow_1 utilClass_tAggregateRow_1 = new UtilClass_tAggregateRow_1();
  6207.  
  6208. class AggOperationStruct_tAggregateRow_1 { // G_OutBegin_AggR_100
  6209.  
  6210. private static final int DEFAULT_HASHCODE = 1;
  6211. private static final int PRIME = 31;
  6212. private int hashCode = DEFAULT_HASHCODE;
  6213. public boolean hashCodeDirty = true;
  6214.  
  6215. int idzamestnanci;
  6216. short datum_rok;
  6217. short datum_mesic;
  6218. int doba_v_praci_sum;
  6219. int prescas_sum;
  6220.  
  6221. @Override
  6222. public int hashCode() {
  6223. if (this.hashCodeDirty) {
  6224. final int prime = PRIME;
  6225. int result = DEFAULT_HASHCODE;
  6226.  
  6227. result = prime * result + (int) this.idzamestnanci;
  6228.  
  6229. result = prime * result + (int) this.datum_rok;
  6230.  
  6231. result = prime * result + (int) this.datum_mesic;
  6232.  
  6233. this.hashCode = result;
  6234. this.hashCodeDirty = false;
  6235. }
  6236. return this.hashCode;
  6237. }
  6238.  
  6239. @Override
  6240. public boolean equals(Object obj) {
  6241. if (this == obj)
  6242. return true;
  6243. if (obj == null)
  6244. return false;
  6245. if (getClass() != obj.getClass())
  6246. return false;
  6247. final AggOperationStruct_tAggregateRow_1 other = (AggOperationStruct_tAggregateRow_1) obj;
  6248.  
  6249. if (this.idzamestnanci != other.idzamestnanci)
  6250. return false;
  6251.  
  6252. if (this.datum_rok != other.datum_rok)
  6253. return false;
  6254.  
  6255. if (this.datum_mesic != other.datum_mesic)
  6256. return false;
  6257.  
  6258. return true;
  6259. }
  6260.  
  6261. } // G_OutBegin_AggR_100
  6262.  
  6263. AggOperationStruct_tAggregateRow_1 operation_result_tAggregateRow_1 = null;
  6264. AggOperationStruct_tAggregateRow_1 operation_finder_tAggregateRow_1 = new AggOperationStruct_tAggregateRow_1();
  6265. java.util.Map<AggOperationStruct_tAggregateRow_1, AggOperationStruct_tAggregateRow_1> hash_tAggregateRow_1 = new java.util.HashMap<AggOperationStruct_tAggregateRow_1, AggOperationStruct_tAggregateRow_1>();
  6266.  
  6267. /**
  6268. * [tAggregateRow_1_AGGOUT begin ] stop
  6269. */
  6270.  
  6271. /**
  6272. * [tDBInput_6 begin ] start
  6273. */
  6274.  
  6275. ok_Hash.put("tDBInput_6", false);
  6276. start_Hash.put("tDBInput_6", System.currentTimeMillis());
  6277.  
  6278. currentComponent = "tDBInput_6";
  6279.  
  6280. int tos_count_tDBInput_6 = 0;
  6281.  
  6282. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_6 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  6283. .getMSSqlGenerateTimestampUtil();
  6284.  
  6285. java.util.List<String> talendToDBList_tDBInput_6 = new java.util.ArrayList();
  6286. String[] talendToDBArray_tDBInput_6 = new String[] { "FLOAT",
  6287. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  6288. "DECIMAL IDENTITY", "REAL" };
  6289. java.util.Collections.addAll(talendToDBList_tDBInput_6,
  6290. talendToDBArray_tDBInput_6);
  6291. int nb_line_tDBInput_6 = 0;
  6292. java.sql.Connection conn_tDBInput_6 = null;
  6293. String driverClass_tDBInput_6 = "net.sourceforge.jtds.jdbc.Driver";
  6294. java.lang.Class.forName(driverClass_tDBInput_6);
  6295. String dbUser_tDBInput_6 = "tym1";
  6296.  
  6297. final String decryptedPassword_tDBInput_6 = routines.system.PasswordEncryptUtil
  6298. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  6299.  
  6300. String dbPwd_tDBInput_6 = decryptedPassword_tDBInput_6;
  6301.  
  6302. String port_tDBInput_6 = "1433";
  6303. String dbname_tDBInput_6 = "bi_zdroj01";
  6304. String url_tDBInput_6 = "jdbc:jtds:sqlserver://"
  6305. + "158.196.160.60";
  6306. if (!"".equals(port_tDBInput_6)) {
  6307. url_tDBInput_6 += ":" + "1433";
  6308. }
  6309. if (!"".equals(dbname_tDBInput_6)) {
  6310. url_tDBInput_6 += "//" + "bi_zdroj01";
  6311. }
  6312. url_tDBInput_6 += ";appName=" + projectName + ";" + "";
  6313. String dbschema_tDBInput_6 = "";
  6314.  
  6315. conn_tDBInput_6 = java.sql.DriverManager.getConnection(
  6316. url_tDBInput_6, dbUser_tDBInput_6, dbPwd_tDBInput_6);
  6317.  
  6318. java.sql.Statement stmt_tDBInput_6 = conn_tDBInput_6
  6319. .createStatement();
  6320.  
  6321. String dbquery_tDBInput_6 = "SELECT evidence_dochazky.zaznam_dochazky,\nevidence_dochazky.idzamestnanci,\nYEAR(evidence_dochazky.datum) AS datum_rok"
  6322. + ",\nMONTH(evidence_dochazky.datum) AS datum_mesic,\nDATEDIFF(second, evidence_dochazky.cas_prichodu, cas_odchodu)\nAS dob"
  6323. + "a_v_praci,\n IIF(DATEDIFF(second, evidence_dochazky.cas_prichodu, cas_odchodu) -\n8*3600 > 0,\nDATEDIFF(second, evidence"
  6324. + "_dochazky.cas_prichodu, cas_odchodu) -\n8*3600, 0) AS prescas\nFROM evidence_dochazky";
  6325.  
  6326. globalMap.put("tDBInput_6_QUERY", dbquery_tDBInput_6);
  6327. java.sql.ResultSet rs_tDBInput_6 = null;
  6328.  
  6329. try {
  6330. rs_tDBInput_6 = stmt_tDBInput_6
  6331. .executeQuery(dbquery_tDBInput_6);
  6332. java.sql.ResultSetMetaData rsmd_tDBInput_6 = rs_tDBInput_6
  6333. .getMetaData();
  6334. int colQtyInRs_tDBInput_6 = rsmd_tDBInput_6
  6335. .getColumnCount();
  6336.  
  6337. String tmpContent_tDBInput_6 = null;
  6338.  
  6339. while (rs_tDBInput_6.next()) {
  6340. nb_line_tDBInput_6++;
  6341.  
  6342. if (colQtyInRs_tDBInput_6 < 1) {
  6343. row10.zaznam_dochazky = 0;
  6344. } else {
  6345.  
  6346. if (rs_tDBInput_6.getObject(1) != null) {
  6347. row10.zaznam_dochazky = rs_tDBInput_6.getInt(1);
  6348. } else {
  6349. throw new RuntimeException(
  6350. "Null value in non-Nullable column");
  6351. }
  6352. }
  6353. if (colQtyInRs_tDBInput_6 < 2) {
  6354. row10.idzamestnanci = 0;
  6355. } else {
  6356.  
  6357. if (rs_tDBInput_6.getObject(2) != null) {
  6358. row10.idzamestnanci = rs_tDBInput_6.getInt(2);
  6359. } else {
  6360. throw new RuntimeException(
  6361. "Null value in non-Nullable column");
  6362. }
  6363. }
  6364. if (colQtyInRs_tDBInput_6 < 3) {
  6365. row10.datum_rok = 0;
  6366. } else {
  6367.  
  6368. if (rs_tDBInput_6.getObject(3) != null) {
  6369. row10.datum_rok = rs_tDBInput_6.getShort(3);
  6370. } else {
  6371. throw new RuntimeException(
  6372. "Null value in non-Nullable column");
  6373. }
  6374. }
  6375. if (colQtyInRs_tDBInput_6 < 4) {
  6376. row10.datum_mesic = 0;
  6377. } else {
  6378.  
  6379. if (rs_tDBInput_6.getObject(4) != null) {
  6380. row10.datum_mesic = rs_tDBInput_6.getShort(4);
  6381. } else {
  6382. throw new RuntimeException(
  6383. "Null value in non-Nullable column");
  6384. }
  6385. }
  6386. if (colQtyInRs_tDBInput_6 < 5) {
  6387. row10.doba_v_praci = 0;
  6388. } else {
  6389.  
  6390. if (rs_tDBInput_6.getObject(5) != null) {
  6391. row10.doba_v_praci = rs_tDBInput_6.getInt(5);
  6392. } else {
  6393. throw new RuntimeException(
  6394. "Null value in non-Nullable column");
  6395. }
  6396. }
  6397. if (colQtyInRs_tDBInput_6 < 6) {
  6398. row10.prescas = 0;
  6399. } else {
  6400.  
  6401. if (rs_tDBInput_6.getObject(6) != null) {
  6402. row10.prescas = rs_tDBInput_6.getInt(6);
  6403. } else {
  6404. throw new RuntimeException(
  6405. "Null value in non-Nullable column");
  6406. }
  6407. }
  6408.  
  6409. /**
  6410. * [tDBInput_6 begin ] stop
  6411. */
  6412.  
  6413. /**
  6414. * [tDBInput_6 main ] start
  6415. */
  6416.  
  6417. currentComponent = "tDBInput_6";
  6418.  
  6419. tos_count_tDBInput_6++;
  6420.  
  6421. /**
  6422. * [tDBInput_6 main ] stop
  6423. */
  6424.  
  6425. /**
  6426. * [tDBInput_6 process_data_begin ] start
  6427. */
  6428.  
  6429. currentComponent = "tDBInput_6";
  6430.  
  6431. /**
  6432. * [tDBInput_6 process_data_begin ] stop
  6433. */
  6434.  
  6435. /**
  6436. * [tAggregateRow_1_AGGOUT main ] start
  6437. */
  6438.  
  6439. currentVirtualComponent = "tAggregateRow_1";
  6440.  
  6441. currentComponent = "tAggregateRow_1_AGGOUT";
  6442.  
  6443. // row10
  6444. // row10
  6445.  
  6446. if (execStat) {
  6447. runStat.updateStatOnConnection("row10" + iterateId,
  6448. 1, 1);
  6449. }
  6450.  
  6451. operation_finder_tAggregateRow_1.idzamestnanci = row10.idzamestnanci;
  6452. operation_finder_tAggregateRow_1.datum_rok = row10.datum_rok;
  6453. operation_finder_tAggregateRow_1.datum_mesic = row10.datum_mesic;
  6454.  
  6455. operation_finder_tAggregateRow_1.hashCodeDirty = true;
  6456.  
  6457. operation_result_tAggregateRow_1 = hash_tAggregateRow_1
  6458. .get(operation_finder_tAggregateRow_1);
  6459.  
  6460. if (operation_result_tAggregateRow_1 == null) { // G_OutMain_AggR_001
  6461.  
  6462. operation_result_tAggregateRow_1 = new AggOperationStruct_tAggregateRow_1();
  6463.  
  6464. operation_result_tAggregateRow_1.idzamestnanci = operation_finder_tAggregateRow_1.idzamestnanci;
  6465. operation_result_tAggregateRow_1.datum_rok = operation_finder_tAggregateRow_1.datum_rok;
  6466. operation_result_tAggregateRow_1.datum_mesic = operation_finder_tAggregateRow_1.datum_mesic;
  6467.  
  6468. hash_tAggregateRow_1.put(
  6469. operation_result_tAggregateRow_1,
  6470. operation_result_tAggregateRow_1);
  6471.  
  6472. } // G_OutMain_AggR_001
  6473.  
  6474. operation_result_tAggregateRow_1.doba_v_praci_sum += row10.doba_v_praci;
  6475.  
  6476. operation_result_tAggregateRow_1.prescas_sum += row10.prescas;
  6477.  
  6478. tos_count_tAggregateRow_1_AGGOUT++;
  6479.  
  6480. /**
  6481. * [tAggregateRow_1_AGGOUT main ] stop
  6482. */
  6483.  
  6484. /**
  6485. * [tAggregateRow_1_AGGOUT process_data_begin ] start
  6486. */
  6487.  
  6488. currentVirtualComponent = "tAggregateRow_1";
  6489.  
  6490. currentComponent = "tAggregateRow_1_AGGOUT";
  6491.  
  6492. /**
  6493. * [tAggregateRow_1_AGGOUT process_data_begin ] stop
  6494. */
  6495.  
  6496. /**
  6497. * [tAggregateRow_1_AGGOUT process_data_end ] start
  6498. */
  6499.  
  6500. currentVirtualComponent = "tAggregateRow_1";
  6501.  
  6502. currentComponent = "tAggregateRow_1_AGGOUT";
  6503.  
  6504. /**
  6505. * [tAggregateRow_1_AGGOUT process_data_end ] stop
  6506. */
  6507.  
  6508. /**
  6509. * [tDBInput_6 process_data_end ] start
  6510. */
  6511.  
  6512. currentComponent = "tDBInput_6";
  6513.  
  6514. /**
  6515. * [tDBInput_6 process_data_end ] stop
  6516. */
  6517.  
  6518. /**
  6519. * [tDBInput_6 end ] start
  6520. */
  6521.  
  6522. currentComponent = "tDBInput_6";
  6523.  
  6524. }
  6525. } finally {
  6526. if (rs_tDBInput_6 != null) {
  6527. rs_tDBInput_6.close();
  6528. }
  6529. if (stmt_tDBInput_6 != null) {
  6530. stmt_tDBInput_6.close();
  6531. }
  6532. if (conn_tDBInput_6 != null && !conn_tDBInput_6.isClosed()) {
  6533.  
  6534. conn_tDBInput_6.close();
  6535.  
  6536. }
  6537. }
  6538. globalMap.put("tDBInput_6_NB_LINE", nb_line_tDBInput_6);
  6539.  
  6540. ok_Hash.put("tDBInput_6", true);
  6541. end_Hash.put("tDBInput_6", System.currentTimeMillis());
  6542.  
  6543. /**
  6544. * [tDBInput_6 end ] stop
  6545. */
  6546.  
  6547. /**
  6548. * [tAggregateRow_1_AGGOUT end ] start
  6549. */
  6550.  
  6551. currentVirtualComponent = "tAggregateRow_1";
  6552.  
  6553. currentComponent = "tAggregateRow_1_AGGOUT";
  6554.  
  6555. if (execStat) {
  6556. if (resourceMap.get("inIterateVComp") == null
  6557. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  6558. runStat.updateStatOnConnection("row10" + iterateId, 2,
  6559. 0);
  6560. }
  6561. }
  6562.  
  6563. ok_Hash.put("tAggregateRow_1_AGGOUT", true);
  6564. end_Hash.put("tAggregateRow_1_AGGOUT",
  6565. System.currentTimeMillis());
  6566.  
  6567. /**
  6568. * [tAggregateRow_1_AGGOUT end ] stop
  6569. */
  6570.  
  6571. /**
  6572. * [tDBOutput_1 begin ] start
  6573. */
  6574.  
  6575. ok_Hash.put("tDBOutput_1", false);
  6576. start_Hash.put("tDBOutput_1", System.currentTimeMillis());
  6577.  
  6578. currentComponent = "tDBOutput_1";
  6579.  
  6580. if (execStat) {
  6581. if (resourceMap.get("inIterateVComp") == null) {
  6582.  
  6583. runStat.updateStatOnConnection("out2" + iterateId, 0, 0);
  6584.  
  6585. }
  6586. }
  6587.  
  6588. int tos_count_tDBOutput_1 = 0;
  6589.  
  6590. int nb_line_tDBOutput_1 = 0;
  6591. int nb_line_update_tDBOutput_1 = 0;
  6592. int nb_line_inserted_tDBOutput_1 = 0;
  6593. int nb_line_deleted_tDBOutput_1 = 0;
  6594. int nb_line_rejected_tDBOutput_1 = 0;
  6595.  
  6596. int deletedCount_tDBOutput_1 = 0;
  6597. int updatedCount_tDBOutput_1 = 0;
  6598. int insertedCount_tDBOutput_1 = 0;
  6599. int rejectedCount_tDBOutput_1 = 0;
  6600. String dbschema_tDBOutput_1 = null;
  6601. String tableName_tDBOutput_1 = null;
  6602. boolean whetherReject_tDBOutput_1 = false;
  6603.  
  6604. java.util.Calendar calendar_tDBOutput_1 = java.util.Calendar
  6605. .getInstance();
  6606. long year1_tDBOutput_1 = TalendDate.parseDate("yyyy-MM-dd",
  6607. "0001-01-01").getTime();
  6608. long year2_tDBOutput_1 = TalendDate.parseDate("yyyy-MM-dd",
  6609. "1753-01-01").getTime();
  6610. long year10000_tDBOutput_1 = TalendDate.parseDate(
  6611. "yyyy-MM-dd HH:mm:ss", "9999-12-31 24:00:00").getTime();
  6612. long date_tDBOutput_1;
  6613.  
  6614. java.util.Calendar calendar_datetimeoffset_tDBOutput_1 = java.util.Calendar
  6615. .getInstance(java.util.TimeZone.getTimeZone("UTC"));
  6616.  
  6617. java.sql.Connection conn_tDBOutput_1 = null;
  6618. String dbUser_tDBOutput_1 = null;
  6619. dbschema_tDBOutput_1 = "";
  6620. String driverClass_tDBOutput_1 = "net.sourceforge.jtds.jdbc.Driver";
  6621.  
  6622. java.lang.Class.forName(driverClass_tDBOutput_1);
  6623. String port_tDBOutput_1 = "1433";
  6624. String dbname_tDBOutput_1 = "tym1";
  6625. String url_tDBOutput_1 = "jdbc:jtds:sqlserver://"
  6626. + "158.196.160.60";
  6627. if (!"".equals(port_tDBOutput_1)) {
  6628. url_tDBOutput_1 += ":" + "1433";
  6629. }
  6630. if (!"".equals(dbname_tDBOutput_1)) {
  6631. url_tDBOutput_1 += "//" + "tym1";
  6632.  
  6633. }
  6634. url_tDBOutput_1 += ";appName=" + projectName + ";" + "";
  6635. dbUser_tDBOutput_1 = "tym1";
  6636.  
  6637. final String decryptedPassword_tDBOutput_1 = routines.system.PasswordEncryptUtil
  6638. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  6639.  
  6640. String dbPwd_tDBOutput_1 = decryptedPassword_tDBOutput_1;
  6641. conn_tDBOutput_1 = java.sql.DriverManager.getConnection(
  6642. url_tDBOutput_1, dbUser_tDBOutput_1, dbPwd_tDBOutput_1);
  6643.  
  6644. resourceMap.put("conn_tDBOutput_1", conn_tDBOutput_1);
  6645.  
  6646. conn_tDBOutput_1.setAutoCommit(false);
  6647. int commitEvery_tDBOutput_1 = 10000;
  6648. int commitCounter_tDBOutput_1 = 0;
  6649.  
  6650. int batchSize_tDBOutput_1 = 10000;
  6651. int batchSizeCounter_tDBOutput_1 = 0;
  6652.  
  6653. if (dbschema_tDBOutput_1 == null
  6654. || dbschema_tDBOutput_1.trim().length() == 0) {
  6655. tableName_tDBOutput_1 = "FACT_snimek_dochazky";
  6656. } else {
  6657. tableName_tDBOutput_1 = dbschema_tDBOutput_1 + "].["
  6658. + "FACT_snimek_dochazky";
  6659. }
  6660. int count_tDBOutput_1 = 0;
  6661.  
  6662. String insert_tDBOutput_1 = "INSERT INTO ["
  6663. + tableName_tDBOutput_1
  6664. + "] ([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 (?,?,?,?,?,?,?,?,?,?)";
  6665. java.sql.PreparedStatement pstmt_tDBOutput_1 = conn_tDBOutput_1
  6666. .prepareStatement(insert_tDBOutput_1);
  6667. resourceMap.put("pstmt_tDBOutput_1", pstmt_tDBOutput_1);
  6668.  
  6669. /**
  6670. * [tDBOutput_1 begin ] stop
  6671. */
  6672.  
  6673. /**
  6674. * [tMap_2 begin ] start
  6675. */
  6676.  
  6677. ok_Hash.put("tMap_2", false);
  6678. start_Hash.put("tMap_2", System.currentTimeMillis());
  6679.  
  6680. currentComponent = "tMap_2";
  6681.  
  6682. if (execStat) {
  6683. if (resourceMap.get("inIterateVComp") == null) {
  6684.  
  6685. runStat.updateStatOnConnection("row4" + iterateId, 0, 0);
  6686.  
  6687. }
  6688. }
  6689.  
  6690. int tos_count_tMap_2 = 0;
  6691.  
  6692. // ###############################
  6693. // # Lookup's keys initialization
  6694.  
  6695. 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
  6696. .get("tHash_Lookup_row7"));
  6697.  
  6698. row7Struct row7HashKey = new row7Struct();
  6699. row7Struct row7Default = new row7Struct();
  6700.  
  6701. 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
  6702. .get("tHash_Lookup_zamestnanec"));
  6703.  
  6704. zamestnanecStruct zamestnanecHashKey = new zamestnanecStruct();
  6705. zamestnanecStruct zamestnanecDefault = new zamestnanecStruct();
  6706.  
  6707. 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
  6708. .get("tHash_Lookup_row11"));
  6709.  
  6710. row11Struct row11HashKey = new row11Struct();
  6711. row11Struct row11Default = new row11Struct();
  6712.  
  6713. 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
  6714. .get("tHash_Lookup_row5"));
  6715.  
  6716. row5Struct row5HashKey = new row5Struct();
  6717. row5Struct row5Default = new row5Struct();
  6718.  
  6719. 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
  6720. .get("tHash_Lookup_row9"));
  6721.  
  6722. row9Struct row9HashKey = new row9Struct();
  6723. row9Struct row9Default = new row9Struct();
  6724.  
  6725. 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
  6726. .get("tHash_Lookup_row8"));
  6727.  
  6728. row8Struct row8HashKey = new row8Struct();
  6729. row8Struct row8Default = new row8Struct();
  6730.  
  6731. 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
  6732. .get("tHash_Lookup_row6"));
  6733.  
  6734. row6Struct row6HashKey = new row6Struct();
  6735. row6Struct row6Default = new row6Struct();
  6736. // ###############################
  6737.  
  6738. // ###############################
  6739. // # Vars initialization
  6740. class Var__tMap_2__Struct {
  6741. }
  6742. Var__tMap_2__Struct Var__tMap_2 = new Var__tMap_2__Struct();
  6743. // ###############################
  6744.  
  6745. // ###############################
  6746. // # Outputs initialization
  6747. out2Struct out2_tmp = new out2Struct();
  6748. // ###############################
  6749.  
  6750. /**
  6751. * [tMap_2 begin ] stop
  6752. */
  6753.  
  6754. /**
  6755. * [tAggregateRow_1_AGGIN begin ] start
  6756. */
  6757.  
  6758. ok_Hash.put("tAggregateRow_1_AGGIN", false);
  6759. start_Hash.put("tAggregateRow_1_AGGIN",
  6760. System.currentTimeMillis());
  6761.  
  6762. currentVirtualComponent = "tAggregateRow_1";
  6763.  
  6764. currentComponent = "tAggregateRow_1_AGGIN";
  6765.  
  6766. int tos_count_tAggregateRow_1_AGGIN = 0;
  6767.  
  6768. java.util.Collection<AggOperationStruct_tAggregateRow_1> values_tAggregateRow_1 = hash_tAggregateRow_1
  6769. .values();
  6770.  
  6771. globalMap.put("tAggregateRow_1_NB_LINE",
  6772. values_tAggregateRow_1.size());
  6773.  
  6774. for (AggOperationStruct_tAggregateRow_1 aggregated_row_tAggregateRow_1 : values_tAggregateRow_1) { // G_AggR_600
  6775.  
  6776. /**
  6777. * [tAggregateRow_1_AGGIN begin ] stop
  6778. */
  6779.  
  6780. /**
  6781. * [tAggregateRow_1_AGGIN main ] start
  6782. */
  6783.  
  6784. currentVirtualComponent = "tAggregateRow_1";
  6785.  
  6786. currentComponent = "tAggregateRow_1_AGGIN";
  6787.  
  6788. row4.idzamestnanci = aggregated_row_tAggregateRow_1.idzamestnanci;
  6789.  
  6790. row4.datum_rok = aggregated_row_tAggregateRow_1.datum_rok;
  6791.  
  6792. row4.datum_mesic = aggregated_row_tAggregateRow_1.datum_mesic;
  6793. row4.doba_v_praci = aggregated_row_tAggregateRow_1.doba_v_praci_sum;
  6794. row4.prescas = aggregated_row_tAggregateRow_1.prescas_sum;
  6795.  
  6796. tos_count_tAggregateRow_1_AGGIN++;
  6797.  
  6798. /**
  6799. * [tAggregateRow_1_AGGIN main ] stop
  6800. */
  6801.  
  6802. /**
  6803. * [tAggregateRow_1_AGGIN process_data_begin ] start
  6804. */
  6805.  
  6806. currentVirtualComponent = "tAggregateRow_1";
  6807.  
  6808. currentComponent = "tAggregateRow_1_AGGIN";
  6809.  
  6810. /**
  6811. * [tAggregateRow_1_AGGIN process_data_begin ] stop
  6812. */
  6813.  
  6814. /**
  6815. * [tMap_2 main ] start
  6816. */
  6817.  
  6818. currentComponent = "tMap_2";
  6819.  
  6820. // row4
  6821. // row4
  6822.  
  6823. if (execStat) {
  6824. runStat.updateStatOnConnection("row4" + iterateId, 1, 1);
  6825. }
  6826.  
  6827. boolean hasCasePrimitiveKeyWithNull_tMap_2 = false;
  6828.  
  6829. // ###############################
  6830. // # Input tables (lookups)
  6831. boolean rejectedInnerJoin_tMap_2 = false;
  6832. boolean mainRowRejected_tMap_2 = false;
  6833.  
  6834. // /////////////////////////////////////////////
  6835. // Starting Lookup Table "row7"
  6836. // /////////////////////////////////////////////
  6837.  
  6838. boolean forceLooprow7 = false;
  6839.  
  6840. row7Struct row7ObjectFromLookup = null;
  6841.  
  6842. if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
  6843.  
  6844. hasCasePrimitiveKeyWithNull_tMap_2 = false;
  6845.  
  6846. row7HashKey.nazev_mesice = row4.datum_mesic;
  6847.  
  6848. Object exprKeyValue_row7__rok = row4.datum_rok;
  6849. if (exprKeyValue_row7__rok == null) {
  6850. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  6851. } else {
  6852. row7HashKey.rok = (short) (Short) exprKeyValue_row7__rok;
  6853. }
  6854.  
  6855. row7HashKey.hashCodeDirty = true;
  6856.  
  6857. if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
  6858.  
  6859. tHash_Lookup_row7.lookup(row7HashKey);
  6860.  
  6861. } // G_TM_M_091
  6862.  
  6863. } // G_TM_M_020
  6864.  
  6865. if (tHash_Lookup_row7 != null
  6866. && tHash_Lookup_row7.getCount(row7HashKey) > 1) { // G
  6867. // 071
  6868.  
  6869. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row7' and it contains more one result from keys : row7.nazev_mesice = '"
  6870. // + row7HashKey.nazev_mesice + "', row7.rok = '" +
  6871. // row7HashKey.rok + "'");
  6872. } // G 071
  6873.  
  6874. row7Struct row7 = null;
  6875.  
  6876. row7Struct fromLookup_row7 = null;
  6877. row7 = row7Default;
  6878.  
  6879. if (tHash_Lookup_row7 != null
  6880. && tHash_Lookup_row7.hasNext()) { // G 099
  6881.  
  6882. fromLookup_row7 = tHash_Lookup_row7.next();
  6883.  
  6884. } // G 099
  6885.  
  6886. if (fromLookup_row7 != null) {
  6887. row7 = fromLookup_row7;
  6888. }
  6889.  
  6890. // /////////////////////////////////////////////
  6891. // Starting Lookup Table "zamestnanec"
  6892. // /////////////////////////////////////////////
  6893.  
  6894. boolean forceLoopzamestnanec = false;
  6895.  
  6896. zamestnanecStruct zamestnanecObjectFromLookup = null;
  6897.  
  6898. if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
  6899.  
  6900. hasCasePrimitiveKeyWithNull_tMap_2 = false;
  6901.  
  6902. Object exprKeyValue_zamestnanec__cislo_zamestnance = row4.idzamestnanci;
  6903. if (exprKeyValue_zamestnanec__cislo_zamestnance == null) {
  6904. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  6905. } else {
  6906. zamestnanecHashKey.cislo_zamestnance = (int) (Integer) exprKeyValue_zamestnanec__cislo_zamestnance;
  6907. }
  6908.  
  6909. zamestnanecHashKey.hashCodeDirty = true;
  6910.  
  6911. if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
  6912.  
  6913. tHash_Lookup_zamestnanec.lookup(zamestnanecHashKey);
  6914.  
  6915. } // G_TM_M_091
  6916.  
  6917. if (hasCasePrimitiveKeyWithNull_tMap_2
  6918. || !tHash_Lookup_zamestnanec.hasNext()) { // G_TM_M_090
  6919.  
  6920. rejectedInnerJoin_tMap_2 = true;
  6921.  
  6922. } // G_TM_M_090
  6923.  
  6924. } // G_TM_M_020
  6925.  
  6926. if (tHash_Lookup_zamestnanec != null
  6927. && tHash_Lookup_zamestnanec
  6928. .getCount(zamestnanecHashKey) > 1) { // G
  6929. // 071
  6930.  
  6931. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'zamestnanec' and it contains more one result from keys : zamestnanec.cislo_zamestnance = '"
  6932. // + zamestnanecHashKey.cislo_zamestnance + "'");
  6933. } // G 071
  6934.  
  6935. zamestnanecStruct zamestnanec = null;
  6936.  
  6937. zamestnanecStruct fromLookup_zamestnanec = null;
  6938. zamestnanec = zamestnanecDefault;
  6939.  
  6940. if (tHash_Lookup_zamestnanec != null
  6941. && tHash_Lookup_zamestnanec.hasNext()) { // G 099
  6942.  
  6943. fromLookup_zamestnanec = tHash_Lookup_zamestnanec
  6944. .next();
  6945.  
  6946. } // G 099
  6947.  
  6948. if (fromLookup_zamestnanec != null) {
  6949. zamestnanec = fromLookup_zamestnanec;
  6950. }
  6951.  
  6952. // /////////////////////////////////////////////
  6953. // Starting Lookup Table "row11"
  6954. // /////////////////////////////////////////////
  6955.  
  6956. boolean forceLooprow11 = false;
  6957.  
  6958. row11Struct row11ObjectFromLookup = null;
  6959.  
  6960. if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
  6961.  
  6962. hasCasePrimitiveKeyWithNull_tMap_2 = false;
  6963.  
  6964. Object exprKeyValue_row11__idzamestnanci = row4.idzamestnanci;
  6965. if (exprKeyValue_row11__idzamestnanci == null) {
  6966. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  6967. } else {
  6968. row11HashKey.idzamestnanci = (int) (Integer) exprKeyValue_row11__idzamestnanci;
  6969. }
  6970.  
  6971. Object exprKeyValue_row11__mesic = row4.datum_mesic;
  6972. if (exprKeyValue_row11__mesic == null) {
  6973. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  6974. } else {
  6975. row11HashKey.mesic = (short) (Short) exprKeyValue_row11__mesic;
  6976. }
  6977.  
  6978. Object exprKeyValue_row11__rok = row4.datum_rok;
  6979. if (exprKeyValue_row11__rok == null) {
  6980. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  6981. } else {
  6982. row11HashKey.rok = (short) (Short) exprKeyValue_row11__rok;
  6983. }
  6984.  
  6985. row11HashKey.hashCodeDirty = true;
  6986.  
  6987. if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
  6988.  
  6989. tHash_Lookup_row11.lookup(row11HashKey);
  6990.  
  6991. } // G_TM_M_091
  6992.  
  6993. } // G_TM_M_020
  6994.  
  6995. if (tHash_Lookup_row11 != null
  6996. && tHash_Lookup_row11.getCount(row11HashKey) > 1) { // G
  6997. // 071
  6998.  
  6999. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row11' and it contains more one result from keys : row11.idzamestnanci = '"
  7000. // + row11HashKey.idzamestnanci + "', row11.mesic = '" +
  7001. // row11HashKey.mesic + "', row11.rok = '" +
  7002. // row11HashKey.rok + "'");
  7003. } // G 071
  7004.  
  7005. row11Struct row11 = null;
  7006.  
  7007. row11Struct fromLookup_row11 = null;
  7008. row11 = row11Default;
  7009.  
  7010. if (tHash_Lookup_row11 != null
  7011. && tHash_Lookup_row11.hasNext()) { // G 099
  7012.  
  7013. fromLookup_row11 = tHash_Lookup_row11.next();
  7014.  
  7015. } // G 099
  7016.  
  7017. if (fromLookup_row11 != null) {
  7018. row11 = fromLookup_row11;
  7019. }
  7020.  
  7021. // /////////////////////////////////////////////
  7022. // Starting Lookup Table "row5"
  7023. // /////////////////////////////////////////////
  7024.  
  7025. boolean forceLooprow5 = false;
  7026.  
  7027. row5Struct row5ObjectFromLookup = null;
  7028.  
  7029. if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
  7030.  
  7031. hasCasePrimitiveKeyWithNull_tMap_2 = false;
  7032.  
  7033. Object exprKeyValue_row5__idzamestnanci = row4.idzamestnanci;
  7034. if (exprKeyValue_row5__idzamestnanci == null) {
  7035. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  7036. } else {
  7037. row5HashKey.idzamestnanci = (int) (Integer) exprKeyValue_row5__idzamestnanci;
  7038. }
  7039.  
  7040. row5HashKey.rok = row4.datum_rok;
  7041.  
  7042. row5HashKey.hashCodeDirty = true;
  7043.  
  7044. if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
  7045.  
  7046. tHash_Lookup_row5.lookup(row5HashKey);
  7047.  
  7048. } // G_TM_M_091
  7049.  
  7050. if (hasCasePrimitiveKeyWithNull_tMap_2
  7051. || !tHash_Lookup_row5.hasNext()) { // G_TM_M_090
  7052.  
  7053. rejectedInnerJoin_tMap_2 = true;
  7054.  
  7055. } // G_TM_M_090
  7056.  
  7057. } // G_TM_M_020
  7058.  
  7059. if (tHash_Lookup_row5 != null
  7060. && tHash_Lookup_row5.getCount(row5HashKey) > 1) { // G
  7061. // 071
  7062.  
  7063. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row5' and it contains more one result from keys : row5.idzamestnanci = '"
  7064. // + row5HashKey.idzamestnanci + "', row5.rok = '" +
  7065. // row5HashKey.rok + "'");
  7066. } // G 071
  7067.  
  7068. row5Struct row5 = null;
  7069.  
  7070. row5Struct fromLookup_row5 = null;
  7071. row5 = row5Default;
  7072.  
  7073. if (tHash_Lookup_row5 != null
  7074. && tHash_Lookup_row5.hasNext()) { // G 099
  7075.  
  7076. fromLookup_row5 = tHash_Lookup_row5.next();
  7077.  
  7078. } // G 099
  7079.  
  7080. if (fromLookup_row5 != null) {
  7081. row5 = fromLookup_row5;
  7082. }
  7083.  
  7084. // /////////////////////////////////////////////
  7085. // Starting Lookup Table "row9"
  7086. // /////////////////////////////////////////////
  7087.  
  7088. boolean forceLooprow9 = false;
  7089.  
  7090. row9Struct row9ObjectFromLookup = null;
  7091.  
  7092. if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
  7093.  
  7094. hasCasePrimitiveKeyWithNull_tMap_2 = false;
  7095.  
  7096. Object exprKeyValue_row9__cislo_pracoviste = zamestnanec.idpracoviste;
  7097. if (exprKeyValue_row9__cislo_pracoviste == null) {
  7098. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  7099. } else {
  7100. row9HashKey.cislo_pracoviste = (int) (Integer) exprKeyValue_row9__cislo_pracoviste;
  7101. }
  7102.  
  7103. row9HashKey.hashCodeDirty = true;
  7104.  
  7105. if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
  7106.  
  7107. tHash_Lookup_row9.lookup(row9HashKey);
  7108.  
  7109. } // G_TM_M_091
  7110.  
  7111. if (hasCasePrimitiveKeyWithNull_tMap_2
  7112. || !tHash_Lookup_row9.hasNext()) { // G_TM_M_090
  7113.  
  7114. rejectedInnerJoin_tMap_2 = true;
  7115.  
  7116. } // G_TM_M_090
  7117.  
  7118. } // G_TM_M_020
  7119.  
  7120. if (tHash_Lookup_row9 != null
  7121. && tHash_Lookup_row9.getCount(row9HashKey) > 1) { // G
  7122. // 071
  7123.  
  7124. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row9' and it contains more one result from keys : row9.cislo_pracoviste = '"
  7125. // + row9HashKey.cislo_pracoviste + "'");
  7126. } // G 071
  7127.  
  7128. row9Struct row9 = null;
  7129.  
  7130. row9Struct fromLookup_row9 = null;
  7131. row9 = row9Default;
  7132.  
  7133. if (tHash_Lookup_row9 != null
  7134. && tHash_Lookup_row9.hasNext()) { // G 099
  7135.  
  7136. fromLookup_row9 = tHash_Lookup_row9.next();
  7137.  
  7138. } // G 099
  7139.  
  7140. if (fromLookup_row9 != null) {
  7141. row9 = fromLookup_row9;
  7142. }
  7143.  
  7144. // /////////////////////////////////////////////
  7145. // Starting Lookup Table "row8"
  7146. // /////////////////////////////////////////////
  7147.  
  7148. boolean forceLooprow8 = false;
  7149.  
  7150. row8Struct row8ObjectFromLookup = null;
  7151.  
  7152. if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
  7153.  
  7154. hasCasePrimitiveKeyWithNull_tMap_2 = false;
  7155.  
  7156. row8HashKey.nazev_profese = zamestnanec.nazev_profese;
  7157.  
  7158. row8HashKey.hashCodeDirty = true;
  7159.  
  7160. tHash_Lookup_row8.lookup(row8HashKey);
  7161.  
  7162. if (!tHash_Lookup_row8.hasNext()) { // G_TM_M_090
  7163.  
  7164. rejectedInnerJoin_tMap_2 = true;
  7165.  
  7166. } // G_TM_M_090
  7167.  
  7168. } // G_TM_M_020
  7169.  
  7170. if (tHash_Lookup_row8 != null
  7171. && tHash_Lookup_row8.getCount(row8HashKey) > 1) { // G
  7172. // 071
  7173.  
  7174. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row8' and it contains more one result from keys : row8.nazev_profese = '"
  7175. // + row8HashKey.nazev_profese + "'");
  7176. } // G 071
  7177.  
  7178. row8Struct row8 = null;
  7179.  
  7180. row8Struct fromLookup_row8 = null;
  7181. row8 = row8Default;
  7182.  
  7183. if (tHash_Lookup_row8 != null
  7184. && tHash_Lookup_row8.hasNext()) { // G 099
  7185.  
  7186. fromLookup_row8 = tHash_Lookup_row8.next();
  7187.  
  7188. } // G 099
  7189.  
  7190. if (fromLookup_row8 != null) {
  7191. row8 = fromLookup_row8;
  7192. }
  7193.  
  7194. // /////////////////////////////////////////////
  7195. // Starting Lookup Table "row6"
  7196. // /////////////////////////////////////////////
  7197.  
  7198. boolean forceLooprow6 = false;
  7199.  
  7200. row6Struct row6ObjectFromLookup = null;
  7201.  
  7202. if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
  7203.  
  7204. hasCasePrimitiveKeyWithNull_tMap_2 = false;
  7205.  
  7206. Object exprKeyValue_row6__idzamestnanci = zamestnanec.idzamestnanci;
  7207. if (exprKeyValue_row6__idzamestnanci == null) {
  7208. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  7209. } else {
  7210. row6HashKey.idzamestnanci = (int) (Integer) exprKeyValue_row6__idzamestnanci;
  7211. }
  7212.  
  7213. row6HashKey.dovolena_rok = row4.datum_rok;
  7214.  
  7215. row6HashKey.hashCodeDirty = true;
  7216.  
  7217. if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
  7218.  
  7219. tHash_Lookup_row6.lookup(row6HashKey);
  7220.  
  7221. } // G_TM_M_091
  7222.  
  7223. } // G_TM_M_020
  7224.  
  7225. if (tHash_Lookup_row6 != null
  7226. && tHash_Lookup_row6.getCount(row6HashKey) > 1) { // G
  7227. // 071
  7228.  
  7229. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row6' and it contains more one result from keys : row6.idzamestnanci = '"
  7230. // + row6HashKey.idzamestnanci +
  7231. // "', row6.dovolena_rok = '" + row6HashKey.dovolena_rok
  7232. // + "'");
  7233. } // G 071
  7234.  
  7235. row6Struct row6 = null;
  7236.  
  7237. row6Struct fromLookup_row6 = null;
  7238. row6 = row6Default;
  7239.  
  7240. if (tHash_Lookup_row6 != null
  7241. && tHash_Lookup_row6.hasNext()) { // G 099
  7242.  
  7243. fromLookup_row6 = tHash_Lookup_row6.next();
  7244.  
  7245. } // G 099
  7246.  
  7247. if (fromLookup_row6 != null) {
  7248. row6 = fromLookup_row6;
  7249. }
  7250.  
  7251. // ###############################
  7252. { // start of Var scope
  7253.  
  7254. // ###############################
  7255. // # Vars tables
  7256.  
  7257. Var__tMap_2__Struct Var = Var__tMap_2;// ###############################
  7258. // ###############################
  7259. // # Output tables
  7260.  
  7261. out2 = null;
  7262.  
  7263. if (!rejectedInnerJoin_tMap_2) {
  7264.  
  7265. // # Output table : 'out2'
  7266. out2_tmp.odpracovano_hodin = BigDecimal
  7267. .valueOf(row11.doba_v_praci / 3600);
  7268. out2_tmp.prescasy = BigDecimal
  7269. .valueOf(row11.prescas / 3600);
  7270. out2_tmp.celkova_mzda = BigDecimal
  7271. .valueOf(zamestnanec.hodinova_sazba
  7272. * (row4.doba_v_praci / 3600)
  7273. + zamestnanec.osobni_priplatek
  7274. + (Relational.ISNULL(row11.odmena) ? 0
  7275. : row11.odmena));
  7276. out2_tmp.dovolena_vybrana = BigDecimal
  7277. .valueOf(row6.dovolena_mesic == row4.datum_mesic ? row6.dovolena_cerpani
  7278. : 0);
  7279. out2_tmp.dovolena_zustatek = BigDecimal
  7280. .valueOf(row4.datum_mesic >= row6.dovolena_mesic ? row5.dovolena_celkem
  7281. - row6.dovolena_cerpani
  7282. : row5.dovolena_celkem);
  7283. out2_tmp.dovolena_celkem = row5.dovolena_celkem;
  7284. out2_tmp.DIM_zamestnanci_idzamestnanci = zamestnanec.idzamestnanci;
  7285. out2_tmp.DIM_pracoviste_idpracoviste = row9.idpracoviste;
  7286. out2_tmp.DIM_kalendar_idkalendare = row7.idkalendare;
  7287. out2_tmp.DIM_mzdove_sazby_idsazby = row8.idsazby;
  7288. out2 = out2_tmp;
  7289. } // closing inner join bracket (2)
  7290. // ###############################
  7291.  
  7292. } // end of Var scope
  7293.  
  7294. rejectedInnerJoin_tMap_2 = false;
  7295.  
  7296. tos_count_tMap_2++;
  7297.  
  7298. /**
  7299. * [tMap_2 main ] stop
  7300. */
  7301.  
  7302. /**
  7303. * [tMap_2 process_data_begin ] start
  7304. */
  7305.  
  7306. currentComponent = "tMap_2";
  7307.  
  7308. /**
  7309. * [tMap_2 process_data_begin ] stop
  7310. */
  7311. // Start of branch "out2"
  7312. if (out2 != null) {
  7313.  
  7314. /**
  7315. * [tDBOutput_1 main ] start
  7316. */
  7317.  
  7318. currentComponent = "tDBOutput_1";
  7319.  
  7320. // out2
  7321. // out2
  7322.  
  7323. if (execStat) {
  7324. runStat.updateStatOnConnection("out2" + iterateId,
  7325. 1, 1);
  7326. }
  7327.  
  7328. whetherReject_tDBOutput_1 = false;
  7329. pstmt_tDBOutput_1.setBigDecimal(1,
  7330. out2.odpracovano_hodin);
  7331.  
  7332. pstmt_tDBOutput_1.setBigDecimal(2, out2.prescasy);
  7333.  
  7334. pstmt_tDBOutput_1.setBigDecimal(3, out2.celkova_mzda);
  7335.  
  7336. pstmt_tDBOutput_1.setBigDecimal(4,
  7337. out2.dovolena_vybrana);
  7338.  
  7339. pstmt_tDBOutput_1.setBigDecimal(5,
  7340. out2.dovolena_zustatek);
  7341.  
  7342. pstmt_tDBOutput_1.setInt(6, out2.dovolena_celkem);
  7343.  
  7344. pstmt_tDBOutput_1.setInt(7,
  7345. out2.DIM_zamestnanci_idzamestnanci);
  7346.  
  7347. pstmt_tDBOutput_1.setInt(8,
  7348. out2.DIM_pracoviste_idpracoviste);
  7349.  
  7350. pstmt_tDBOutput_1.setInt(9,
  7351. out2.DIM_kalendar_idkalendare);
  7352.  
  7353. pstmt_tDBOutput_1.setInt(10,
  7354. out2.DIM_mzdove_sazby_idsazby);
  7355.  
  7356. pstmt_tDBOutput_1.addBatch();
  7357. nb_line_tDBOutput_1++;
  7358.  
  7359. batchSizeCounter_tDBOutput_1++;
  7360.  
  7361. // ////////batch execute by batch size///////
  7362. class LimitBytesHelper_tDBOutput_1 {
  7363. public int limitBytePart1(int counter,
  7364. java.sql.PreparedStatement pstmt_tDBOutput_1)
  7365. throws Exception {
  7366. try {
  7367.  
  7368. for (int countEach_tDBOutput_1 : pstmt_tDBOutput_1
  7369. .executeBatch()) {
  7370. if (countEach_tDBOutput_1 == -2
  7371. || countEach_tDBOutput_1 == -3) {
  7372. break;
  7373. }
  7374. counter += countEach_tDBOutput_1;
  7375. }
  7376.  
  7377. } catch (java.sql.BatchUpdateException e) {
  7378.  
  7379. int countSum_tDBOutput_1 = 0;
  7380. for (int countEach_tDBOutput_1 : e
  7381. .getUpdateCounts()) {
  7382. counter += (countEach_tDBOutput_1 < 0 ? 0
  7383. : countEach_tDBOutput_1);
  7384. }
  7385.  
  7386. System.err.println(e.getMessage());
  7387.  
  7388. }
  7389. return counter;
  7390. }
  7391.  
  7392. public int limitBytePart2(int counter,
  7393. java.sql.PreparedStatement pstmt_tDBOutput_1)
  7394. throws Exception {
  7395. try {
  7396.  
  7397. for (int countEach_tDBOutput_1 : pstmt_tDBOutput_1
  7398. .executeBatch()) {
  7399. if (countEach_tDBOutput_1 == -2
  7400. || countEach_tDBOutput_1 == -3) {
  7401. break;
  7402. }
  7403. counter += countEach_tDBOutput_1;
  7404. }
  7405.  
  7406. } catch (java.sql.BatchUpdateException e) {
  7407.  
  7408. for (int countEach_tDBOutput_1 : e
  7409. .getUpdateCounts()) {
  7410. counter += (countEach_tDBOutput_1 < 0 ? 0
  7411. : countEach_tDBOutput_1);
  7412. }
  7413.  
  7414. System.err.println(e.getMessage());
  7415.  
  7416. }
  7417. return counter;
  7418. }
  7419. }
  7420. if ((batchSize_tDBOutput_1 > 0)
  7421. && (batchSize_tDBOutput_1 <= batchSizeCounter_tDBOutput_1)) {
  7422.  
  7423. insertedCount_tDBOutput_1 = new LimitBytesHelper_tDBOutput_1()
  7424. .limitBytePart1(insertedCount_tDBOutput_1,
  7425. pstmt_tDBOutput_1);
  7426.  
  7427. batchSizeCounter_tDBOutput_1 = 0;
  7428. }
  7429.  
  7430. // //////////commit every////////////
  7431.  
  7432. commitCounter_tDBOutput_1++;
  7433. if (commitEvery_tDBOutput_1 <= commitCounter_tDBOutput_1) {
  7434. if ((batchSize_tDBOutput_1 > 0)
  7435. && (batchSizeCounter_tDBOutput_1 > 0)) {
  7436.  
  7437. insertedCount_tDBOutput_1 = new LimitBytesHelper_tDBOutput_1()
  7438. .limitBytePart1(
  7439. insertedCount_tDBOutput_1,
  7440. pstmt_tDBOutput_1);
  7441.  
  7442. batchSizeCounter_tDBOutput_1 = 0;
  7443. }
  7444.  
  7445. conn_tDBOutput_1.commit();
  7446.  
  7447. commitCounter_tDBOutput_1 = 0;
  7448. }
  7449.  
  7450. tos_count_tDBOutput_1++;
  7451.  
  7452. /**
  7453. * [tDBOutput_1 main ] stop
  7454. */
  7455.  
  7456. /**
  7457. * [tDBOutput_1 process_data_begin ] start
  7458. */
  7459.  
  7460. currentComponent = "tDBOutput_1";
  7461.  
  7462. /**
  7463. * [tDBOutput_1 process_data_begin ] stop
  7464. */
  7465.  
  7466. /**
  7467. * [tDBOutput_1 process_data_end ] start
  7468. */
  7469.  
  7470. currentComponent = "tDBOutput_1";
  7471.  
  7472. /**
  7473. * [tDBOutput_1 process_data_end ] stop
  7474. */
  7475.  
  7476. } // End of branch "out2"
  7477.  
  7478. /**
  7479. * [tMap_2 process_data_end ] start
  7480. */
  7481.  
  7482. currentComponent = "tMap_2";
  7483.  
  7484. /**
  7485. * [tMap_2 process_data_end ] stop
  7486. */
  7487.  
  7488. /**
  7489. * [tAggregateRow_1_AGGIN process_data_end ] start
  7490. */
  7491.  
  7492. currentVirtualComponent = "tAggregateRow_1";
  7493.  
  7494. currentComponent = "tAggregateRow_1_AGGIN";
  7495.  
  7496. /**
  7497. * [tAggregateRow_1_AGGIN process_data_end ] stop
  7498. */
  7499.  
  7500. /**
  7501. * [tAggregateRow_1_AGGIN end ] start
  7502. */
  7503.  
  7504. currentVirtualComponent = "tAggregateRow_1";
  7505.  
  7506. currentComponent = "tAggregateRow_1_AGGIN";
  7507.  
  7508. } // G_AggR_600
  7509.  
  7510. ok_Hash.put("tAggregateRow_1_AGGIN", true);
  7511. end_Hash.put("tAggregateRow_1_AGGIN",
  7512. System.currentTimeMillis());
  7513.  
  7514. /**
  7515. * [tAggregateRow_1_AGGIN end ] stop
  7516. */
  7517.  
  7518. /**
  7519. * [tMap_2 end ] start
  7520. */
  7521.  
  7522. currentComponent = "tMap_2";
  7523.  
  7524. // ###############################
  7525. // # Lookup hashes releasing
  7526. if (tHash_Lookup_row7 != null) {
  7527. tHash_Lookup_row7.endGet();
  7528. }
  7529. globalMap.remove("tHash_Lookup_row7");
  7530.  
  7531. if (tHash_Lookup_zamestnanec != null) {
  7532. tHash_Lookup_zamestnanec.endGet();
  7533. }
  7534. globalMap.remove("tHash_Lookup_zamestnanec");
  7535.  
  7536. if (tHash_Lookup_row11 != null) {
  7537. tHash_Lookup_row11.endGet();
  7538. }
  7539. globalMap.remove("tHash_Lookup_row11");
  7540.  
  7541. if (tHash_Lookup_row5 != null) {
  7542. tHash_Lookup_row5.endGet();
  7543. }
  7544. globalMap.remove("tHash_Lookup_row5");
  7545.  
  7546. if (tHash_Lookup_row9 != null) {
  7547. tHash_Lookup_row9.endGet();
  7548. }
  7549. globalMap.remove("tHash_Lookup_row9");
  7550.  
  7551. if (tHash_Lookup_row8 != null) {
  7552. tHash_Lookup_row8.endGet();
  7553. }
  7554. globalMap.remove("tHash_Lookup_row8");
  7555.  
  7556. if (tHash_Lookup_row6 != null) {
  7557. tHash_Lookup_row6.endGet();
  7558. }
  7559. globalMap.remove("tHash_Lookup_row6");
  7560.  
  7561. // ###############################
  7562.  
  7563. if (execStat) {
  7564. if (resourceMap.get("inIterateVComp") == null
  7565. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  7566. runStat.updateStatOnConnection("row4" + iterateId, 2, 0);
  7567. }
  7568. }
  7569.  
  7570. ok_Hash.put("tMap_2", true);
  7571. end_Hash.put("tMap_2", System.currentTimeMillis());
  7572.  
  7573. /**
  7574. * [tMap_2 end ] stop
  7575. */
  7576.  
  7577. /**
  7578. * [tDBOutput_1 end ] start
  7579. */
  7580.  
  7581. currentComponent = "tDBOutput_1";
  7582.  
  7583. try {
  7584. int countSum_tDBOutput_1 = 0;
  7585. if (pstmt_tDBOutput_1 != null
  7586. && batchSizeCounter_tDBOutput_1 > 0) {
  7587.  
  7588. for (int countEach_tDBOutput_1 : pstmt_tDBOutput_1
  7589. .executeBatch()) {
  7590. if (countEach_tDBOutput_1 == -2
  7591. || countEach_tDBOutput_1 == -3) {
  7592. break;
  7593. }
  7594. countSum_tDBOutput_1 += countEach_tDBOutput_1;
  7595. }
  7596.  
  7597. }
  7598.  
  7599. insertedCount_tDBOutput_1 += countSum_tDBOutput_1;
  7600.  
  7601. } catch (java.sql.BatchUpdateException e) {
  7602.  
  7603. int countSum_tDBOutput_1 = 0;
  7604. for (int countEach_tDBOutput_1 : e.getUpdateCounts()) {
  7605. countSum_tDBOutput_1 += (countEach_tDBOutput_1 < 0 ? 0
  7606. : countEach_tDBOutput_1);
  7607. }
  7608.  
  7609. insertedCount_tDBOutput_1 += countSum_tDBOutput_1;
  7610.  
  7611. System.err.println(e.getMessage());
  7612.  
  7613. }
  7614. if (pstmt_tDBOutput_1 != null) {
  7615.  
  7616. pstmt_tDBOutput_1.close();
  7617. resourceMap.remove("pstmt_tDBOutput_1");
  7618.  
  7619. }
  7620. resourceMap.put("statementClosed_tDBOutput_1", true);
  7621. conn_tDBOutput_1.commit();
  7622.  
  7623. conn_tDBOutput_1.close();
  7624. resourceMap.put("finish_tDBOutput_1", true);
  7625.  
  7626. nb_line_deleted_tDBOutput_1 = nb_line_deleted_tDBOutput_1
  7627. + deletedCount_tDBOutput_1;
  7628. nb_line_update_tDBOutput_1 = nb_line_update_tDBOutput_1
  7629. + updatedCount_tDBOutput_1;
  7630. nb_line_inserted_tDBOutput_1 = nb_line_inserted_tDBOutput_1
  7631. + insertedCount_tDBOutput_1;
  7632. nb_line_rejected_tDBOutput_1 = nb_line_rejected_tDBOutput_1
  7633. + rejectedCount_tDBOutput_1;
  7634.  
  7635. globalMap.put("tDBOutput_1_NB_LINE", nb_line_tDBOutput_1);
  7636. globalMap.put("tDBOutput_1_NB_LINE_UPDATED",
  7637. nb_line_update_tDBOutput_1);
  7638. globalMap.put("tDBOutput_1_NB_LINE_INSERTED",
  7639. nb_line_inserted_tDBOutput_1);
  7640. globalMap.put("tDBOutput_1_NB_LINE_DELETED",
  7641. nb_line_deleted_tDBOutput_1);
  7642. globalMap.put("tDBOutput_1_NB_LINE_REJECTED",
  7643. nb_line_rejected_tDBOutput_1);
  7644.  
  7645. if (execStat) {
  7646. if (resourceMap.get("inIterateVComp") == null
  7647. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  7648. runStat.updateStatOnConnection("out2" + iterateId, 2, 0);
  7649. }
  7650. }
  7651.  
  7652. ok_Hash.put("tDBOutput_1", true);
  7653. end_Hash.put("tDBOutput_1", System.currentTimeMillis());
  7654.  
  7655. /**
  7656. * [tDBOutput_1 end ] stop
  7657. */
  7658.  
  7659. }// end the resume
  7660.  
  7661. } catch (java.lang.Exception e) {
  7662.  
  7663. TalendException te = new TalendException(e, currentComponent,
  7664. globalMap);
  7665.  
  7666. te.setVirtualComponentName(currentVirtualComponent);
  7667.  
  7668. throw te;
  7669. } catch (java.lang.Error error) {
  7670.  
  7671. runStat.stopThreadStat();
  7672.  
  7673. throw error;
  7674. } finally {
  7675.  
  7676. // free memory for "tMap_2"
  7677. globalMap.remove("tHash_Lookup_zamestnanec");
  7678.  
  7679. // free memory for "tMap_2"
  7680. globalMap.remove("tHash_Lookup_row11");
  7681.  
  7682. // free memory for "tMap_2"
  7683. globalMap.remove("tHash_Lookup_row5");
  7684.  
  7685. // free memory for "tMap_2"
  7686. globalMap.remove("tHash_Lookup_row6");
  7687.  
  7688. // free memory for "tMap_2"
  7689. globalMap.remove("tHash_Lookup_row7");
  7690.  
  7691. // free memory for "tMap_2"
  7692. globalMap.remove("tHash_Lookup_row8");
  7693.  
  7694. // free memory for "tMap_2"
  7695. globalMap.remove("tHash_Lookup_row9");
  7696.  
  7697. // free memory for "tAggregateRow_1_AGGIN"
  7698. globalMap.remove("tAggregateRow_1");
  7699.  
  7700. try {
  7701.  
  7702. /**
  7703. * [tDBInput_6 finally ] start
  7704. */
  7705.  
  7706. currentComponent = "tDBInput_6";
  7707.  
  7708. /**
  7709. * [tDBInput_6 finally ] stop
  7710. */
  7711.  
  7712. /**
  7713. * [tAggregateRow_1_AGGOUT finally ] start
  7714. */
  7715.  
  7716. currentVirtualComponent = "tAggregateRow_1";
  7717.  
  7718. currentComponent = "tAggregateRow_1_AGGOUT";
  7719.  
  7720. /**
  7721. * [tAggregateRow_1_AGGOUT finally ] stop
  7722. */
  7723.  
  7724. /**
  7725. * [tAggregateRow_1_AGGIN finally ] start
  7726. */
  7727.  
  7728. currentVirtualComponent = "tAggregateRow_1";
  7729.  
  7730. currentComponent = "tAggregateRow_1_AGGIN";
  7731.  
  7732. /**
  7733. * [tAggregateRow_1_AGGIN finally ] stop
  7734. */
  7735.  
  7736. /**
  7737. * [tMap_2 finally ] start
  7738. */
  7739.  
  7740. currentComponent = "tMap_2";
  7741.  
  7742. /**
  7743. * [tMap_2 finally ] stop
  7744. */
  7745.  
  7746. /**
  7747. * [tDBOutput_1 finally ] start
  7748. */
  7749.  
  7750. currentComponent = "tDBOutput_1";
  7751.  
  7752. try {
  7753. if (resourceMap.get("statementClosed_tDBOutput_1") == null) {
  7754. java.sql.PreparedStatement pstmtToClose_tDBOutput_1 = null;
  7755. if ((pstmtToClose_tDBOutput_1 = (java.sql.PreparedStatement) resourceMap
  7756. .remove("pstmt_tDBOutput_1")) != null) {
  7757. pstmtToClose_tDBOutput_1.close();
  7758. }
  7759. }
  7760. } finally {
  7761. if (resourceMap.get("finish_tDBOutput_1") == null) {
  7762. java.sql.Connection ctn_tDBOutput_1 = null;
  7763. if ((ctn_tDBOutput_1 = (java.sql.Connection) resourceMap
  7764. .get("conn_tDBOutput_1")) != null) {
  7765. try {
  7766. ctn_tDBOutput_1.close();
  7767. } catch (java.sql.SQLException sqlEx_tDBOutput_1) {
  7768. String errorMessage_tDBOutput_1 = "failed to close the connection in tDBOutput_1 :"
  7769. + sqlEx_tDBOutput_1.getMessage();
  7770. System.err.println(errorMessage_tDBOutput_1);
  7771. }
  7772. }
  7773. }
  7774. }
  7775.  
  7776. /**
  7777. * [tDBOutput_1 finally ] stop
  7778. */
  7779.  
  7780. } catch (java.lang.Exception e) {
  7781. // ignore
  7782. } catch (java.lang.Error error) {
  7783. // ignore
  7784. }
  7785. resourceMap = null;
  7786. }
  7787.  
  7788. globalMap.put("tDBInput_6_SUBPROCESS_STATE", 1);
  7789. }
  7790.  
  7791. public static class row6Struct implements
  7792. routines.system.IPersistableComparableLookupRow<row6Struct> {
  7793. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  7794. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  7795. protected static final int DEFAULT_HASHCODE = 1;
  7796. protected static final int PRIME = 31;
  7797. protected int hashCode = DEFAULT_HASHCODE;
  7798. public boolean hashCodeDirty = true;
  7799.  
  7800. public String loopKey;
  7801.  
  7802. public int idzamestnanci;
  7803.  
  7804. public int getIdzamestnanci() {
  7805. return this.idzamestnanci;
  7806. }
  7807.  
  7808. public Short dovolena_mesic;
  7809.  
  7810. public Short getDovolena_mesic() {
  7811. return this.dovolena_mesic;
  7812. }
  7813.  
  7814. public Short dovolena_rok;
  7815.  
  7816. public Short getDovolena_rok() {
  7817. return this.dovolena_rok;
  7818. }
  7819.  
  7820. public Integer dovolena_cerpani;
  7821.  
  7822. public Integer getDovolena_cerpani() {
  7823. return this.dovolena_cerpani;
  7824. }
  7825.  
  7826. @Override
  7827. public int hashCode() {
  7828. if (this.hashCodeDirty) {
  7829. final int prime = PRIME;
  7830. int result = DEFAULT_HASHCODE;
  7831.  
  7832. result = prime * result + (int) this.idzamestnanci;
  7833.  
  7834. result = prime
  7835. * result
  7836. + ((this.dovolena_rok == null) ? 0 : this.dovolena_rok
  7837. .hashCode());
  7838.  
  7839. this.hashCode = result;
  7840. this.hashCodeDirty = false;
  7841. }
  7842. return this.hashCode;
  7843. }
  7844.  
  7845. @Override
  7846. public boolean equals(Object obj) {
  7847. if (this == obj)
  7848. return true;
  7849. if (obj == null)
  7850. return false;
  7851. if (getClass() != obj.getClass())
  7852. return false;
  7853. final row6Struct other = (row6Struct) obj;
  7854.  
  7855. if (this.idzamestnanci != other.idzamestnanci)
  7856. return false;
  7857.  
  7858. if (this.dovolena_rok == null) {
  7859. if (other.dovolena_rok != null)
  7860. return false;
  7861.  
  7862. } else if (!this.dovolena_rok.equals(other.dovolena_rok))
  7863.  
  7864. return false;
  7865.  
  7866. return true;
  7867. }
  7868.  
  7869. public void copyDataTo(row6Struct other) {
  7870.  
  7871. other.idzamestnanci = this.idzamestnanci;
  7872. other.dovolena_mesic = this.dovolena_mesic;
  7873. other.dovolena_rok = this.dovolena_rok;
  7874. other.dovolena_cerpani = this.dovolena_cerpani;
  7875.  
  7876. }
  7877.  
  7878. public void copyKeysDataTo(row6Struct other) {
  7879.  
  7880. other.idzamestnanci = this.idzamestnanci;
  7881. other.dovolena_rok = this.dovolena_rok;
  7882.  
  7883. }
  7884.  
  7885. private Integer readInteger(DataInputStream dis, ObjectInputStream ois)
  7886. throws IOException {
  7887. Integer intReturn;
  7888. int length = 0;
  7889. length = dis.readByte();
  7890. if (length == -1) {
  7891. intReturn = null;
  7892. } else {
  7893. intReturn = dis.readInt();
  7894. }
  7895. return intReturn;
  7896. }
  7897.  
  7898. private void writeInteger(Integer intNum, DataOutputStream dos,
  7899. ObjectOutputStream oos) throws IOException {
  7900. if (intNum == null) {
  7901. dos.writeByte(-1);
  7902. } else {
  7903. dos.writeByte(0);
  7904. dos.writeInt(intNum);
  7905. }
  7906. }
  7907.  
  7908. public void readKeysData(ObjectInputStream dis) {
  7909.  
  7910. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  7911.  
  7912. try {
  7913.  
  7914. int length = 0;
  7915.  
  7916. this.idzamestnanci = dis.readInt();
  7917.  
  7918. length = dis.readByte();
  7919. if (length == -1) {
  7920. this.dovolena_rok = null;
  7921. } else {
  7922. this.dovolena_rok = dis.readShort();
  7923. }
  7924.  
  7925. } catch (IOException e) {
  7926. throw new RuntimeException(e);
  7927.  
  7928. }
  7929.  
  7930. }
  7931.  
  7932. }
  7933.  
  7934. public void writeKeysData(ObjectOutputStream dos) {
  7935. try {
  7936.  
  7937. // int
  7938.  
  7939. dos.writeInt(this.idzamestnanci);
  7940.  
  7941. // Short
  7942.  
  7943. if (this.dovolena_rok == null) {
  7944. dos.writeByte(-1);
  7945. } else {
  7946. dos.writeByte(0);
  7947. dos.writeShort(this.dovolena_rok);
  7948. }
  7949.  
  7950. } catch (IOException e) {
  7951. throw new RuntimeException(e);
  7952. }
  7953.  
  7954. }
  7955.  
  7956. /**
  7957. * Fill Values data by reading ObjectInputStream.
  7958. */
  7959. public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
  7960. try {
  7961.  
  7962. int length = 0;
  7963.  
  7964. length = dis.readByte();
  7965. if (length == -1) {
  7966. this.dovolena_mesic = null;
  7967. } else {
  7968. this.dovolena_mesic = dis.readShort();
  7969. }
  7970.  
  7971. this.dovolena_cerpani = readInteger(dis, ois);
  7972.  
  7973. } catch (IOException e) {
  7974. throw new RuntimeException(e);
  7975.  
  7976. }
  7977.  
  7978. }
  7979.  
  7980. /**
  7981. * Return a byte array which represents Values data.
  7982. */
  7983. public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
  7984. try {
  7985.  
  7986. if (this.dovolena_mesic == null) {
  7987. dos.writeByte(-1);
  7988. } else {
  7989. dos.writeByte(0);
  7990. dos.writeShort(this.dovolena_mesic);
  7991. }
  7992.  
  7993. writeInteger(this.dovolena_cerpani, dos, oos);
  7994.  
  7995. } catch (IOException e) {
  7996. throw new RuntimeException(e);
  7997. }
  7998.  
  7999. }
  8000.  
  8001. public String toString() {
  8002.  
  8003. StringBuilder sb = new StringBuilder();
  8004. sb.append(super.toString());
  8005. sb.append("[");
  8006. sb.append("idzamestnanci=" + String.valueOf(idzamestnanci));
  8007. sb.append(",dovolena_mesic=" + String.valueOf(dovolena_mesic));
  8008. sb.append(",dovolena_rok=" + String.valueOf(dovolena_rok));
  8009. sb.append(",dovolena_cerpani=" + String.valueOf(dovolena_cerpani));
  8010. sb.append("]");
  8011.  
  8012. return sb.toString();
  8013. }
  8014.  
  8015. /**
  8016. * Compare keys
  8017. */
  8018. public int compareTo(row6Struct other) {
  8019.  
  8020. int returnValue = -1;
  8021.  
  8022. returnValue = checkNullsAndCompare(this.idzamestnanci,
  8023. other.idzamestnanci);
  8024. if (returnValue != 0) {
  8025. return returnValue;
  8026. }
  8027.  
  8028. returnValue = checkNullsAndCompare(this.dovolena_rok,
  8029. other.dovolena_rok);
  8030. if (returnValue != 0) {
  8031. return returnValue;
  8032. }
  8033.  
  8034. return returnValue;
  8035. }
  8036.  
  8037. private int checkNullsAndCompare(Object object1, Object object2) {
  8038. int returnValue = 0;
  8039. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  8040. returnValue = ((Comparable) object1).compareTo(object2);
  8041. } else if (object1 != null && object2 != null) {
  8042. returnValue = compareStrings(object1.toString(),
  8043. object2.toString());
  8044. } else if (object1 == null && object2 != null) {
  8045. returnValue = 1;
  8046. } else if (object1 != null && object2 == null) {
  8047. returnValue = -1;
  8048. } else {
  8049. returnValue = 0;
  8050. }
  8051.  
  8052. return returnValue;
  8053. }
  8054.  
  8055. private int compareStrings(String string1, String string2) {
  8056. return string1.compareTo(string2);
  8057. }
  8058.  
  8059. }
  8060.  
  8061. public void tDBInput_7Process(final java.util.Map<String, Object> globalMap)
  8062. throws TalendException {
  8063. globalMap.put("tDBInput_7_SUBPROCESS_STATE", 0);
  8064.  
  8065. final boolean execStat = this.execStat;
  8066.  
  8067. String iterateId = "";
  8068.  
  8069. String currentComponent = "";
  8070. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  8071.  
  8072. try {
  8073. // TDI-39566 avoid throwing an useless Exception
  8074. boolean resumeIt = true;
  8075. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  8076. String currentMethodName = new java.lang.Exception()
  8077. .getStackTrace()[0].getMethodName();
  8078. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  8079. }
  8080. if (resumeIt || globalResumeTicket) { // start the resume
  8081. globalResumeTicket = true;
  8082.  
  8083. row6Struct row6 = new row6Struct();
  8084.  
  8085. /**
  8086. * [tAdvancedHash_row6 begin ] start
  8087. */
  8088.  
  8089. ok_Hash.put("tAdvancedHash_row6", false);
  8090. start_Hash
  8091. .put("tAdvancedHash_row6", System.currentTimeMillis());
  8092.  
  8093. currentComponent = "tAdvancedHash_row6";
  8094.  
  8095. if (execStat) {
  8096. if (resourceMap.get("inIterateVComp") == null) {
  8097.  
  8098. runStat.updateStatOnConnection("row6" + iterateId, 0, 0);
  8099.  
  8100. }
  8101. }
  8102.  
  8103. int tos_count_tAdvancedHash_row6 = 0;
  8104.  
  8105. // connection name:row6
  8106. // source node:tDBInput_7 - inputs:(after_tDBInput_6)
  8107. // outputs:(row6,row6) | target node:tAdvancedHash_row6 -
  8108. // inputs:(row6) outputs:()
  8109. // linked node: tMap_2 -
  8110. // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
  8111. // outputs:(out2)
  8112.  
  8113. org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row6 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
  8114.  
  8115. org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct> tHash_Lookup_row6 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
  8116. .<row6Struct> getLookup(matchingModeEnum_row6);
  8117.  
  8118. globalMap.put("tHash_Lookup_row6", tHash_Lookup_row6);
  8119.  
  8120. /**
  8121. * [tAdvancedHash_row6 begin ] stop
  8122. */
  8123.  
  8124. /**
  8125. * [tDBInput_7 begin ] start
  8126. */
  8127.  
  8128. ok_Hash.put("tDBInput_7", false);
  8129. start_Hash.put("tDBInput_7", System.currentTimeMillis());
  8130.  
  8131. currentComponent = "tDBInput_7";
  8132.  
  8133. int tos_count_tDBInput_7 = 0;
  8134.  
  8135. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_7 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  8136. .getMSSqlGenerateTimestampUtil();
  8137.  
  8138. java.util.List<String> talendToDBList_tDBInput_7 = new java.util.ArrayList();
  8139. String[] talendToDBArray_tDBInput_7 = new String[] { "FLOAT",
  8140. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  8141. "DECIMAL IDENTITY", "REAL" };
  8142. java.util.Collections.addAll(talendToDBList_tDBInput_7,
  8143. talendToDBArray_tDBInput_7);
  8144. int nb_line_tDBInput_7 = 0;
  8145. java.sql.Connection conn_tDBInput_7 = null;
  8146. String driverClass_tDBInput_7 = "net.sourceforge.jtds.jdbc.Driver";
  8147. java.lang.Class.forName(driverClass_tDBInput_7);
  8148. String dbUser_tDBInput_7 = "tym1";
  8149.  
  8150. final String decryptedPassword_tDBInput_7 = routines.system.PasswordEncryptUtil
  8151. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  8152.  
  8153. String dbPwd_tDBInput_7 = decryptedPassword_tDBInput_7;
  8154.  
  8155. String port_tDBInput_7 = "1433";
  8156. String dbname_tDBInput_7 = "bi_zdroj01";
  8157. String url_tDBInput_7 = "jdbc:jtds:sqlserver://"
  8158. + "158.196.160.60";
  8159. if (!"".equals(port_tDBInput_7)) {
  8160. url_tDBInput_7 += ":" + "1433";
  8161. }
  8162. if (!"".equals(dbname_tDBInput_7)) {
  8163. url_tDBInput_7 += "//" + "bi_zdroj01";
  8164. }
  8165. url_tDBInput_7 += ";appName=" + projectName + ";" + "";
  8166. String dbschema_tDBInput_7 = "";
  8167.  
  8168. conn_tDBInput_7 = java.sql.DriverManager.getConnection(
  8169. url_tDBInput_7, dbUser_tDBInput_7, dbPwd_tDBInput_7);
  8170.  
  8171. java.sql.Statement stmt_tDBInput_7 = conn_tDBInput_7
  8172. .createStatement();
  8173.  
  8174. String dbquery_tDBInput_7 = "SELECT\n cerpani_dovolene.idzamestnanci,\n MONTH(cerpani_dovolene.dovolena_od) AS dovolena_mesic,\n YEAR(cerpani_dov"
  8175. + "olene.dovolena_do) AS dovolena_rok,\n DATEDIFF(day, dovolena_od, dovolena_do) AS dovolena_cerpani\nFROM cerpani_dovolen"
  8176. + "e ORDER BY dovolena_rok, dovolena_mesic";
  8177.  
  8178. globalMap.put("tDBInput_7_QUERY", dbquery_tDBInput_7);
  8179. java.sql.ResultSet rs_tDBInput_7 = null;
  8180.  
  8181. try {
  8182. rs_tDBInput_7 = stmt_tDBInput_7
  8183. .executeQuery(dbquery_tDBInput_7);
  8184. java.sql.ResultSetMetaData rsmd_tDBInput_7 = rs_tDBInput_7
  8185. .getMetaData();
  8186. int colQtyInRs_tDBInput_7 = rsmd_tDBInput_7
  8187. .getColumnCount();
  8188.  
  8189. String tmpContent_tDBInput_7 = null;
  8190.  
  8191. while (rs_tDBInput_7.next()) {
  8192. nb_line_tDBInput_7++;
  8193.  
  8194. if (colQtyInRs_tDBInput_7 < 1) {
  8195. row6.idzamestnanci = 0;
  8196. } else {
  8197.  
  8198. if (rs_tDBInput_7.getObject(1) != null) {
  8199. row6.idzamestnanci = rs_tDBInput_7.getInt(1);
  8200. } else {
  8201. throw new RuntimeException(
  8202. "Null value in non-Nullable column");
  8203. }
  8204. }
  8205. if (colQtyInRs_tDBInput_7 < 2) {
  8206. row6.dovolena_mesic = null;
  8207. } else {
  8208.  
  8209. if (rs_tDBInput_7.getObject(2) != null) {
  8210. row6.dovolena_mesic = rs_tDBInput_7.getShort(2);
  8211. } else {
  8212. row6.dovolena_mesic = null;
  8213. }
  8214. }
  8215. if (colQtyInRs_tDBInput_7 < 3) {
  8216. row6.dovolena_rok = null;
  8217. } else {
  8218.  
  8219. if (rs_tDBInput_7.getObject(3) != null) {
  8220. row6.dovolena_rok = rs_tDBInput_7.getShort(3);
  8221. } else {
  8222. row6.dovolena_rok = null;
  8223. }
  8224. }
  8225. if (colQtyInRs_tDBInput_7 < 4) {
  8226. row6.dovolena_cerpani = null;
  8227. } else {
  8228.  
  8229. if (rs_tDBInput_7.getObject(4) != null) {
  8230. row6.dovolena_cerpani = rs_tDBInput_7.getInt(4);
  8231. } else {
  8232. row6.dovolena_cerpani = null;
  8233. }
  8234. }
  8235.  
  8236. /**
  8237. * [tDBInput_7 begin ] stop
  8238. */
  8239.  
  8240. /**
  8241. * [tDBInput_7 main ] start
  8242. */
  8243.  
  8244. currentComponent = "tDBInput_7";
  8245.  
  8246. tos_count_tDBInput_7++;
  8247.  
  8248. /**
  8249. * [tDBInput_7 main ] stop
  8250. */
  8251.  
  8252. /**
  8253. * [tDBInput_7 process_data_begin ] start
  8254. */
  8255.  
  8256. currentComponent = "tDBInput_7";
  8257.  
  8258. /**
  8259. * [tDBInput_7 process_data_begin ] stop
  8260. */
  8261.  
  8262. /**
  8263. * [tAdvancedHash_row6 main ] start
  8264. */
  8265.  
  8266. currentComponent = "tAdvancedHash_row6";
  8267.  
  8268. // row6
  8269. // row6
  8270.  
  8271. if (execStat) {
  8272. runStat.updateStatOnConnection("row6" + iterateId,
  8273. 1, 1);
  8274. }
  8275.  
  8276. row6Struct row6_HashRow = new row6Struct();
  8277.  
  8278. row6_HashRow.idzamestnanci = row6.idzamestnanci;
  8279.  
  8280. row6_HashRow.dovolena_mesic = row6.dovolena_mesic;
  8281.  
  8282. row6_HashRow.dovolena_rok = row6.dovolena_rok;
  8283.  
  8284. row6_HashRow.dovolena_cerpani = row6.dovolena_cerpani;
  8285.  
  8286. tHash_Lookup_row6.put(row6_HashRow);
  8287.  
  8288. tos_count_tAdvancedHash_row6++;
  8289.  
  8290. /**
  8291. * [tAdvancedHash_row6 main ] stop
  8292. */
  8293.  
  8294. /**
  8295. * [tAdvancedHash_row6 process_data_begin ] start
  8296. */
  8297.  
  8298. currentComponent = "tAdvancedHash_row6";
  8299.  
  8300. /**
  8301. * [tAdvancedHash_row6 process_data_begin ] stop
  8302. */
  8303.  
  8304. /**
  8305. * [tAdvancedHash_row6 process_data_end ] start
  8306. */
  8307.  
  8308. currentComponent = "tAdvancedHash_row6";
  8309.  
  8310. /**
  8311. * [tAdvancedHash_row6 process_data_end ] stop
  8312. */
  8313.  
  8314. /**
  8315. * [tDBInput_7 process_data_end ] start
  8316. */
  8317.  
  8318. currentComponent = "tDBInput_7";
  8319.  
  8320. /**
  8321. * [tDBInput_7 process_data_end ] stop
  8322. */
  8323.  
  8324. /**
  8325. * [tDBInput_7 end ] start
  8326. */
  8327.  
  8328. currentComponent = "tDBInput_7";
  8329.  
  8330. }
  8331. } finally {
  8332. if (rs_tDBInput_7 != null) {
  8333. rs_tDBInput_7.close();
  8334. }
  8335. if (stmt_tDBInput_7 != null) {
  8336. stmt_tDBInput_7.close();
  8337. }
  8338. if (conn_tDBInput_7 != null && !conn_tDBInput_7.isClosed()) {
  8339.  
  8340. conn_tDBInput_7.close();
  8341.  
  8342. }
  8343. }
  8344. globalMap.put("tDBInput_7_NB_LINE", nb_line_tDBInput_7);
  8345.  
  8346. ok_Hash.put("tDBInput_7", true);
  8347. end_Hash.put("tDBInput_7", System.currentTimeMillis());
  8348.  
  8349. /**
  8350. * [tDBInput_7 end ] stop
  8351. */
  8352.  
  8353. /**
  8354. * [tAdvancedHash_row6 end ] start
  8355. */
  8356.  
  8357. currentComponent = "tAdvancedHash_row6";
  8358.  
  8359. tHash_Lookup_row6.endPut();
  8360.  
  8361. if (execStat) {
  8362. if (resourceMap.get("inIterateVComp") == null
  8363. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  8364. runStat.updateStatOnConnection("row6" + iterateId, 2, 0);
  8365. }
  8366. }
  8367.  
  8368. ok_Hash.put("tAdvancedHash_row6", true);
  8369. end_Hash.put("tAdvancedHash_row6", System.currentTimeMillis());
  8370.  
  8371. /**
  8372. * [tAdvancedHash_row6 end ] stop
  8373. */
  8374.  
  8375. }// end the resume
  8376.  
  8377. } catch (java.lang.Exception e) {
  8378.  
  8379. TalendException te = new TalendException(e, currentComponent,
  8380. globalMap);
  8381.  
  8382. throw te;
  8383. } catch (java.lang.Error error) {
  8384.  
  8385. runStat.stopThreadStat();
  8386.  
  8387. throw error;
  8388. } finally {
  8389.  
  8390. try {
  8391.  
  8392. /**
  8393. * [tDBInput_7 finally ] start
  8394. */
  8395.  
  8396. currentComponent = "tDBInput_7";
  8397.  
  8398. /**
  8399. * [tDBInput_7 finally ] stop
  8400. */
  8401.  
  8402. /**
  8403. * [tAdvancedHash_row6 finally ] start
  8404. */
  8405.  
  8406. currentComponent = "tAdvancedHash_row6";
  8407.  
  8408. /**
  8409. * [tAdvancedHash_row6 finally ] stop
  8410. */
  8411.  
  8412. } catch (java.lang.Exception e) {
  8413. // ignore
  8414. } catch (java.lang.Error error) {
  8415. // ignore
  8416. }
  8417. resourceMap = null;
  8418. }
  8419.  
  8420. globalMap.put("tDBInput_7_SUBPROCESS_STATE", 1);
  8421. }
  8422.  
  8423. public static class row7Struct implements
  8424. routines.system.IPersistableComparableLookupRow<row7Struct> {
  8425. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  8426. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  8427. protected static final int DEFAULT_HASHCODE = 1;
  8428. protected static final int PRIME = 31;
  8429. protected int hashCode = DEFAULT_HASHCODE;
  8430. public boolean hashCodeDirty = true;
  8431.  
  8432. public String loopKey;
  8433.  
  8434. public int idkalendare;
  8435.  
  8436. public int getIdkalendare() {
  8437. return this.idkalendare;
  8438. }
  8439.  
  8440. public String nazev_mesice;
  8441.  
  8442. public String getNazev_mesice() {
  8443. return this.nazev_mesice;
  8444. }
  8445.  
  8446. public java.util.Date ctvrtleti;
  8447.  
  8448. public java.util.Date getCtvrtleti() {
  8449. return this.ctvrtleti;
  8450. }
  8451.  
  8452. public short rok;
  8453.  
  8454. public short getRok() {
  8455. return this.rok;
  8456. }
  8457.  
  8458. @Override
  8459. public int hashCode() {
  8460. if (this.hashCodeDirty) {
  8461. final int prime = PRIME;
  8462. int result = DEFAULT_HASHCODE;
  8463.  
  8464. result = prime
  8465. * result
  8466. + ((this.nazev_mesice == null) ? 0 : this.nazev_mesice
  8467. .hashCode());
  8468.  
  8469. result = prime * result + (int) this.rok;
  8470.  
  8471. this.hashCode = result;
  8472. this.hashCodeDirty = false;
  8473. }
  8474. return this.hashCode;
  8475. }
  8476.  
  8477. @Override
  8478. public boolean equals(Object obj) {
  8479. if (this == obj)
  8480. return true;
  8481. if (obj == null)
  8482. return false;
  8483. if (getClass() != obj.getClass())
  8484. return false;
  8485. final row7Struct other = (row7Struct) obj;
  8486.  
  8487. if (this.nazev_mesice == null) {
  8488. if (other.nazev_mesice != null)
  8489. return false;
  8490.  
  8491. } else if (!this.nazev_mesice.equals(other.nazev_mesice))
  8492.  
  8493. return false;
  8494.  
  8495. if (this.rok != other.rok)
  8496. return false;
  8497.  
  8498. return true;
  8499. }
  8500.  
  8501. public void copyDataTo(row7Struct other) {
  8502.  
  8503. other.idkalendare = this.idkalendare;
  8504. other.nazev_mesice = this.nazev_mesice;
  8505. other.ctvrtleti = this.ctvrtleti;
  8506. other.rok = this.rok;
  8507.  
  8508. }
  8509.  
  8510. public void copyKeysDataTo(row7Struct other) {
  8511.  
  8512. other.nazev_mesice = this.nazev_mesice;
  8513. other.rok = this.rok;
  8514.  
  8515. }
  8516.  
  8517. private String readString(ObjectInputStream dis) throws IOException {
  8518. String strReturn = null;
  8519. int length = 0;
  8520. length = dis.readInt();
  8521. if (length == -1) {
  8522. strReturn = null;
  8523. } else {
  8524. if (length > commonByteArray_BI_FACT_snimek_dochazky.length) {
  8525. if (length < 1024
  8526. && commonByteArray_BI_FACT_snimek_dochazky.length == 0) {
  8527. commonByteArray_BI_FACT_snimek_dochazky = new byte[1024];
  8528. } else {
  8529. commonByteArray_BI_FACT_snimek_dochazky = new byte[2 * length];
  8530. }
  8531. }
  8532. dis.readFully(commonByteArray_BI_FACT_snimek_dochazky, 0,
  8533. length);
  8534. strReturn = new String(commonByteArray_BI_FACT_snimek_dochazky,
  8535. 0, length, utf8Charset);
  8536. }
  8537. return strReturn;
  8538. }
  8539.  
  8540. private void writeString(String str, ObjectOutputStream dos)
  8541. throws IOException {
  8542. if (str == null) {
  8543. dos.writeInt(-1);
  8544. } else {
  8545. byte[] byteArray = str.getBytes(utf8Charset);
  8546. dos.writeInt(byteArray.length);
  8547. dos.write(byteArray);
  8548. }
  8549. }
  8550.  
  8551. private java.util.Date readDate(DataInputStream dis,
  8552. ObjectInputStream ois) throws IOException {
  8553. java.util.Date dateReturn = null;
  8554. int length = 0;
  8555. length = dis.readByte();
  8556. if (length == -1) {
  8557. dateReturn = null;
  8558. } else {
  8559. dateReturn = new Date(dis.readLong());
  8560. }
  8561. return dateReturn;
  8562. }
  8563.  
  8564. private void writeDate(java.util.Date date1, DataOutputStream dos,
  8565. ObjectOutputStream oos) throws IOException {
  8566. if (date1 == null) {
  8567. dos.writeByte(-1);
  8568. } else {
  8569. dos.writeByte(0);
  8570. dos.writeLong(date1.getTime());
  8571. }
  8572. }
  8573.  
  8574. public void readKeysData(ObjectInputStream dis) {
  8575.  
  8576. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  8577.  
  8578. try {
  8579.  
  8580. int length = 0;
  8581.  
  8582. this.nazev_mesice = readString(dis);
  8583.  
  8584. this.rok = dis.readShort();
  8585.  
  8586. } catch (IOException e) {
  8587. throw new RuntimeException(e);
  8588.  
  8589. }
  8590.  
  8591. }
  8592.  
  8593. }
  8594.  
  8595. public void writeKeysData(ObjectOutputStream dos) {
  8596. try {
  8597.  
  8598. // String
  8599.  
  8600. writeString(this.nazev_mesice, dos);
  8601.  
  8602. // short
  8603.  
  8604. dos.writeShort(this.rok);
  8605.  
  8606. } catch (IOException e) {
  8607. throw new RuntimeException(e);
  8608. }
  8609.  
  8610. }
  8611.  
  8612. /**
  8613. * Fill Values data by reading ObjectInputStream.
  8614. */
  8615. public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
  8616. try {
  8617.  
  8618. int length = 0;
  8619.  
  8620. this.idkalendare = dis.readInt();
  8621.  
  8622. this.ctvrtleti = readDate(dis, ois);
  8623.  
  8624. } catch (IOException e) {
  8625. throw new RuntimeException(e);
  8626.  
  8627. }
  8628.  
  8629. }
  8630.  
  8631. /**
  8632. * Return a byte array which represents Values data.
  8633. */
  8634. public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
  8635. try {
  8636.  
  8637. dos.writeInt(this.idkalendare);
  8638.  
  8639. writeDate(this.ctvrtleti, dos, oos);
  8640.  
  8641. } catch (IOException e) {
  8642. throw new RuntimeException(e);
  8643. }
  8644.  
  8645. }
  8646.  
  8647. public String toString() {
  8648.  
  8649. StringBuilder sb = new StringBuilder();
  8650. sb.append(super.toString());
  8651. sb.append("[");
  8652. sb.append("idkalendare=" + String.valueOf(idkalendare));
  8653. sb.append(",nazev_mesice=" + nazev_mesice);
  8654. sb.append(",ctvrtleti=" + String.valueOf(ctvrtleti));
  8655. sb.append(",rok=" + String.valueOf(rok));
  8656. sb.append("]");
  8657.  
  8658. return sb.toString();
  8659. }
  8660.  
  8661. /**
  8662. * Compare keys
  8663. */
  8664. public int compareTo(row7Struct other) {
  8665.  
  8666. int returnValue = -1;
  8667.  
  8668. returnValue = checkNullsAndCompare(this.nazev_mesice,
  8669. other.nazev_mesice);
  8670. if (returnValue != 0) {
  8671. return returnValue;
  8672. }
  8673.  
  8674. returnValue = checkNullsAndCompare(this.rok, other.rok);
  8675. if (returnValue != 0) {
  8676. return returnValue;
  8677. }
  8678.  
  8679. return returnValue;
  8680. }
  8681.  
  8682. private int checkNullsAndCompare(Object object1, Object object2) {
  8683. int returnValue = 0;
  8684. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  8685. returnValue = ((Comparable) object1).compareTo(object2);
  8686. } else if (object1 != null && object2 != null) {
  8687. returnValue = compareStrings(object1.toString(),
  8688. object2.toString());
  8689. } else if (object1 == null && object2 != null) {
  8690. returnValue = 1;
  8691. } else if (object1 != null && object2 == null) {
  8692. returnValue = -1;
  8693. } else {
  8694. returnValue = 0;
  8695. }
  8696.  
  8697. return returnValue;
  8698. }
  8699.  
  8700. private int compareStrings(String string1, String string2) {
  8701. return string1.compareTo(string2);
  8702. }
  8703.  
  8704. }
  8705.  
  8706. public void tDBInput_8Process(final java.util.Map<String, Object> globalMap)
  8707. throws TalendException {
  8708. globalMap.put("tDBInput_8_SUBPROCESS_STATE", 0);
  8709.  
  8710. final boolean execStat = this.execStat;
  8711.  
  8712. String iterateId = "";
  8713.  
  8714. String currentComponent = "";
  8715. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  8716.  
  8717. try {
  8718. // TDI-39566 avoid throwing an useless Exception
  8719. boolean resumeIt = true;
  8720. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  8721. String currentMethodName = new java.lang.Exception()
  8722. .getStackTrace()[0].getMethodName();
  8723. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  8724. }
  8725. if (resumeIt || globalResumeTicket) { // start the resume
  8726. globalResumeTicket = true;
  8727.  
  8728. row7Struct row7 = new row7Struct();
  8729.  
  8730. /**
  8731. * [tAdvancedHash_row7 begin ] start
  8732. */
  8733.  
  8734. ok_Hash.put("tAdvancedHash_row7", false);
  8735. start_Hash
  8736. .put("tAdvancedHash_row7", System.currentTimeMillis());
  8737.  
  8738. currentComponent = "tAdvancedHash_row7";
  8739.  
  8740. if (execStat) {
  8741. if (resourceMap.get("inIterateVComp") == null) {
  8742.  
  8743. runStat.updateStatOnConnection("row7" + iterateId, 0, 0);
  8744.  
  8745. }
  8746. }
  8747.  
  8748. int tos_count_tAdvancedHash_row7 = 0;
  8749.  
  8750. // connection name:row7
  8751. // source node:tDBInput_8 - inputs:(after_tDBInput_6)
  8752. // outputs:(row7,row7) | target node:tAdvancedHash_row7 -
  8753. // inputs:(row7) outputs:()
  8754. // linked node: tMap_2 -
  8755. // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
  8756. // outputs:(out2)
  8757.  
  8758. org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row7 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
  8759.  
  8760. org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row7Struct> tHash_Lookup_row7 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
  8761. .<row7Struct> getLookup(matchingModeEnum_row7);
  8762.  
  8763. globalMap.put("tHash_Lookup_row7", tHash_Lookup_row7);
  8764.  
  8765. /**
  8766. * [tAdvancedHash_row7 begin ] stop
  8767. */
  8768.  
  8769. /**
  8770. * [tDBInput_8 begin ] start
  8771. */
  8772.  
  8773. ok_Hash.put("tDBInput_8", false);
  8774. start_Hash.put("tDBInput_8", System.currentTimeMillis());
  8775.  
  8776. currentComponent = "tDBInput_8";
  8777.  
  8778. int tos_count_tDBInput_8 = 0;
  8779.  
  8780. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_8 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  8781. .getMSSqlGenerateTimestampUtil();
  8782.  
  8783. java.util.List<String> talendToDBList_tDBInput_8 = new java.util.ArrayList();
  8784. String[] talendToDBArray_tDBInput_8 = new String[] { "FLOAT",
  8785. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  8786. "DECIMAL IDENTITY", "REAL" };
  8787. java.util.Collections.addAll(talendToDBList_tDBInput_8,
  8788. talendToDBArray_tDBInput_8);
  8789. int nb_line_tDBInput_8 = 0;
  8790. java.sql.Connection conn_tDBInput_8 = null;
  8791. String driverClass_tDBInput_8 = "net.sourceforge.jtds.jdbc.Driver";
  8792. java.lang.Class.forName(driverClass_tDBInput_8);
  8793. String dbUser_tDBInput_8 = "tym1";
  8794.  
  8795. final String decryptedPassword_tDBInput_8 = routines.system.PasswordEncryptUtil
  8796. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  8797.  
  8798. String dbPwd_tDBInput_8 = decryptedPassword_tDBInput_8;
  8799.  
  8800. String port_tDBInput_8 = "1433";
  8801. String dbname_tDBInput_8 = "tym1";
  8802. String url_tDBInput_8 = "jdbc:jtds:sqlserver://"
  8803. + "158.196.160.60";
  8804. if (!"".equals(port_tDBInput_8)) {
  8805. url_tDBInput_8 += ":" + "1433";
  8806. }
  8807. if (!"".equals(dbname_tDBInput_8)) {
  8808. url_tDBInput_8 += "//" + "tym1";
  8809. }
  8810. url_tDBInput_8 += ";appName=" + projectName + ";" + "";
  8811. String dbschema_tDBInput_8 = "";
  8812.  
  8813. conn_tDBInput_8 = java.sql.DriverManager.getConnection(
  8814. url_tDBInput_8, dbUser_tDBInput_8, dbPwd_tDBInput_8);
  8815.  
  8816. java.sql.Statement stmt_tDBInput_8 = conn_tDBInput_8
  8817. .createStatement();
  8818.  
  8819. String dbquery_tDBInput_8 = "SELECT DIM_kalendar.idkalendare,\n DIM_kalendar.nazev_mesice,\n DIM_kalendar.ctvrtleti,\n DIM_kalendar.rok\nFROM DIM_kal"
  8820. + "endar";
  8821.  
  8822. globalMap.put("tDBInput_8_QUERY", dbquery_tDBInput_8);
  8823. java.sql.ResultSet rs_tDBInput_8 = null;
  8824.  
  8825. try {
  8826. rs_tDBInput_8 = stmt_tDBInput_8
  8827. .executeQuery(dbquery_tDBInput_8);
  8828. java.sql.ResultSetMetaData rsmd_tDBInput_8 = rs_tDBInput_8
  8829. .getMetaData();
  8830. int colQtyInRs_tDBInput_8 = rsmd_tDBInput_8
  8831. .getColumnCount();
  8832.  
  8833. String tmpContent_tDBInput_8 = null;
  8834.  
  8835. while (rs_tDBInput_8.next()) {
  8836. nb_line_tDBInput_8++;
  8837.  
  8838. if (colQtyInRs_tDBInput_8 < 1) {
  8839. row7.idkalendare = 0;
  8840. } else {
  8841.  
  8842. if (rs_tDBInput_8.getObject(1) != null) {
  8843. row7.idkalendare = rs_tDBInput_8.getInt(1);
  8844. } else {
  8845. throw new RuntimeException(
  8846. "Null value in non-Nullable column");
  8847. }
  8848. }
  8849. if (colQtyInRs_tDBInput_8 < 2) {
  8850. row7.nazev_mesice = null;
  8851. } else {
  8852.  
  8853. tmpContent_tDBInput_8 = rs_tDBInput_8.getString(2);
  8854. if (tmpContent_tDBInput_8 != null) {
  8855. if (talendToDBList_tDBInput_8
  8856. .contains(rsmd_tDBInput_8
  8857. .getColumnTypeName(2)
  8858. .toUpperCase(
  8859. java.util.Locale.ENGLISH))) {
  8860. row7.nazev_mesice = FormatterUtils
  8861. .formatUnwithE(tmpContent_tDBInput_8);
  8862. } else {
  8863. row7.nazev_mesice = tmpContent_tDBInput_8;
  8864. }
  8865. } else {
  8866. row7.nazev_mesice = null;
  8867. }
  8868. }
  8869. if (colQtyInRs_tDBInput_8 < 3) {
  8870. row7.ctvrtleti = null;
  8871. } else {
  8872.  
  8873. row7.ctvrtleti = mssqlGTU_tDBInput_8.getDate(
  8874. rsmd_tDBInput_8, rs_tDBInput_8, 3);
  8875.  
  8876. }
  8877. if (colQtyInRs_tDBInput_8 < 4) {
  8878. row7.rok = 0;
  8879. } else {
  8880.  
  8881. if (rs_tDBInput_8.getObject(4) != null) {
  8882. row7.rok = rs_tDBInput_8.getShort(4);
  8883. } else {
  8884. throw new RuntimeException(
  8885. "Null value in non-Nullable column");
  8886. }
  8887. }
  8888.  
  8889. /**
  8890. * [tDBInput_8 begin ] stop
  8891. */
  8892.  
  8893. /**
  8894. * [tDBInput_8 main ] start
  8895. */
  8896.  
  8897. currentComponent = "tDBInput_8";
  8898.  
  8899. tos_count_tDBInput_8++;
  8900.  
  8901. /**
  8902. * [tDBInput_8 main ] stop
  8903. */
  8904.  
  8905. /**
  8906. * [tDBInput_8 process_data_begin ] start
  8907. */
  8908.  
  8909. currentComponent = "tDBInput_8";
  8910.  
  8911. /**
  8912. * [tDBInput_8 process_data_begin ] stop
  8913. */
  8914.  
  8915. /**
  8916. * [tAdvancedHash_row7 main ] start
  8917. */
  8918.  
  8919. currentComponent = "tAdvancedHash_row7";
  8920.  
  8921. // row7
  8922. // row7
  8923.  
  8924. if (execStat) {
  8925. runStat.updateStatOnConnection("row7" + iterateId,
  8926. 1, 1);
  8927. }
  8928.  
  8929. row7Struct row7_HashRow = new row7Struct();
  8930.  
  8931. row7_HashRow.idkalendare = row7.idkalendare;
  8932.  
  8933. row7_HashRow.nazev_mesice = row7.nazev_mesice;
  8934.  
  8935. row7_HashRow.ctvrtleti = row7.ctvrtleti;
  8936.  
  8937. row7_HashRow.rok = row7.rok;
  8938.  
  8939. tHash_Lookup_row7.put(row7_HashRow);
  8940.  
  8941. tos_count_tAdvancedHash_row7++;
  8942.  
  8943. /**
  8944. * [tAdvancedHash_row7 main ] stop
  8945. */
  8946.  
  8947. /**
  8948. * [tAdvancedHash_row7 process_data_begin ] start
  8949. */
  8950.  
  8951. currentComponent = "tAdvancedHash_row7";
  8952.  
  8953. /**
  8954. * [tAdvancedHash_row7 process_data_begin ] stop
  8955. */
  8956.  
  8957. /**
  8958. * [tAdvancedHash_row7 process_data_end ] start
  8959. */
  8960.  
  8961. currentComponent = "tAdvancedHash_row7";
  8962.  
  8963. /**
  8964. * [tAdvancedHash_row7 process_data_end ] stop
  8965. */
  8966.  
  8967. /**
  8968. * [tDBInput_8 process_data_end ] start
  8969. */
  8970.  
  8971. currentComponent = "tDBInput_8";
  8972.  
  8973. /**
  8974. * [tDBInput_8 process_data_end ] stop
  8975. */
  8976.  
  8977. /**
  8978. * [tDBInput_8 end ] start
  8979. */
  8980.  
  8981. currentComponent = "tDBInput_8";
  8982.  
  8983. }
  8984. } finally {
  8985. if (rs_tDBInput_8 != null) {
  8986. rs_tDBInput_8.close();
  8987. }
  8988. if (stmt_tDBInput_8 != null) {
  8989. stmt_tDBInput_8.close();
  8990. }
  8991. if (conn_tDBInput_8 != null && !conn_tDBInput_8.isClosed()) {
  8992.  
  8993. conn_tDBInput_8.close();
  8994.  
  8995. }
  8996. }
  8997. globalMap.put("tDBInput_8_NB_LINE", nb_line_tDBInput_8);
  8998.  
  8999. ok_Hash.put("tDBInput_8", true);
  9000. end_Hash.put("tDBInput_8", System.currentTimeMillis());
  9001.  
  9002. /**
  9003. * [tDBInput_8 end ] stop
  9004. */
  9005.  
  9006. /**
  9007. * [tAdvancedHash_row7 end ] start
  9008. */
  9009.  
  9010. currentComponent = "tAdvancedHash_row7";
  9011.  
  9012. tHash_Lookup_row7.endPut();
  9013.  
  9014. if (execStat) {
  9015. if (resourceMap.get("inIterateVComp") == null
  9016. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  9017. runStat.updateStatOnConnection("row7" + iterateId, 2, 0);
  9018. }
  9019. }
  9020.  
  9021. ok_Hash.put("tAdvancedHash_row7", true);
  9022. end_Hash.put("tAdvancedHash_row7", System.currentTimeMillis());
  9023.  
  9024. /**
  9025. * [tAdvancedHash_row7 end ] stop
  9026. */
  9027.  
  9028. }// end the resume
  9029.  
  9030. } catch (java.lang.Exception e) {
  9031.  
  9032. TalendException te = new TalendException(e, currentComponent,
  9033. globalMap);
  9034.  
  9035. throw te;
  9036. } catch (java.lang.Error error) {
  9037.  
  9038. runStat.stopThreadStat();
  9039.  
  9040. throw error;
  9041. } finally {
  9042.  
  9043. try {
  9044.  
  9045. /**
  9046. * [tDBInput_8 finally ] start
  9047. */
  9048.  
  9049. currentComponent = "tDBInput_8";
  9050.  
  9051. /**
  9052. * [tDBInput_8 finally ] stop
  9053. */
  9054.  
  9055. /**
  9056. * [tAdvancedHash_row7 finally ] start
  9057. */
  9058.  
  9059. currentComponent = "tAdvancedHash_row7";
  9060.  
  9061. /**
  9062. * [tAdvancedHash_row7 finally ] stop
  9063. */
  9064.  
  9065. } catch (java.lang.Exception e) {
  9066. // ignore
  9067. } catch (java.lang.Error error) {
  9068. // ignore
  9069. }
  9070. resourceMap = null;
  9071. }
  9072.  
  9073. globalMap.put("tDBInput_8_SUBPROCESS_STATE", 1);
  9074. }
  9075.  
  9076. public static class row8Struct implements
  9077. routines.system.IPersistableComparableLookupRow<row8Struct> {
  9078. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  9079. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  9080. protected static final int DEFAULT_HASHCODE = 1;
  9081. protected static final int PRIME = 31;
  9082. protected int hashCode = DEFAULT_HASHCODE;
  9083. public boolean hashCodeDirty = true;
  9084.  
  9085. public String loopKey;
  9086.  
  9087. public int idsazby;
  9088.  
  9089. public int getIdsazby() {
  9090. return this.idsazby;
  9091. }
  9092.  
  9093. public int cislo_sazby;
  9094.  
  9095. public int getCislo_sazby() {
  9096. return this.cislo_sazby;
  9097. }
  9098.  
  9099. public String nazev_profese;
  9100.  
  9101. public String getNazev_profese() {
  9102. return this.nazev_profese;
  9103. }
  9104.  
  9105. public int hodinova_sazba;
  9106.  
  9107. public int getHodinova_sazba() {
  9108. return this.hodinova_sazba;
  9109. }
  9110.  
  9111. @Override
  9112. public int hashCode() {
  9113. if (this.hashCodeDirty) {
  9114. final int prime = PRIME;
  9115. int result = DEFAULT_HASHCODE;
  9116.  
  9117. result = prime
  9118. * result
  9119. + ((this.nazev_profese == null) ? 0
  9120. : this.nazev_profese.hashCode());
  9121.  
  9122. this.hashCode = result;
  9123. this.hashCodeDirty = false;
  9124. }
  9125. return this.hashCode;
  9126. }
  9127.  
  9128. @Override
  9129. public boolean equals(Object obj) {
  9130. if (this == obj)
  9131. return true;
  9132. if (obj == null)
  9133. return false;
  9134. if (getClass() != obj.getClass())
  9135. return false;
  9136. final row8Struct other = (row8Struct) obj;
  9137.  
  9138. if (this.nazev_profese == null) {
  9139. if (other.nazev_profese != null)
  9140. return false;
  9141.  
  9142. } else if (!this.nazev_profese.equals(other.nazev_profese))
  9143.  
  9144. return false;
  9145.  
  9146. return true;
  9147. }
  9148.  
  9149. public void copyDataTo(row8Struct other) {
  9150.  
  9151. other.idsazby = this.idsazby;
  9152. other.cislo_sazby = this.cislo_sazby;
  9153. other.nazev_profese = this.nazev_profese;
  9154. other.hodinova_sazba = this.hodinova_sazba;
  9155.  
  9156. }
  9157.  
  9158. public void copyKeysDataTo(row8Struct other) {
  9159.  
  9160. other.nazev_profese = this.nazev_profese;
  9161.  
  9162. }
  9163.  
  9164. private String readString(ObjectInputStream dis) throws IOException {
  9165. String strReturn = null;
  9166. int length = 0;
  9167. length = dis.readInt();
  9168. if (length == -1) {
  9169. strReturn = null;
  9170. } else {
  9171. if (length > commonByteArray_BI_FACT_snimek_dochazky.length) {
  9172. if (length < 1024
  9173. && commonByteArray_BI_FACT_snimek_dochazky.length == 0) {
  9174. commonByteArray_BI_FACT_snimek_dochazky = new byte[1024];
  9175. } else {
  9176. commonByteArray_BI_FACT_snimek_dochazky = new byte[2 * length];
  9177. }
  9178. }
  9179. dis.readFully(commonByteArray_BI_FACT_snimek_dochazky, 0,
  9180. length);
  9181. strReturn = new String(commonByteArray_BI_FACT_snimek_dochazky,
  9182. 0, length, utf8Charset);
  9183. }
  9184. return strReturn;
  9185. }
  9186.  
  9187. private void writeString(String str, ObjectOutputStream dos)
  9188. throws IOException {
  9189. if (str == null) {
  9190. dos.writeInt(-1);
  9191. } else {
  9192. byte[] byteArray = str.getBytes(utf8Charset);
  9193. dos.writeInt(byteArray.length);
  9194. dos.write(byteArray);
  9195. }
  9196. }
  9197.  
  9198. public void readKeysData(ObjectInputStream dis) {
  9199.  
  9200. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  9201.  
  9202. try {
  9203.  
  9204. int length = 0;
  9205.  
  9206. this.nazev_profese = readString(dis);
  9207.  
  9208. } catch (IOException e) {
  9209. throw new RuntimeException(e);
  9210.  
  9211. }
  9212.  
  9213. }
  9214.  
  9215. }
  9216.  
  9217. public void writeKeysData(ObjectOutputStream dos) {
  9218. try {
  9219.  
  9220. // String
  9221.  
  9222. writeString(this.nazev_profese, dos);
  9223.  
  9224. } catch (IOException e) {
  9225. throw new RuntimeException(e);
  9226. }
  9227.  
  9228. }
  9229.  
  9230. /**
  9231. * Fill Values data by reading ObjectInputStream.
  9232. */
  9233. public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
  9234. try {
  9235.  
  9236. int length = 0;
  9237.  
  9238. this.idsazby = dis.readInt();
  9239.  
  9240. this.cislo_sazby = dis.readInt();
  9241.  
  9242. this.hodinova_sazba = dis.readInt();
  9243.  
  9244. } catch (IOException e) {
  9245. throw new RuntimeException(e);
  9246.  
  9247. }
  9248.  
  9249. }
  9250.  
  9251. /**
  9252. * Return a byte array which represents Values data.
  9253. */
  9254. public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
  9255. try {
  9256.  
  9257. dos.writeInt(this.idsazby);
  9258.  
  9259. dos.writeInt(this.cislo_sazby);
  9260.  
  9261. dos.writeInt(this.hodinova_sazba);
  9262.  
  9263. } catch (IOException e) {
  9264. throw new RuntimeException(e);
  9265. }
  9266.  
  9267. }
  9268.  
  9269. public String toString() {
  9270.  
  9271. StringBuilder sb = new StringBuilder();
  9272. sb.append(super.toString());
  9273. sb.append("[");
  9274. sb.append("idsazby=" + String.valueOf(idsazby));
  9275. sb.append(",cislo_sazby=" + String.valueOf(cislo_sazby));
  9276. sb.append(",nazev_profese=" + nazev_profese);
  9277. sb.append(",hodinova_sazba=" + String.valueOf(hodinova_sazba));
  9278. sb.append("]");
  9279.  
  9280. return sb.toString();
  9281. }
  9282.  
  9283. /**
  9284. * Compare keys
  9285. */
  9286. public int compareTo(row8Struct other) {
  9287.  
  9288. int returnValue = -1;
  9289.  
  9290. returnValue = checkNullsAndCompare(this.nazev_profese,
  9291. other.nazev_profese);
  9292. if (returnValue != 0) {
  9293. return returnValue;
  9294. }
  9295.  
  9296. return returnValue;
  9297. }
  9298.  
  9299. private int checkNullsAndCompare(Object object1, Object object2) {
  9300. int returnValue = 0;
  9301. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  9302. returnValue = ((Comparable) object1).compareTo(object2);
  9303. } else if (object1 != null && object2 != null) {
  9304. returnValue = compareStrings(object1.toString(),
  9305. object2.toString());
  9306. } else if (object1 == null && object2 != null) {
  9307. returnValue = 1;
  9308. } else if (object1 != null && object2 == null) {
  9309. returnValue = -1;
  9310. } else {
  9311. returnValue = 0;
  9312. }
  9313.  
  9314. return returnValue;
  9315. }
  9316.  
  9317. private int compareStrings(String string1, String string2) {
  9318. return string1.compareTo(string2);
  9319. }
  9320.  
  9321. }
  9322.  
  9323. public void tDBInput_9Process(final java.util.Map<String, Object> globalMap)
  9324. throws TalendException {
  9325. globalMap.put("tDBInput_9_SUBPROCESS_STATE", 0);
  9326.  
  9327. final boolean execStat = this.execStat;
  9328.  
  9329. String iterateId = "";
  9330.  
  9331. String currentComponent = "";
  9332. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  9333.  
  9334. try {
  9335. // TDI-39566 avoid throwing an useless Exception
  9336. boolean resumeIt = true;
  9337. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  9338. String currentMethodName = new java.lang.Exception()
  9339. .getStackTrace()[0].getMethodName();
  9340. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  9341. }
  9342. if (resumeIt || globalResumeTicket) { // start the resume
  9343. globalResumeTicket = true;
  9344.  
  9345. row8Struct row8 = new row8Struct();
  9346.  
  9347. /**
  9348. * [tAdvancedHash_row8 begin ] start
  9349. */
  9350.  
  9351. ok_Hash.put("tAdvancedHash_row8", false);
  9352. start_Hash
  9353. .put("tAdvancedHash_row8", System.currentTimeMillis());
  9354.  
  9355. currentComponent = "tAdvancedHash_row8";
  9356.  
  9357. if (execStat) {
  9358. if (resourceMap.get("inIterateVComp") == null) {
  9359.  
  9360. runStat.updateStatOnConnection("row8" + iterateId, 0, 0);
  9361.  
  9362. }
  9363. }
  9364.  
  9365. int tos_count_tAdvancedHash_row8 = 0;
  9366.  
  9367. // connection name:row8
  9368. // source node:tDBInput_9 - inputs:(after_tDBInput_6)
  9369. // outputs:(row8,row8) | target node:tAdvancedHash_row8 -
  9370. // inputs:(row8) outputs:()
  9371. // linked node: tMap_2 -
  9372. // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
  9373. // outputs:(out2)
  9374.  
  9375. org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row8 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
  9376.  
  9377. org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct> tHash_Lookup_row8 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
  9378. .<row8Struct> getLookup(matchingModeEnum_row8);
  9379.  
  9380. globalMap.put("tHash_Lookup_row8", tHash_Lookup_row8);
  9381.  
  9382. /**
  9383. * [tAdvancedHash_row8 begin ] stop
  9384. */
  9385.  
  9386. /**
  9387. * [tDBInput_9 begin ] start
  9388. */
  9389.  
  9390. ok_Hash.put("tDBInput_9", false);
  9391. start_Hash.put("tDBInput_9", System.currentTimeMillis());
  9392.  
  9393. currentComponent = "tDBInput_9";
  9394.  
  9395. int tos_count_tDBInput_9 = 0;
  9396.  
  9397. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_9 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  9398. .getMSSqlGenerateTimestampUtil();
  9399.  
  9400. java.util.List<String> talendToDBList_tDBInput_9 = new java.util.ArrayList();
  9401. String[] talendToDBArray_tDBInput_9 = new String[] { "FLOAT",
  9402. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  9403. "DECIMAL IDENTITY", "REAL" };
  9404. java.util.Collections.addAll(talendToDBList_tDBInput_9,
  9405. talendToDBArray_tDBInput_9);
  9406. int nb_line_tDBInput_9 = 0;
  9407. java.sql.Connection conn_tDBInput_9 = null;
  9408. String driverClass_tDBInput_9 = "net.sourceforge.jtds.jdbc.Driver";
  9409. java.lang.Class.forName(driverClass_tDBInput_9);
  9410. String dbUser_tDBInput_9 = "tym1";
  9411.  
  9412. final String decryptedPassword_tDBInput_9 = routines.system.PasswordEncryptUtil
  9413. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  9414.  
  9415. String dbPwd_tDBInput_9 = decryptedPassword_tDBInput_9;
  9416.  
  9417. String port_tDBInput_9 = "1433";
  9418. String dbname_tDBInput_9 = "tym1";
  9419. String url_tDBInput_9 = "jdbc:jtds:sqlserver://"
  9420. + "158.196.160.60";
  9421. if (!"".equals(port_tDBInput_9)) {
  9422. url_tDBInput_9 += ":" + "1433";
  9423. }
  9424. if (!"".equals(dbname_tDBInput_9)) {
  9425. url_tDBInput_9 += "//" + "tym1";
  9426. }
  9427. url_tDBInput_9 += ";appName=" + projectName + ";" + "";
  9428. String dbschema_tDBInput_9 = "";
  9429.  
  9430. conn_tDBInput_9 = java.sql.DriverManager.getConnection(
  9431. url_tDBInput_9, dbUser_tDBInput_9, dbPwd_tDBInput_9);
  9432.  
  9433. java.sql.Statement stmt_tDBInput_9 = conn_tDBInput_9
  9434. .createStatement();
  9435.  
  9436. 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"
  9437. + "odinova_sazba\nFROM DIM_mzdove_sazby";
  9438.  
  9439. globalMap.put("tDBInput_9_QUERY", dbquery_tDBInput_9);
  9440. java.sql.ResultSet rs_tDBInput_9 = null;
  9441.  
  9442. try {
  9443. rs_tDBInput_9 = stmt_tDBInput_9
  9444. .executeQuery(dbquery_tDBInput_9);
  9445. java.sql.ResultSetMetaData rsmd_tDBInput_9 = rs_tDBInput_9
  9446. .getMetaData();
  9447. int colQtyInRs_tDBInput_9 = rsmd_tDBInput_9
  9448. .getColumnCount();
  9449.  
  9450. String tmpContent_tDBInput_9 = null;
  9451.  
  9452. while (rs_tDBInput_9.next()) {
  9453. nb_line_tDBInput_9++;
  9454.  
  9455. if (colQtyInRs_tDBInput_9 < 1) {
  9456. row8.idsazby = 0;
  9457. } else {
  9458.  
  9459. if (rs_tDBInput_9.getObject(1) != null) {
  9460. row8.idsazby = rs_tDBInput_9.getInt(1);
  9461. } else {
  9462. throw new RuntimeException(
  9463. "Null value in non-Nullable column");
  9464. }
  9465. }
  9466. if (colQtyInRs_tDBInput_9 < 2) {
  9467. row8.cislo_sazby = 0;
  9468. } else {
  9469.  
  9470. if (rs_tDBInput_9.getObject(2) != null) {
  9471. row8.cislo_sazby = rs_tDBInput_9.getInt(2);
  9472. } else {
  9473. throw new RuntimeException(
  9474. "Null value in non-Nullable column");
  9475. }
  9476. }
  9477. if (colQtyInRs_tDBInput_9 < 3) {
  9478. row8.nazev_profese = null;
  9479. } else {
  9480.  
  9481. tmpContent_tDBInput_9 = rs_tDBInput_9.getString(3);
  9482. if (tmpContent_tDBInput_9 != null) {
  9483. if (talendToDBList_tDBInput_9
  9484. .contains(rsmd_tDBInput_9
  9485. .getColumnTypeName(3)
  9486. .toUpperCase(
  9487. java.util.Locale.ENGLISH))) {
  9488. row8.nazev_profese = FormatterUtils
  9489. .formatUnwithE(tmpContent_tDBInput_9);
  9490. } else {
  9491. row8.nazev_profese = tmpContent_tDBInput_9;
  9492. }
  9493. } else {
  9494. row8.nazev_profese = null;
  9495. }
  9496. }
  9497. if (colQtyInRs_tDBInput_9 < 4) {
  9498. row8.hodinova_sazba = 0;
  9499. } else {
  9500.  
  9501. if (rs_tDBInput_9.getObject(4) != null) {
  9502. row8.hodinova_sazba = rs_tDBInput_9.getInt(4);
  9503. } else {
  9504. throw new RuntimeException(
  9505. "Null value in non-Nullable column");
  9506. }
  9507. }
  9508.  
  9509. /**
  9510. * [tDBInput_9 begin ] stop
  9511. */
  9512.  
  9513. /**
  9514. * [tDBInput_9 main ] start
  9515. */
  9516.  
  9517. currentComponent = "tDBInput_9";
  9518.  
  9519. tos_count_tDBInput_9++;
  9520.  
  9521. /**
  9522. * [tDBInput_9 main ] stop
  9523. */
  9524.  
  9525. /**
  9526. * [tDBInput_9 process_data_begin ] start
  9527. */
  9528.  
  9529. currentComponent = "tDBInput_9";
  9530.  
  9531. /**
  9532. * [tDBInput_9 process_data_begin ] stop
  9533. */
  9534.  
  9535. /**
  9536. * [tAdvancedHash_row8 main ] start
  9537. */
  9538.  
  9539. currentComponent = "tAdvancedHash_row8";
  9540.  
  9541. // row8
  9542. // row8
  9543.  
  9544. if (execStat) {
  9545. runStat.updateStatOnConnection("row8" + iterateId,
  9546. 1, 1);
  9547. }
  9548.  
  9549. row8Struct row8_HashRow = new row8Struct();
  9550.  
  9551. row8_HashRow.idsazby = row8.idsazby;
  9552.  
  9553. row8_HashRow.cislo_sazby = row8.cislo_sazby;
  9554.  
  9555. row8_HashRow.nazev_profese = row8.nazev_profese;
  9556.  
  9557. row8_HashRow.hodinova_sazba = row8.hodinova_sazba;
  9558.  
  9559. tHash_Lookup_row8.put(row8_HashRow);
  9560.  
  9561. tos_count_tAdvancedHash_row8++;
  9562.  
  9563. /**
  9564. * [tAdvancedHash_row8 main ] stop
  9565. */
  9566.  
  9567. /**
  9568. * [tAdvancedHash_row8 process_data_begin ] start
  9569. */
  9570.  
  9571. currentComponent = "tAdvancedHash_row8";
  9572.  
  9573. /**
  9574. * [tAdvancedHash_row8 process_data_begin ] stop
  9575. */
  9576.  
  9577. /**
  9578. * [tAdvancedHash_row8 process_data_end ] start
  9579. */
  9580.  
  9581. currentComponent = "tAdvancedHash_row8";
  9582.  
  9583. /**
  9584. * [tAdvancedHash_row8 process_data_end ] stop
  9585. */
  9586.  
  9587. /**
  9588. * [tDBInput_9 process_data_end ] start
  9589. */
  9590.  
  9591. currentComponent = "tDBInput_9";
  9592.  
  9593. /**
  9594. * [tDBInput_9 process_data_end ] stop
  9595. */
  9596.  
  9597. /**
  9598. * [tDBInput_9 end ] start
  9599. */
  9600.  
  9601. currentComponent = "tDBInput_9";
  9602.  
  9603. }
  9604. } finally {
  9605. if (rs_tDBInput_9 != null) {
  9606. rs_tDBInput_9.close();
  9607. }
  9608. if (stmt_tDBInput_9 != null) {
  9609. stmt_tDBInput_9.close();
  9610. }
  9611. if (conn_tDBInput_9 != null && !conn_tDBInput_9.isClosed()) {
  9612.  
  9613. conn_tDBInput_9.close();
  9614.  
  9615. }
  9616. }
  9617. globalMap.put("tDBInput_9_NB_LINE", nb_line_tDBInput_9);
  9618.  
  9619. ok_Hash.put("tDBInput_9", true);
  9620. end_Hash.put("tDBInput_9", System.currentTimeMillis());
  9621.  
  9622. /**
  9623. * [tDBInput_9 end ] stop
  9624. */
  9625.  
  9626. /**
  9627. * [tAdvancedHash_row8 end ] start
  9628. */
  9629.  
  9630. currentComponent = "tAdvancedHash_row8";
  9631.  
  9632. tHash_Lookup_row8.endPut();
  9633.  
  9634. if (execStat) {
  9635. if (resourceMap.get("inIterateVComp") == null
  9636. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  9637. runStat.updateStatOnConnection("row8" + iterateId, 2, 0);
  9638. }
  9639. }
  9640.  
  9641. ok_Hash.put("tAdvancedHash_row8", true);
  9642. end_Hash.put("tAdvancedHash_row8", System.currentTimeMillis());
  9643.  
  9644. /**
  9645. * [tAdvancedHash_row8 end ] stop
  9646. */
  9647.  
  9648. }// end the resume
  9649.  
  9650. } catch (java.lang.Exception e) {
  9651.  
  9652. TalendException te = new TalendException(e, currentComponent,
  9653. globalMap);
  9654.  
  9655. throw te;
  9656. } catch (java.lang.Error error) {
  9657.  
  9658. runStat.stopThreadStat();
  9659.  
  9660. throw error;
  9661. } finally {
  9662.  
  9663. try {
  9664.  
  9665. /**
  9666. * [tDBInput_9 finally ] start
  9667. */
  9668.  
  9669. currentComponent = "tDBInput_9";
  9670.  
  9671. /**
  9672. * [tDBInput_9 finally ] stop
  9673. */
  9674.  
  9675. /**
  9676. * [tAdvancedHash_row8 finally ] start
  9677. */
  9678.  
  9679. currentComponent = "tAdvancedHash_row8";
  9680.  
  9681. /**
  9682. * [tAdvancedHash_row8 finally ] stop
  9683. */
  9684.  
  9685. } catch (java.lang.Exception e) {
  9686. // ignore
  9687. } catch (java.lang.Error error) {
  9688. // ignore
  9689. }
  9690. resourceMap = null;
  9691. }
  9692.  
  9693. globalMap.put("tDBInput_9_SUBPROCESS_STATE", 1);
  9694. }
  9695.  
  9696. public static class row9Struct implements
  9697. routines.system.IPersistableComparableLookupRow<row9Struct> {
  9698. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  9699. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  9700. protected static final int DEFAULT_HASHCODE = 1;
  9701. protected static final int PRIME = 31;
  9702. protected int hashCode = DEFAULT_HASHCODE;
  9703. public boolean hashCodeDirty = true;
  9704.  
  9705. public String loopKey;
  9706.  
  9707. public int idpracoviste;
  9708.  
  9709. public int getIdpracoviste() {
  9710. return this.idpracoviste;
  9711. }
  9712.  
  9713. public int cislo_pracoviste;
  9714.  
  9715. public int getCislo_pracoviste() {
  9716. return this.cislo_pracoviste;
  9717. }
  9718.  
  9719. public String nazev_pracoviste;
  9720.  
  9721. public String getNazev_pracoviste() {
  9722. return this.nazev_pracoviste;
  9723. }
  9724.  
  9725. @Override
  9726. public int hashCode() {
  9727. if (this.hashCodeDirty) {
  9728. final int prime = PRIME;
  9729. int result = DEFAULT_HASHCODE;
  9730.  
  9731. result = prime * result + (int) this.cislo_pracoviste;
  9732.  
  9733. this.hashCode = result;
  9734. this.hashCodeDirty = false;
  9735. }
  9736. return this.hashCode;
  9737. }
  9738.  
  9739. @Override
  9740. public boolean equals(Object obj) {
  9741. if (this == obj)
  9742. return true;
  9743. if (obj == null)
  9744. return false;
  9745. if (getClass() != obj.getClass())
  9746. return false;
  9747. final row9Struct other = (row9Struct) obj;
  9748.  
  9749. if (this.cislo_pracoviste != other.cislo_pracoviste)
  9750. return false;
  9751.  
  9752. return true;
  9753. }
  9754.  
  9755. public void copyDataTo(row9Struct other) {
  9756.  
  9757. other.idpracoviste = this.idpracoviste;
  9758. other.cislo_pracoviste = this.cislo_pracoviste;
  9759. other.nazev_pracoviste = this.nazev_pracoviste;
  9760.  
  9761. }
  9762.  
  9763. public void copyKeysDataTo(row9Struct other) {
  9764.  
  9765. other.cislo_pracoviste = this.cislo_pracoviste;
  9766.  
  9767. }
  9768.  
  9769. private String readString(DataInputStream dis, ObjectInputStream ois)
  9770. throws IOException {
  9771. String strReturn = null;
  9772. int length = 0;
  9773. length = dis.readInt();
  9774. if (length == -1) {
  9775. strReturn = null;
  9776. } else {
  9777. byte[] byteArray = new byte[length];
  9778. dis.read(byteArray);
  9779. strReturn = new String(byteArray, utf8Charset);
  9780. }
  9781. return strReturn;
  9782. }
  9783.  
  9784. private void writeString(String str, DataOutputStream dos,
  9785. ObjectOutputStream oos) throws IOException {
  9786. if (str == null) {
  9787. dos.writeInt(-1);
  9788. } else {
  9789. byte[] byteArray = str.getBytes(utf8Charset);
  9790. dos.writeInt(byteArray.length);
  9791. dos.write(byteArray);
  9792. }
  9793. }
  9794.  
  9795. public void readKeysData(ObjectInputStream dis) {
  9796.  
  9797. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  9798.  
  9799. try {
  9800.  
  9801. int length = 0;
  9802.  
  9803. this.cislo_pracoviste = dis.readInt();
  9804.  
  9805. } catch (IOException e) {
  9806. throw new RuntimeException(e);
  9807.  
  9808. }
  9809.  
  9810. }
  9811.  
  9812. }
  9813.  
  9814. public void writeKeysData(ObjectOutputStream dos) {
  9815. try {
  9816.  
  9817. // int
  9818.  
  9819. dos.writeInt(this.cislo_pracoviste);
  9820.  
  9821. } catch (IOException e) {
  9822. throw new RuntimeException(e);
  9823. }
  9824.  
  9825. }
  9826.  
  9827. /**
  9828. * Fill Values data by reading ObjectInputStream.
  9829. */
  9830. public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
  9831. try {
  9832.  
  9833. int length = 0;
  9834.  
  9835. this.idpracoviste = dis.readInt();
  9836.  
  9837. this.nazev_pracoviste = readString(dis, ois);
  9838.  
  9839. } catch (IOException e) {
  9840. throw new RuntimeException(e);
  9841.  
  9842. }
  9843.  
  9844. }
  9845.  
  9846. /**
  9847. * Return a byte array which represents Values data.
  9848. */
  9849. public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
  9850. try {
  9851.  
  9852. dos.writeInt(this.idpracoviste);
  9853.  
  9854. writeString(this.nazev_pracoviste, dos, oos);
  9855.  
  9856. } catch (IOException e) {
  9857. throw new RuntimeException(e);
  9858. }
  9859.  
  9860. }
  9861.  
  9862. public String toString() {
  9863.  
  9864. StringBuilder sb = new StringBuilder();
  9865. sb.append(super.toString());
  9866. sb.append("[");
  9867. sb.append("idpracoviste=" + String.valueOf(idpracoviste));
  9868. sb.append(",cislo_pracoviste=" + String.valueOf(cislo_pracoviste));
  9869. sb.append(",nazev_pracoviste=" + nazev_pracoviste);
  9870. sb.append("]");
  9871.  
  9872. return sb.toString();
  9873. }
  9874.  
  9875. /**
  9876. * Compare keys
  9877. */
  9878. public int compareTo(row9Struct other) {
  9879.  
  9880. int returnValue = -1;
  9881.  
  9882. returnValue = checkNullsAndCompare(this.cislo_pracoviste,
  9883. other.cislo_pracoviste);
  9884. if (returnValue != 0) {
  9885. return returnValue;
  9886. }
  9887.  
  9888. return returnValue;
  9889. }
  9890.  
  9891. private int checkNullsAndCompare(Object object1, Object object2) {
  9892. int returnValue = 0;
  9893. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  9894. returnValue = ((Comparable) object1).compareTo(object2);
  9895. } else if (object1 != null && object2 != null) {
  9896. returnValue = compareStrings(object1.toString(),
  9897. object2.toString());
  9898. } else if (object1 == null && object2 != null) {
  9899. returnValue = 1;
  9900. } else if (object1 != null && object2 == null) {
  9901. returnValue = -1;
  9902. } else {
  9903. returnValue = 0;
  9904. }
  9905.  
  9906. return returnValue;
  9907. }
  9908.  
  9909. private int compareStrings(String string1, String string2) {
  9910. return string1.compareTo(string2);
  9911. }
  9912.  
  9913. }
  9914.  
  9915. public void tDBInput_10Process(final java.util.Map<String, Object> globalMap)
  9916. throws TalendException {
  9917. globalMap.put("tDBInput_10_SUBPROCESS_STATE", 0);
  9918.  
  9919. final boolean execStat = this.execStat;
  9920.  
  9921. String iterateId = "";
  9922.  
  9923. String currentComponent = "";
  9924. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  9925.  
  9926. try {
  9927. // TDI-39566 avoid throwing an useless Exception
  9928. boolean resumeIt = true;
  9929. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  9930. String currentMethodName = new java.lang.Exception()
  9931. .getStackTrace()[0].getMethodName();
  9932. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  9933. }
  9934. if (resumeIt || globalResumeTicket) { // start the resume
  9935. globalResumeTicket = true;
  9936.  
  9937. row9Struct row9 = new row9Struct();
  9938.  
  9939. /**
  9940. * [tAdvancedHash_row9 begin ] start
  9941. */
  9942.  
  9943. ok_Hash.put("tAdvancedHash_row9", false);
  9944. start_Hash
  9945. .put("tAdvancedHash_row9", System.currentTimeMillis());
  9946.  
  9947. currentComponent = "tAdvancedHash_row9";
  9948.  
  9949. if (execStat) {
  9950. if (resourceMap.get("inIterateVComp") == null) {
  9951.  
  9952. runStat.updateStatOnConnection("row9" + iterateId, 0, 0);
  9953.  
  9954. }
  9955. }
  9956.  
  9957. int tos_count_tAdvancedHash_row9 = 0;
  9958.  
  9959. // connection name:row9
  9960. // source node:tDBInput_10 - inputs:(after_tDBInput_6)
  9961. // outputs:(row9,row9) | target node:tAdvancedHash_row9 -
  9962. // inputs:(row9) outputs:()
  9963. // linked node: tMap_2 -
  9964. // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
  9965. // outputs:(out2)
  9966.  
  9967. org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row9 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
  9968.  
  9969. org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row9Struct> tHash_Lookup_row9 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
  9970. .<row9Struct> getLookup(matchingModeEnum_row9);
  9971.  
  9972. globalMap.put("tHash_Lookup_row9", tHash_Lookup_row9);
  9973.  
  9974. /**
  9975. * [tAdvancedHash_row9 begin ] stop
  9976. */
  9977.  
  9978. /**
  9979. * [tDBInput_10 begin ] start
  9980. */
  9981.  
  9982. ok_Hash.put("tDBInput_10", false);
  9983. start_Hash.put("tDBInput_10", System.currentTimeMillis());
  9984.  
  9985. currentComponent = "tDBInput_10";
  9986.  
  9987. int tos_count_tDBInput_10 = 0;
  9988.  
  9989. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_10 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  9990. .getMSSqlGenerateTimestampUtil();
  9991.  
  9992. java.util.List<String> talendToDBList_tDBInput_10 = new java.util.ArrayList();
  9993. String[] talendToDBArray_tDBInput_10 = new String[] { "FLOAT",
  9994. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  9995. "DECIMAL IDENTITY", "REAL" };
  9996. java.util.Collections.addAll(talendToDBList_tDBInput_10,
  9997. talendToDBArray_tDBInput_10);
  9998. int nb_line_tDBInput_10 = 0;
  9999. java.sql.Connection conn_tDBInput_10 = null;
  10000. String driverClass_tDBInput_10 = "net.sourceforge.jtds.jdbc.Driver";
  10001. java.lang.Class.forName(driverClass_tDBInput_10);
  10002. String dbUser_tDBInput_10 = "tym1";
  10003.  
  10004. final String decryptedPassword_tDBInput_10 = routines.system.PasswordEncryptUtil
  10005. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  10006.  
  10007. String dbPwd_tDBInput_10 = decryptedPassword_tDBInput_10;
  10008.  
  10009. String port_tDBInput_10 = "1433";
  10010. String dbname_tDBInput_10 = "tym1";
  10011. String url_tDBInput_10 = "jdbc:jtds:sqlserver://"
  10012. + "158.196.160.60";
  10013. if (!"".equals(port_tDBInput_10)) {
  10014. url_tDBInput_10 += ":" + "1433";
  10015. }
  10016. if (!"".equals(dbname_tDBInput_10)) {
  10017. url_tDBInput_10 += "//" + "tym1";
  10018. }
  10019. url_tDBInput_10 += ";appName=" + projectName + ";" + "";
  10020. String dbschema_tDBInput_10 = "";
  10021.  
  10022. conn_tDBInput_10 = java.sql.DriverManager.getConnection(
  10023. url_tDBInput_10, dbUser_tDBInput_10, dbPwd_tDBInput_10);
  10024.  
  10025. java.sql.Statement stmt_tDBInput_10 = conn_tDBInput_10
  10026. .createStatement();
  10027.  
  10028. String dbquery_tDBInput_10 = "SELECT DIM_pracoviste.idpracoviste,\n DIM_pracoviste.cislo_pracoviste,\n DIM_pracoviste.nazev_pracoviste\nFROM DIM_praco"
  10029. + "viste";
  10030.  
  10031. globalMap.put("tDBInput_10_QUERY", dbquery_tDBInput_10);
  10032. java.sql.ResultSet rs_tDBInput_10 = null;
  10033.  
  10034. try {
  10035. rs_tDBInput_10 = stmt_tDBInput_10
  10036. .executeQuery(dbquery_tDBInput_10);
  10037. java.sql.ResultSetMetaData rsmd_tDBInput_10 = rs_tDBInput_10
  10038. .getMetaData();
  10039. int colQtyInRs_tDBInput_10 = rsmd_tDBInput_10
  10040. .getColumnCount();
  10041.  
  10042. String tmpContent_tDBInput_10 = null;
  10043.  
  10044. while (rs_tDBInput_10.next()) {
  10045. nb_line_tDBInput_10++;
  10046.  
  10047. if (colQtyInRs_tDBInput_10 < 1) {
  10048. row9.idpracoviste = 0;
  10049. } else {
  10050.  
  10051. if (rs_tDBInput_10.getObject(1) != null) {
  10052. row9.idpracoviste = rs_tDBInput_10.getInt(1);
  10053. } else {
  10054. throw new RuntimeException(
  10055. "Null value in non-Nullable column");
  10056. }
  10057. }
  10058. if (colQtyInRs_tDBInput_10 < 2) {
  10059. row9.cislo_pracoviste = 0;
  10060. } else {
  10061.  
  10062. if (rs_tDBInput_10.getObject(2) != null) {
  10063. row9.cislo_pracoviste = rs_tDBInput_10
  10064. .getInt(2);
  10065. } else {
  10066. throw new RuntimeException(
  10067. "Null value in non-Nullable column");
  10068. }
  10069. }
  10070. if (colQtyInRs_tDBInput_10 < 3) {
  10071. row9.nazev_pracoviste = null;
  10072. } else {
  10073.  
  10074. tmpContent_tDBInput_10 = rs_tDBInput_10
  10075. .getString(3);
  10076. if (tmpContent_tDBInput_10 != null) {
  10077. if (talendToDBList_tDBInput_10
  10078. .contains(rsmd_tDBInput_10
  10079. .getColumnTypeName(3)
  10080. .toUpperCase(
  10081. java.util.Locale.ENGLISH))) {
  10082. row9.nazev_pracoviste = FormatterUtils
  10083. .formatUnwithE(tmpContent_tDBInput_10);
  10084. } else {
  10085. row9.nazev_pracoviste = tmpContent_tDBInput_10;
  10086. }
  10087. } else {
  10088. row9.nazev_pracoviste = null;
  10089. }
  10090. }
  10091.  
  10092. /**
  10093. * [tDBInput_10 begin ] stop
  10094. */
  10095.  
  10096. /**
  10097. * [tDBInput_10 main ] start
  10098. */
  10099.  
  10100. currentComponent = "tDBInput_10";
  10101.  
  10102. tos_count_tDBInput_10++;
  10103.  
  10104. /**
  10105. * [tDBInput_10 main ] stop
  10106. */
  10107.  
  10108. /**
  10109. * [tDBInput_10 process_data_begin ] start
  10110. */
  10111.  
  10112. currentComponent = "tDBInput_10";
  10113.  
  10114. /**
  10115. * [tDBInput_10 process_data_begin ] stop
  10116. */
  10117.  
  10118. /**
  10119. * [tAdvancedHash_row9 main ] start
  10120. */
  10121.  
  10122. currentComponent = "tAdvancedHash_row9";
  10123.  
  10124. // row9
  10125. // row9
  10126.  
  10127. if (execStat) {
  10128. runStat.updateStatOnConnection("row9" + iterateId,
  10129. 1, 1);
  10130. }
  10131.  
  10132. row9Struct row9_HashRow = new row9Struct();
  10133.  
  10134. row9_HashRow.idpracoviste = row9.idpracoviste;
  10135.  
  10136. row9_HashRow.cislo_pracoviste = row9.cislo_pracoviste;
  10137.  
  10138. row9_HashRow.nazev_pracoviste = row9.nazev_pracoviste;
  10139.  
  10140. tHash_Lookup_row9.put(row9_HashRow);
  10141.  
  10142. tos_count_tAdvancedHash_row9++;
  10143.  
  10144. /**
  10145. * [tAdvancedHash_row9 main ] stop
  10146. */
  10147.  
  10148. /**
  10149. * [tAdvancedHash_row9 process_data_begin ] start
  10150. */
  10151.  
  10152. currentComponent = "tAdvancedHash_row9";
  10153.  
  10154. /**
  10155. * [tAdvancedHash_row9 process_data_begin ] stop
  10156. */
  10157.  
  10158. /**
  10159. * [tAdvancedHash_row9 process_data_end ] start
  10160. */
  10161.  
  10162. currentComponent = "tAdvancedHash_row9";
  10163.  
  10164. /**
  10165. * [tAdvancedHash_row9 process_data_end ] stop
  10166. */
  10167.  
  10168. /**
  10169. * [tDBInput_10 process_data_end ] start
  10170. */
  10171.  
  10172. currentComponent = "tDBInput_10";
  10173.  
  10174. /**
  10175. * [tDBInput_10 process_data_end ] stop
  10176. */
  10177.  
  10178. /**
  10179. * [tDBInput_10 end ] start
  10180. */
  10181.  
  10182. currentComponent = "tDBInput_10";
  10183.  
  10184. }
  10185. } finally {
  10186. if (rs_tDBInput_10 != null) {
  10187. rs_tDBInput_10.close();
  10188. }
  10189. if (stmt_tDBInput_10 != null) {
  10190. stmt_tDBInput_10.close();
  10191. }
  10192. if (conn_tDBInput_10 != null
  10193. && !conn_tDBInput_10.isClosed()) {
  10194.  
  10195. conn_tDBInput_10.close();
  10196.  
  10197. }
  10198. }
  10199. globalMap.put("tDBInput_10_NB_LINE", nb_line_tDBInput_10);
  10200.  
  10201. ok_Hash.put("tDBInput_10", true);
  10202. end_Hash.put("tDBInput_10", System.currentTimeMillis());
  10203.  
  10204. /**
  10205. * [tDBInput_10 end ] stop
  10206. */
  10207.  
  10208. /**
  10209. * [tAdvancedHash_row9 end ] start
  10210. */
  10211.  
  10212. currentComponent = "tAdvancedHash_row9";
  10213.  
  10214. tHash_Lookup_row9.endPut();
  10215.  
  10216. if (execStat) {
  10217. if (resourceMap.get("inIterateVComp") == null
  10218. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  10219. runStat.updateStatOnConnection("row9" + iterateId, 2, 0);
  10220. }
  10221. }
  10222.  
  10223. ok_Hash.put("tAdvancedHash_row9", true);
  10224. end_Hash.put("tAdvancedHash_row9", System.currentTimeMillis());
  10225.  
  10226. /**
  10227. * [tAdvancedHash_row9 end ] stop
  10228. */
  10229.  
  10230. }// end the resume
  10231.  
  10232. } catch (java.lang.Exception e) {
  10233.  
  10234. TalendException te = new TalendException(e, currentComponent,
  10235. globalMap);
  10236.  
  10237. throw te;
  10238. } catch (java.lang.Error error) {
  10239.  
  10240. runStat.stopThreadStat();
  10241.  
  10242. throw error;
  10243. } finally {
  10244.  
  10245. try {
  10246.  
  10247. /**
  10248. * [tDBInput_10 finally ] start
  10249. */
  10250.  
  10251. currentComponent = "tDBInput_10";
  10252.  
  10253. /**
  10254. * [tDBInput_10 finally ] stop
  10255. */
  10256.  
  10257. /**
  10258. * [tAdvancedHash_row9 finally ] start
  10259. */
  10260.  
  10261. currentComponent = "tAdvancedHash_row9";
  10262.  
  10263. /**
  10264. * [tAdvancedHash_row9 finally ] stop
  10265. */
  10266.  
  10267. } catch (java.lang.Exception e) {
  10268. // ignore
  10269. } catch (java.lang.Error error) {
  10270. // ignore
  10271. }
  10272. resourceMap = null;
  10273. }
  10274.  
  10275. globalMap.put("tDBInput_10_SUBPROCESS_STATE", 1);
  10276. }
  10277.  
  10278. public String resuming_logs_dir_path = null;
  10279. public String resuming_checkpoint_path = null;
  10280. public String parent_part_launcher = null;
  10281. private String resumeEntryMethodName = null;
  10282. private boolean globalResumeTicket = false;
  10283.  
  10284. public boolean watch = false;
  10285. // portStats is null, it means don't execute the statistics
  10286. public Integer portStats = null;
  10287. public int portTraces = 4334;
  10288. public String clientHost;
  10289. public String defaultClientHost = "localhost";
  10290. public String contextStr = "Default";
  10291. public boolean isDefaultContext = true;
  10292. public String pid = "0";
  10293. public String rootPid = null;
  10294. public String fatherPid = null;
  10295. public String fatherNode = null;
  10296. public long startTime = 0;
  10297. public boolean isChildJob = false;
  10298. public String log4jLevel = "";
  10299.  
  10300. private boolean execStat = true;
  10301.  
  10302. private ThreadLocal<java.util.Map<String, String>> threadLocal = new ThreadLocal<java.util.Map<String, String>>() {
  10303. protected java.util.Map<String, String> initialValue() {
  10304. java.util.Map<String, String> threadRunResultMap = new java.util.HashMap<String, String>();
  10305. threadRunResultMap.put("errorCode", null);
  10306. threadRunResultMap.put("status", "");
  10307. return threadRunResultMap;
  10308. };
  10309. };
  10310.  
  10311. private PropertiesWithType context_param = new PropertiesWithType();
  10312. public java.util.Map<String, Object> parentContextMap = new java.util.HashMap<String, Object>();
  10313.  
  10314. public String status = "";
  10315.  
  10316. public static void main(String[] args) {
  10317. final FACT_snimek_dochazky FACT_snimek_dochazkyClass = new FACT_snimek_dochazky();
  10318.  
  10319. int exitCode = FACT_snimek_dochazkyClass.runJobInTOS(args);
  10320.  
  10321. System.exit(exitCode);
  10322. }
  10323.  
  10324. public String[][] runJob(String[] args) {
  10325.  
  10326. int exitCode = runJobInTOS(args);
  10327. String[][] bufferValue = new String[][] { { Integer.toString(exitCode) } };
  10328.  
  10329. return bufferValue;
  10330. }
  10331.  
  10332. public boolean hastBufferOutputComponent() {
  10333. boolean hastBufferOutput = false;
  10334.  
  10335. return hastBufferOutput;
  10336. }
  10337.  
  10338. public int runJobInTOS(String[] args) {
  10339. // reset status
  10340. status = "";
  10341.  
  10342. String lastStr = "";
  10343. for (String arg : args) {
  10344. if (arg.equalsIgnoreCase("--context_param")) {
  10345. lastStr = arg;
  10346. } else if (lastStr.equals("")) {
  10347. evalParam(arg);
  10348. } else {
  10349. evalParam(lastStr + " " + arg);
  10350. lastStr = "";
  10351. }
  10352. }
  10353.  
  10354. if (clientHost == null) {
  10355. clientHost = defaultClientHost;
  10356. }
  10357.  
  10358. if (pid == null || "0".equals(pid)) {
  10359. pid = TalendString.getAsciiRandomString(6);
  10360. }
  10361.  
  10362. if (rootPid == null) {
  10363. rootPid = pid;
  10364. }
  10365. if (fatherPid == null) {
  10366. fatherPid = pid;
  10367. } else {
  10368. isChildJob = true;
  10369. }
  10370.  
  10371. if (portStats != null) {
  10372. // portStats = -1; //for testing
  10373. if (portStats < 0 || portStats > 65535) {
  10374. // issue:10869, the portStats is invalid, so this client socket
  10375. // can't open
  10376. System.err.println("The statistics socket port " + portStats
  10377. + " is invalid.");
  10378. execStat = false;
  10379. }
  10380. } else {
  10381. execStat = false;
  10382. }
  10383.  
  10384. try {
  10385. // call job/subjob with an existing context, like:
  10386. // --context=production. if without this parameter, there will use
  10387. // the default context instead.
  10388. java.io.InputStream inContext = FACT_snimek_dochazky.class
  10389. .getClassLoader().getResourceAsStream(
  10390. "bi/fact_snimek_dochazky_0_1/contexts/"
  10391. + contextStr + ".properties");
  10392. if (inContext == null) {
  10393. inContext = FACT_snimek_dochazky.class
  10394. .getClassLoader()
  10395. .getResourceAsStream(
  10396. "config/contexts/" + contextStr + ".properties");
  10397. }
  10398. if (inContext != null) {
  10399. // defaultProps is in order to keep the original context value
  10400. defaultProps.load(inContext);
  10401. inContext.close();
  10402. context = new ContextProperties(defaultProps);
  10403. } else if (!isDefaultContext) {
  10404. // print info and job continue to run, for case: context_param
  10405. // is not empty.
  10406. System.err.println("Could not find the context " + contextStr);
  10407. }
  10408.  
  10409. if (!context_param.isEmpty()) {
  10410. context.putAll(context_param);
  10411. // set types for params from parentJobs
  10412. for (Object key : context_param.keySet()) {
  10413. String context_key = key.toString();
  10414. String context_type = context_param
  10415. .getContextType(context_key);
  10416. context.setContextType(context_key, context_type);
  10417.  
  10418. }
  10419. }
  10420. } catch (java.io.IOException ie) {
  10421. System.err.println("Could not load context " + contextStr);
  10422. ie.printStackTrace();
  10423. }
  10424.  
  10425. // get context value from parent directly
  10426. if (parentContextMap != null && !parentContextMap.isEmpty()) {
  10427. }
  10428.  
  10429. // Resume: init the resumeUtil
  10430. resumeEntryMethodName = ResumeUtil
  10431. .getResumeEntryMethodName(resuming_checkpoint_path);
  10432. resumeUtil = new ResumeUtil(resuming_logs_dir_path, isChildJob, rootPid);
  10433. resumeUtil.initCommonInfo(pid, rootPid, fatherPid, projectName,
  10434. jobName, contextStr, jobVersion);
  10435.  
  10436. List<String> parametersToEncrypt = new java.util.ArrayList<String>();
  10437. // Resume: jobStart
  10438. resumeUtil.addLog("JOB_STARTED", "JOB:" + jobName,
  10439. parent_part_launcher, Thread.currentThread().getId() + "", "",
  10440. "", "", "",
  10441. resumeUtil.convertToJsonText(context, parametersToEncrypt));
  10442.  
  10443. if (execStat) {
  10444. try {
  10445. runStat.openSocket(!isChildJob);
  10446. runStat.setAllPID(rootPid, fatherPid, pid, jobName);
  10447. runStat.startThreadStat(clientHost, portStats);
  10448. runStat.updateStatOnJob(RunStat.JOBSTART, fatherNode);
  10449. } catch (java.io.IOException ioException) {
  10450. ioException.printStackTrace();
  10451. }
  10452. }
  10453.  
  10454. java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap = new java.util.concurrent.ConcurrentHashMap<Object, Object>();
  10455. globalMap.put("concurrentHashMap", concurrentHashMap);
  10456.  
  10457. long startUsedMemory = Runtime.getRuntime().totalMemory()
  10458. - Runtime.getRuntime().freeMemory();
  10459. long endUsedMemory = 0;
  10460. long end = 0;
  10461.  
  10462. startTime = System.currentTimeMillis();
  10463.  
  10464. this.globalResumeTicket = true;// to run tPreJob
  10465.  
  10466. this.globalResumeTicket = false;// to run others jobs
  10467.  
  10468. try {
  10469. errorCode = null;
  10470. tDBInput_6Process(globalMap);
  10471. if (!"failure".equals(status)) {
  10472. status = "end";
  10473. }
  10474. } catch (TalendException e_tDBInput_6) {
  10475. globalMap.put("tDBInput_6_SUBPROCESS_STATE", -1);
  10476.  
  10477. e_tDBInput_6.printStackTrace();
  10478.  
  10479. }
  10480.  
  10481. this.globalResumeTicket = true;// to run tPostJob
  10482.  
  10483. end = System.currentTimeMillis();
  10484.  
  10485. if (watch) {
  10486. System.out.println((end - startTime) + " milliseconds");
  10487. }
  10488.  
  10489. endUsedMemory = Runtime.getRuntime().totalMemory()
  10490. - Runtime.getRuntime().freeMemory();
  10491. if (false) {
  10492. System.out
  10493. .println((endUsedMemory - startUsedMemory)
  10494. + " bytes memory increase when running : FACT_snimek_dochazky");
  10495. }
  10496.  
  10497. if (execStat) {
  10498. runStat.updateStatOnJob(RunStat.JOBEND, fatherNode);
  10499. runStat.stopThreadStat();
  10500. }
  10501. int returnCode = 0;
  10502. if (errorCode == null) {
  10503. returnCode = status != null && status.equals("failure") ? 1 : 0;
  10504. } else {
  10505. returnCode = errorCode.intValue();
  10506. }
  10507. resumeUtil.addLog("JOB_ENDED", "JOB:" + jobName, parent_part_launcher,
  10508. Thread.currentThread().getId() + "", "", "" + returnCode, "",
  10509. "", "");
  10510.  
  10511. return returnCode;
  10512.  
  10513. }
  10514.  
  10515. // only for OSGi env
  10516. public void destroy() {
  10517.  
  10518. }
  10519.  
  10520. private java.util.Map<String, Object> getSharedConnections4REST() {
  10521. java.util.Map<String, Object> connections = new java.util.HashMap<String, Object>();
  10522.  
  10523. return connections;
  10524. }
  10525.  
  10526. private void evalParam(String arg) {
  10527. if (arg.startsWith("--resuming_logs_dir_path")) {
  10528. resuming_logs_dir_path = arg.substring(25);
  10529. } else if (arg.startsWith("--resuming_checkpoint_path")) {
  10530. resuming_checkpoint_path = arg.substring(27);
  10531. } else if (arg.startsWith("--parent_part_launcher")) {
  10532. parent_part_launcher = arg.substring(23);
  10533. } else if (arg.startsWith("--watch")) {
  10534. watch = true;
  10535. } else if (arg.startsWith("--stat_port=")) {
  10536. String portStatsStr = arg.substring(12);
  10537. if (portStatsStr != null && !portStatsStr.equals("null")) {
  10538. portStats = Integer.parseInt(portStatsStr);
  10539. }
  10540. } else if (arg.startsWith("--trace_port=")) {
  10541. portTraces = Integer.parseInt(arg.substring(13));
  10542. } else if (arg.startsWith("--client_host=")) {
  10543. clientHost = arg.substring(14);
  10544. } else if (arg.startsWith("--context=")) {
  10545. contextStr = arg.substring(10);
  10546. isDefaultContext = false;
  10547. } else if (arg.startsWith("--father_pid=")) {
  10548. fatherPid = arg.substring(13);
  10549. } else if (arg.startsWith("--root_pid=")) {
  10550. rootPid = arg.substring(11);
  10551. } else if (arg.startsWith("--father_node=")) {
  10552. fatherNode = arg.substring(14);
  10553. } else if (arg.startsWith("--pid=")) {
  10554. pid = arg.substring(6);
  10555. } else if (arg.startsWith("--context_type")) {
  10556. String keyValue = arg.substring(15);
  10557. int index = -1;
  10558. if (keyValue != null && (index = keyValue.indexOf('=')) > -1) {
  10559. if (fatherPid == null) {
  10560. context_param.setContextType(keyValue.substring(0, index),
  10561. replaceEscapeChars(keyValue.substring(index + 1)));
  10562. } else { // the subjob won't escape the especial chars
  10563. context_param.setContextType(keyValue.substring(0, index),
  10564. keyValue.substring(index + 1));
  10565. }
  10566.  
  10567. }
  10568.  
  10569. } else if (arg.startsWith("--context_param")) {
  10570. String keyValue = arg.substring(16);
  10571. int index = -1;
  10572. if (keyValue != null && (index = keyValue.indexOf('=')) > -1) {
  10573. if (fatherPid == null) {
  10574. context_param.put(keyValue.substring(0, index),
  10575. replaceEscapeChars(keyValue.substring(index + 1)));
  10576. } else { // the subjob won't escape the especial chars
  10577. context_param.put(keyValue.substring(0, index),
  10578. keyValue.substring(index + 1));
  10579. }
  10580. }
  10581. } else if (arg.startsWith("--log4jLevel=")) {
  10582. log4jLevel = arg.substring(13);
  10583. }
  10584.  
  10585. }
  10586.  
  10587. private static final String NULL_VALUE_EXPRESSION_IN_COMMAND_STRING_FOR_CHILD_JOB_ONLY = "<TALEND_NULL>";
  10588.  
  10589. private final String[][] escapeChars = { { "\\\\", "\\" }, { "\\n", "\n" },
  10590. { "\\'", "\'" }, { "\\r", "\r" }, { "\\f", "\f" }, { "\\b", "\b" },
  10591. { "\\t", "\t" } };
  10592.  
  10593. private String replaceEscapeChars(String keyValue) {
  10594.  
  10595. if (keyValue == null || ("").equals(keyValue.trim())) {
  10596. return keyValue;
  10597. }
  10598.  
  10599. StringBuilder result = new StringBuilder();
  10600. int currIndex = 0;
  10601. while (currIndex < keyValue.length()) {
  10602. int index = -1;
  10603. // judege if the left string includes escape chars
  10604. for (String[] strArray : escapeChars) {
  10605. index = keyValue.indexOf(strArray[0], currIndex);
  10606. if (index >= 0) {
  10607.  
  10608. result.append(keyValue.substring(currIndex,
  10609. index + strArray[0].length()).replace(strArray[0],
  10610. strArray[1]));
  10611. currIndex = index + strArray[0].length();
  10612. break;
  10613. }
  10614. }
  10615. // if the left string doesn't include escape chars, append the left
  10616. // into the result
  10617. if (index < 0) {
  10618. result.append(keyValue.substring(currIndex));
  10619. currIndex = currIndex + keyValue.length();
  10620. }
  10621. }
  10622.  
  10623. return result.toString();
  10624. }
  10625.  
  10626. public Integer getErrorCode() {
  10627. return errorCode;
  10628. }
  10629.  
  10630. public String getStatus() {
  10631. return status;
  10632. }
  10633.  
  10634. ResumeUtil resumeUtil = null;
  10635. }
  10636. /************************************************************************************************
  10637. * 302751 characters generated by Talend Open Studio for Data Integration on the
  10638. * 2. ledna 2019 20:04:58 CET
  10639. ************************************************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement