Advertisement
Guest User

Untitled

a guest
Jan 2nd, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 275.01 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 Integer dovolena_celkem;
  4887.  
  4888. public Integer getDovolena_celkem() {
  4889. return this.dovolena_celkem;
  4890. }
  4891.  
  4892. public Integer DIM_zamestnanci_idzamestnanci;
  4893.  
  4894. public Integer getDIM_zamestnanci_idzamestnanci() {
  4895. return this.DIM_zamestnanci_idzamestnanci;
  4896. }
  4897.  
  4898. public Integer DIM_pracoviste_idpracoviste;
  4899.  
  4900. public Integer getDIM_pracoviste_idpracoviste() {
  4901. return this.DIM_pracoviste_idpracoviste;
  4902. }
  4903.  
  4904. public Integer DIM_kalendar_idkalendare;
  4905.  
  4906. public Integer getDIM_kalendar_idkalendare() {
  4907. return this.DIM_kalendar_idkalendare;
  4908. }
  4909.  
  4910. public Integer DIM_mzdove_sazby_idsazby;
  4911.  
  4912. public Integer 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
  4923. * result
  4924. + ((this.DIM_zamestnanci_idzamestnanci == null) ? 0
  4925. : this.DIM_zamestnanci_idzamestnanci.hashCode());
  4926.  
  4927. result = prime
  4928. * result
  4929. + ((this.DIM_pracoviste_idpracoviste == null) ? 0
  4930. : this.DIM_pracoviste_idpracoviste.hashCode());
  4931.  
  4932. result = prime
  4933. * result
  4934. + ((this.DIM_kalendar_idkalendare == null) ? 0
  4935. : this.DIM_kalendar_idkalendare.hashCode());
  4936.  
  4937. result = prime
  4938. * result
  4939. + ((this.DIM_mzdove_sazby_idsazby == null) ? 0
  4940. : this.DIM_mzdove_sazby_idsazby.hashCode());
  4941.  
  4942. this.hashCode = result;
  4943. this.hashCodeDirty = false;
  4944. }
  4945. return this.hashCode;
  4946. }
  4947.  
  4948. @Override
  4949. public boolean equals(Object obj) {
  4950. if (this == obj)
  4951. return true;
  4952. if (obj == null)
  4953. return false;
  4954. if (getClass() != obj.getClass())
  4955. return false;
  4956. final out2Struct other = (out2Struct) obj;
  4957.  
  4958. if (this.DIM_zamestnanci_idzamestnanci == null) {
  4959. if (other.DIM_zamestnanci_idzamestnanci != null)
  4960. return false;
  4961.  
  4962. } else if (!this.DIM_zamestnanci_idzamestnanci
  4963. .equals(other.DIM_zamestnanci_idzamestnanci))
  4964.  
  4965. return false;
  4966.  
  4967. if (this.DIM_pracoviste_idpracoviste == null) {
  4968. if (other.DIM_pracoviste_idpracoviste != null)
  4969. return false;
  4970.  
  4971. } else if (!this.DIM_pracoviste_idpracoviste
  4972. .equals(other.DIM_pracoviste_idpracoviste))
  4973.  
  4974. return false;
  4975.  
  4976. if (this.DIM_kalendar_idkalendare == null) {
  4977. if (other.DIM_kalendar_idkalendare != null)
  4978. return false;
  4979.  
  4980. } else if (!this.DIM_kalendar_idkalendare
  4981. .equals(other.DIM_kalendar_idkalendare))
  4982.  
  4983. return false;
  4984.  
  4985. if (this.DIM_mzdove_sazby_idsazby == null) {
  4986. if (other.DIM_mzdove_sazby_idsazby != null)
  4987. return false;
  4988.  
  4989. } else if (!this.DIM_mzdove_sazby_idsazby
  4990. .equals(other.DIM_mzdove_sazby_idsazby))
  4991.  
  4992. return false;
  4993.  
  4994. return true;
  4995. }
  4996.  
  4997. public void copyDataTo(out2Struct other) {
  4998.  
  4999. other.odpracovano_hodin = this.odpracovano_hodin;
  5000. other.prescasy = this.prescasy;
  5001. other.celkova_mzda = this.celkova_mzda;
  5002. other.dovolena_vybrana = this.dovolena_vybrana;
  5003. other.dovolena_zustatek = this.dovolena_zustatek;
  5004. other.dovolena_celkem = this.dovolena_celkem;
  5005. other.DIM_zamestnanci_idzamestnanci = this.DIM_zamestnanci_idzamestnanci;
  5006. other.DIM_pracoviste_idpracoviste = this.DIM_pracoviste_idpracoviste;
  5007. other.DIM_kalendar_idkalendare = this.DIM_kalendar_idkalendare;
  5008. other.DIM_mzdove_sazby_idsazby = this.DIM_mzdove_sazby_idsazby;
  5009.  
  5010. }
  5011.  
  5012. public void copyKeysDataTo(out2Struct other) {
  5013.  
  5014. other.DIM_zamestnanci_idzamestnanci = this.DIM_zamestnanci_idzamestnanci;
  5015. other.DIM_pracoviste_idpracoviste = this.DIM_pracoviste_idpracoviste;
  5016. other.DIM_kalendar_idkalendare = this.DIM_kalendar_idkalendare;
  5017. other.DIM_mzdove_sazby_idsazby = this.DIM_mzdove_sazby_idsazby;
  5018.  
  5019. }
  5020.  
  5021. private Integer readInteger(ObjectInputStream dis) throws IOException {
  5022. Integer intReturn;
  5023. int length = 0;
  5024. length = dis.readByte();
  5025. if (length == -1) {
  5026. intReturn = null;
  5027. } else {
  5028. intReturn = dis.readInt();
  5029. }
  5030. return intReturn;
  5031. }
  5032.  
  5033. private void writeInteger(Integer intNum, ObjectOutputStream dos)
  5034. throws IOException {
  5035. if (intNum == null) {
  5036. dos.writeByte(-1);
  5037. } else {
  5038. dos.writeByte(0);
  5039. dos.writeInt(intNum);
  5040. }
  5041. }
  5042.  
  5043. public void readData(ObjectInputStream dis) {
  5044.  
  5045. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  5046.  
  5047. try {
  5048.  
  5049. int length = 0;
  5050.  
  5051. this.odpracovano_hodin = (BigDecimal) dis.readObject();
  5052.  
  5053. this.prescasy = (BigDecimal) dis.readObject();
  5054.  
  5055. this.celkova_mzda = (BigDecimal) dis.readObject();
  5056.  
  5057. this.dovolena_vybrana = (BigDecimal) dis.readObject();
  5058.  
  5059. this.dovolena_zustatek = (BigDecimal) dis.readObject();
  5060.  
  5061. this.dovolena_celkem = readInteger(dis);
  5062.  
  5063. this.DIM_zamestnanci_idzamestnanci = readInteger(dis);
  5064.  
  5065. this.DIM_pracoviste_idpracoviste = readInteger(dis);
  5066.  
  5067. this.DIM_kalendar_idkalendare = readInteger(dis);
  5068.  
  5069. this.DIM_mzdove_sazby_idsazby = readInteger(dis);
  5070.  
  5071. } catch (IOException e) {
  5072. throw new RuntimeException(e);
  5073.  
  5074. } catch (ClassNotFoundException eCNFE) {
  5075. throw new RuntimeException(eCNFE);
  5076.  
  5077. }
  5078.  
  5079. }
  5080.  
  5081. }
  5082.  
  5083. public void writeData(ObjectOutputStream dos) {
  5084. try {
  5085.  
  5086. // BigDecimal
  5087.  
  5088. dos.writeObject(this.odpracovano_hodin);
  5089.  
  5090. // BigDecimal
  5091.  
  5092. dos.writeObject(this.prescasy);
  5093.  
  5094. // BigDecimal
  5095.  
  5096. dos.writeObject(this.celkova_mzda);
  5097.  
  5098. // BigDecimal
  5099.  
  5100. dos.writeObject(this.dovolena_vybrana);
  5101.  
  5102. // BigDecimal
  5103.  
  5104. dos.writeObject(this.dovolena_zustatek);
  5105.  
  5106. // Integer
  5107.  
  5108. writeInteger(this.dovolena_celkem, dos);
  5109.  
  5110. // Integer
  5111.  
  5112. writeInteger(this.DIM_zamestnanci_idzamestnanci, dos);
  5113.  
  5114. // Integer
  5115.  
  5116. writeInteger(this.DIM_pracoviste_idpracoviste, dos);
  5117.  
  5118. // Integer
  5119.  
  5120. writeInteger(this.DIM_kalendar_idkalendare, dos);
  5121.  
  5122. // Integer
  5123.  
  5124. writeInteger(this.DIM_mzdove_sazby_idsazby, dos);
  5125.  
  5126. } catch (IOException e) {
  5127. throw new RuntimeException(e);
  5128. }
  5129.  
  5130. }
  5131.  
  5132. public String toString() {
  5133.  
  5134. StringBuilder sb = new StringBuilder();
  5135. sb.append(super.toString());
  5136. sb.append("[");
  5137. sb.append("odpracovano_hodin=" + String.valueOf(odpracovano_hodin));
  5138. sb.append(",prescasy=" + String.valueOf(prescasy));
  5139. sb.append(",celkova_mzda=" + String.valueOf(celkova_mzda));
  5140. sb.append(",dovolena_vybrana=" + String.valueOf(dovolena_vybrana));
  5141. sb.append(",dovolena_zustatek=" + String.valueOf(dovolena_zustatek));
  5142. sb.append(",dovolena_celkem=" + String.valueOf(dovolena_celkem));
  5143. sb.append(",DIM_zamestnanci_idzamestnanci="
  5144. + String.valueOf(DIM_zamestnanci_idzamestnanci));
  5145. sb.append(",DIM_pracoviste_idpracoviste="
  5146. + String.valueOf(DIM_pracoviste_idpracoviste));
  5147. sb.append(",DIM_kalendar_idkalendare="
  5148. + String.valueOf(DIM_kalendar_idkalendare));
  5149. sb.append(",DIM_mzdove_sazby_idsazby="
  5150. + String.valueOf(DIM_mzdove_sazby_idsazby));
  5151. sb.append("]");
  5152.  
  5153. return sb.toString();
  5154. }
  5155.  
  5156. /**
  5157. * Compare keys
  5158. */
  5159. public int compareTo(out2Struct other) {
  5160.  
  5161. int returnValue = -1;
  5162.  
  5163. returnValue = checkNullsAndCompare(
  5164. this.DIM_zamestnanci_idzamestnanci,
  5165. other.DIM_zamestnanci_idzamestnanci);
  5166. if (returnValue != 0) {
  5167. return returnValue;
  5168. }
  5169.  
  5170. returnValue = checkNullsAndCompare(
  5171. this.DIM_pracoviste_idpracoviste,
  5172. other.DIM_pracoviste_idpracoviste);
  5173. if (returnValue != 0) {
  5174. return returnValue;
  5175. }
  5176.  
  5177. returnValue = checkNullsAndCompare(this.DIM_kalendar_idkalendare,
  5178. other.DIM_kalendar_idkalendare);
  5179. if (returnValue != 0) {
  5180. return returnValue;
  5181. }
  5182.  
  5183. returnValue = checkNullsAndCompare(this.DIM_mzdove_sazby_idsazby,
  5184. other.DIM_mzdove_sazby_idsazby);
  5185. if (returnValue != 0) {
  5186. return returnValue;
  5187. }
  5188.  
  5189. return returnValue;
  5190. }
  5191.  
  5192. private int checkNullsAndCompare(Object object1, Object object2) {
  5193. int returnValue = 0;
  5194. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  5195. returnValue = ((Comparable) object1).compareTo(object2);
  5196. } else if (object1 != null && object2 != null) {
  5197. returnValue = compareStrings(object1.toString(),
  5198. object2.toString());
  5199. } else if (object1 == null && object2 != null) {
  5200. returnValue = 1;
  5201. } else if (object1 != null && object2 == null) {
  5202. returnValue = -1;
  5203. } else {
  5204. returnValue = 0;
  5205. }
  5206.  
  5207. return returnValue;
  5208. }
  5209.  
  5210. private int compareStrings(String string1, String string2) {
  5211. return string1.compareTo(string2);
  5212. }
  5213.  
  5214. }
  5215.  
  5216. public static class row4Struct implements
  5217. routines.system.IPersistableRow<row4Struct> {
  5218. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  5219. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  5220.  
  5221. public Integer zaznam_dochazky;
  5222.  
  5223. public Integer getZaznam_dochazky() {
  5224. return this.zaznam_dochazky;
  5225. }
  5226.  
  5227. public Integer idzamestnanci;
  5228.  
  5229. public Integer getIdzamestnanci() {
  5230. return this.idzamestnanci;
  5231. }
  5232.  
  5233. public Short datum_rok;
  5234.  
  5235. public Short getDatum_rok() {
  5236. return this.datum_rok;
  5237. }
  5238.  
  5239. public Short datum_mesic;
  5240.  
  5241. public Short getDatum_mesic() {
  5242. return this.datum_mesic;
  5243. }
  5244.  
  5245. public Integer doba_v_praci;
  5246.  
  5247. public Integer getDoba_v_praci() {
  5248. return this.doba_v_praci;
  5249. }
  5250.  
  5251. public Integer prescas;
  5252.  
  5253. public Integer getPrescas() {
  5254. return this.prescas;
  5255. }
  5256.  
  5257. private Integer readInteger(ObjectInputStream dis) throws IOException {
  5258. Integer intReturn;
  5259. int length = 0;
  5260. length = dis.readByte();
  5261. if (length == -1) {
  5262. intReturn = null;
  5263. } else {
  5264. intReturn = dis.readInt();
  5265. }
  5266. return intReturn;
  5267. }
  5268.  
  5269. private void writeInteger(Integer intNum, ObjectOutputStream dos)
  5270. throws IOException {
  5271. if (intNum == null) {
  5272. dos.writeByte(-1);
  5273. } else {
  5274. dos.writeByte(0);
  5275. dos.writeInt(intNum);
  5276. }
  5277. }
  5278.  
  5279. public void readData(ObjectInputStream dis) {
  5280.  
  5281. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  5282.  
  5283. try {
  5284.  
  5285. int length = 0;
  5286.  
  5287. this.zaznam_dochazky = readInteger(dis);
  5288.  
  5289. this.idzamestnanci = readInteger(dis);
  5290.  
  5291. length = dis.readByte();
  5292. if (length == -1) {
  5293. this.datum_rok = null;
  5294. } else {
  5295. this.datum_rok = dis.readShort();
  5296. }
  5297.  
  5298. length = dis.readByte();
  5299. if (length == -1) {
  5300. this.datum_mesic = null;
  5301. } else {
  5302. this.datum_mesic = dis.readShort();
  5303. }
  5304.  
  5305. this.doba_v_praci = readInteger(dis);
  5306.  
  5307. this.prescas = readInteger(dis);
  5308.  
  5309. } catch (IOException e) {
  5310. throw new RuntimeException(e);
  5311.  
  5312. }
  5313.  
  5314. }
  5315.  
  5316. }
  5317.  
  5318. public void writeData(ObjectOutputStream dos) {
  5319. try {
  5320.  
  5321. // Integer
  5322.  
  5323. writeInteger(this.zaznam_dochazky, dos);
  5324.  
  5325. // Integer
  5326.  
  5327. writeInteger(this.idzamestnanci, dos);
  5328.  
  5329. // Short
  5330.  
  5331. if (this.datum_rok == null) {
  5332. dos.writeByte(-1);
  5333. } else {
  5334. dos.writeByte(0);
  5335. dos.writeShort(this.datum_rok);
  5336. }
  5337.  
  5338. // Short
  5339.  
  5340. if (this.datum_mesic == null) {
  5341. dos.writeByte(-1);
  5342. } else {
  5343. dos.writeByte(0);
  5344. dos.writeShort(this.datum_mesic);
  5345. }
  5346.  
  5347. // Integer
  5348.  
  5349. writeInteger(this.doba_v_praci, dos);
  5350.  
  5351. // Integer
  5352.  
  5353. writeInteger(this.prescas, dos);
  5354.  
  5355. } catch (IOException e) {
  5356. throw new RuntimeException(e);
  5357. }
  5358.  
  5359. }
  5360.  
  5361. public String toString() {
  5362.  
  5363. StringBuilder sb = new StringBuilder();
  5364. sb.append(super.toString());
  5365. sb.append("[");
  5366. sb.append("zaznam_dochazky=" + String.valueOf(zaznam_dochazky));
  5367. sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
  5368. sb.append(",datum_rok=" + String.valueOf(datum_rok));
  5369. sb.append(",datum_mesic=" + String.valueOf(datum_mesic));
  5370. sb.append(",doba_v_praci=" + String.valueOf(doba_v_praci));
  5371. sb.append(",prescas=" + String.valueOf(prescas));
  5372. sb.append("]");
  5373.  
  5374. return sb.toString();
  5375. }
  5376.  
  5377. /**
  5378. * Compare keys
  5379. */
  5380. public int compareTo(row4Struct other) {
  5381.  
  5382. int returnValue = -1;
  5383.  
  5384. return returnValue;
  5385. }
  5386.  
  5387. private int checkNullsAndCompare(Object object1, Object object2) {
  5388. int returnValue = 0;
  5389. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  5390. returnValue = ((Comparable) object1).compareTo(object2);
  5391. } else if (object1 != null && object2 != null) {
  5392. returnValue = compareStrings(object1.toString(),
  5393. object2.toString());
  5394. } else if (object1 == null && object2 != null) {
  5395. returnValue = 1;
  5396. } else if (object1 != null && object2 == null) {
  5397. returnValue = -1;
  5398. } else {
  5399. returnValue = 0;
  5400. }
  5401.  
  5402. return returnValue;
  5403. }
  5404.  
  5405. private int compareStrings(String string1, String string2) {
  5406. return string1.compareTo(string2);
  5407. }
  5408.  
  5409. }
  5410.  
  5411. public static class OnRowsEndStructtAggregateRow_1 implements
  5412. routines.system.IPersistableRow<OnRowsEndStructtAggregateRow_1> {
  5413. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  5414. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  5415. protected static final int DEFAULT_HASHCODE = 1;
  5416. protected static final int PRIME = 31;
  5417. protected int hashCode = DEFAULT_HASHCODE;
  5418. public boolean hashCodeDirty = true;
  5419.  
  5420. public String loopKey;
  5421.  
  5422. public Integer zaznam_dochazky;
  5423.  
  5424. public Integer getZaznam_dochazky() {
  5425. return this.zaznam_dochazky;
  5426. }
  5427.  
  5428. public Integer idzamestnanci;
  5429.  
  5430. public Integer getIdzamestnanci() {
  5431. return this.idzamestnanci;
  5432. }
  5433.  
  5434. public Short datum_rok;
  5435.  
  5436. public Short getDatum_rok() {
  5437. return this.datum_rok;
  5438. }
  5439.  
  5440. public Short datum_mesic;
  5441.  
  5442. public Short getDatum_mesic() {
  5443. return this.datum_mesic;
  5444. }
  5445.  
  5446. public Integer doba_v_praci;
  5447.  
  5448. public Integer getDoba_v_praci() {
  5449. return this.doba_v_praci;
  5450. }
  5451.  
  5452. public Integer prescas;
  5453.  
  5454. public Integer getPrescas() {
  5455. return this.prescas;
  5456. }
  5457.  
  5458. @Override
  5459. public int hashCode() {
  5460. if (this.hashCodeDirty) {
  5461. final int prime = PRIME;
  5462. int result = DEFAULT_HASHCODE;
  5463.  
  5464. result = prime
  5465. * result
  5466. + ((this.zaznam_dochazky == null) ? 0
  5467. : this.zaznam_dochazky.hashCode());
  5468.  
  5469. this.hashCode = result;
  5470. this.hashCodeDirty = false;
  5471. }
  5472. return this.hashCode;
  5473. }
  5474.  
  5475. @Override
  5476. public boolean equals(Object obj) {
  5477. if (this == obj)
  5478. return true;
  5479. if (obj == null)
  5480. return false;
  5481. if (getClass() != obj.getClass())
  5482. return false;
  5483. final OnRowsEndStructtAggregateRow_1 other = (OnRowsEndStructtAggregateRow_1) obj;
  5484.  
  5485. if (this.zaznam_dochazky == null) {
  5486. if (other.zaznam_dochazky != null)
  5487. return false;
  5488.  
  5489. } else if (!this.zaznam_dochazky.equals(other.zaznam_dochazky))
  5490.  
  5491. return false;
  5492.  
  5493. return true;
  5494. }
  5495.  
  5496. public void copyDataTo(OnRowsEndStructtAggregateRow_1 other) {
  5497.  
  5498. other.zaznam_dochazky = this.zaznam_dochazky;
  5499. other.idzamestnanci = this.idzamestnanci;
  5500. other.datum_rok = this.datum_rok;
  5501. other.datum_mesic = this.datum_mesic;
  5502. other.doba_v_praci = this.doba_v_praci;
  5503. other.prescas = this.prescas;
  5504.  
  5505. }
  5506.  
  5507. public void copyKeysDataTo(OnRowsEndStructtAggregateRow_1 other) {
  5508.  
  5509. other.zaznam_dochazky = this.zaznam_dochazky;
  5510.  
  5511. }
  5512.  
  5513. private Integer readInteger(ObjectInputStream dis) throws IOException {
  5514. Integer intReturn;
  5515. int length = 0;
  5516. length = dis.readByte();
  5517. if (length == -1) {
  5518. intReturn = null;
  5519. } else {
  5520. intReturn = dis.readInt();
  5521. }
  5522. return intReturn;
  5523. }
  5524.  
  5525. private void writeInteger(Integer intNum, ObjectOutputStream dos)
  5526. throws IOException {
  5527. if (intNum == null) {
  5528. dos.writeByte(-1);
  5529. } else {
  5530. dos.writeByte(0);
  5531. dos.writeInt(intNum);
  5532. }
  5533. }
  5534.  
  5535. public void readData(ObjectInputStream dis) {
  5536.  
  5537. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  5538.  
  5539. try {
  5540.  
  5541. int length = 0;
  5542.  
  5543. this.zaznam_dochazky = readInteger(dis);
  5544.  
  5545. this.idzamestnanci = readInteger(dis);
  5546.  
  5547. length = dis.readByte();
  5548. if (length == -1) {
  5549. this.datum_rok = null;
  5550. } else {
  5551. this.datum_rok = dis.readShort();
  5552. }
  5553.  
  5554. length = dis.readByte();
  5555. if (length == -1) {
  5556. this.datum_mesic = null;
  5557. } else {
  5558. this.datum_mesic = dis.readShort();
  5559. }
  5560.  
  5561. this.doba_v_praci = readInteger(dis);
  5562.  
  5563. this.prescas = readInteger(dis);
  5564.  
  5565. } catch (IOException e) {
  5566. throw new RuntimeException(e);
  5567.  
  5568. }
  5569.  
  5570. }
  5571.  
  5572. }
  5573.  
  5574. public void writeData(ObjectOutputStream dos) {
  5575. try {
  5576.  
  5577. // Integer
  5578.  
  5579. writeInteger(this.zaznam_dochazky, dos);
  5580.  
  5581. // Integer
  5582.  
  5583. writeInteger(this.idzamestnanci, dos);
  5584.  
  5585. // Short
  5586.  
  5587. if (this.datum_rok == null) {
  5588. dos.writeByte(-1);
  5589. } else {
  5590. dos.writeByte(0);
  5591. dos.writeShort(this.datum_rok);
  5592. }
  5593.  
  5594. // Short
  5595.  
  5596. if (this.datum_mesic == null) {
  5597. dos.writeByte(-1);
  5598. } else {
  5599. dos.writeByte(0);
  5600. dos.writeShort(this.datum_mesic);
  5601. }
  5602.  
  5603. // Integer
  5604.  
  5605. writeInteger(this.doba_v_praci, dos);
  5606.  
  5607. // Integer
  5608.  
  5609. writeInteger(this.prescas, dos);
  5610.  
  5611. } catch (IOException e) {
  5612. throw new RuntimeException(e);
  5613. }
  5614.  
  5615. }
  5616.  
  5617. public String toString() {
  5618.  
  5619. StringBuilder sb = new StringBuilder();
  5620. sb.append(super.toString());
  5621. sb.append("[");
  5622. sb.append("zaznam_dochazky=" + String.valueOf(zaznam_dochazky));
  5623. sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
  5624. sb.append(",datum_rok=" + String.valueOf(datum_rok));
  5625. sb.append(",datum_mesic=" + String.valueOf(datum_mesic));
  5626. sb.append(",doba_v_praci=" + String.valueOf(doba_v_praci));
  5627. sb.append(",prescas=" + String.valueOf(prescas));
  5628. sb.append("]");
  5629.  
  5630. return sb.toString();
  5631. }
  5632.  
  5633. /**
  5634. * Compare keys
  5635. */
  5636. public int compareTo(OnRowsEndStructtAggregateRow_1 other) {
  5637.  
  5638. int returnValue = -1;
  5639.  
  5640. returnValue = checkNullsAndCompare(this.zaznam_dochazky,
  5641. other.zaznam_dochazky);
  5642. if (returnValue != 0) {
  5643. return returnValue;
  5644. }
  5645.  
  5646. return returnValue;
  5647. }
  5648.  
  5649. private int checkNullsAndCompare(Object object1, Object object2) {
  5650. int returnValue = 0;
  5651. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  5652. returnValue = ((Comparable) object1).compareTo(object2);
  5653. } else if (object1 != null && object2 != null) {
  5654. returnValue = compareStrings(object1.toString(),
  5655. object2.toString());
  5656. } else if (object1 == null && object2 != null) {
  5657. returnValue = 1;
  5658. } else if (object1 != null && object2 == null) {
  5659. returnValue = -1;
  5660. } else {
  5661. returnValue = 0;
  5662. }
  5663.  
  5664. return returnValue;
  5665. }
  5666.  
  5667. private int compareStrings(String string1, String string2) {
  5668. return string1.compareTo(string2);
  5669. }
  5670.  
  5671. }
  5672.  
  5673. public static class row10Struct implements
  5674. routines.system.IPersistableRow<row10Struct> {
  5675. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  5676. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  5677. protected static final int DEFAULT_HASHCODE = 1;
  5678. protected static final int PRIME = 31;
  5679. protected int hashCode = DEFAULT_HASHCODE;
  5680. public boolean hashCodeDirty = true;
  5681.  
  5682. public String loopKey;
  5683.  
  5684. public int zaznam_dochazky;
  5685.  
  5686. public int getZaznam_dochazky() {
  5687. return this.zaznam_dochazky;
  5688. }
  5689.  
  5690. public int idzamestnanci;
  5691.  
  5692. public int getIdzamestnanci() {
  5693. return this.idzamestnanci;
  5694. }
  5695.  
  5696. public short datum_rok;
  5697.  
  5698. public short getDatum_rok() {
  5699. return this.datum_rok;
  5700. }
  5701.  
  5702. public short datum_mesic;
  5703.  
  5704. public short getDatum_mesic() {
  5705. return this.datum_mesic;
  5706. }
  5707.  
  5708. public int doba_v_praci;
  5709.  
  5710. public int getDoba_v_praci() {
  5711. return this.doba_v_praci;
  5712. }
  5713.  
  5714. public int prescas;
  5715.  
  5716. public int getPrescas() {
  5717. return this.prescas;
  5718. }
  5719.  
  5720. @Override
  5721. public int hashCode() {
  5722. if (this.hashCodeDirty) {
  5723. final int prime = PRIME;
  5724. int result = DEFAULT_HASHCODE;
  5725.  
  5726. result = prime * result + (int) this.zaznam_dochazky;
  5727.  
  5728. this.hashCode = result;
  5729. this.hashCodeDirty = false;
  5730. }
  5731. return this.hashCode;
  5732. }
  5733.  
  5734. @Override
  5735. public boolean equals(Object obj) {
  5736. if (this == obj)
  5737. return true;
  5738. if (obj == null)
  5739. return false;
  5740. if (getClass() != obj.getClass())
  5741. return false;
  5742. final row10Struct other = (row10Struct) obj;
  5743.  
  5744. if (this.zaznam_dochazky != other.zaznam_dochazky)
  5745. return false;
  5746.  
  5747. return true;
  5748. }
  5749.  
  5750. public void copyDataTo(row10Struct other) {
  5751.  
  5752. other.zaznam_dochazky = this.zaznam_dochazky;
  5753. other.idzamestnanci = this.idzamestnanci;
  5754. other.datum_rok = this.datum_rok;
  5755. other.datum_mesic = this.datum_mesic;
  5756. other.doba_v_praci = this.doba_v_praci;
  5757. other.prescas = this.prescas;
  5758.  
  5759. }
  5760.  
  5761. public void copyKeysDataTo(row10Struct other) {
  5762.  
  5763. other.zaznam_dochazky = this.zaznam_dochazky;
  5764.  
  5765. }
  5766.  
  5767. public void readData(ObjectInputStream dis) {
  5768.  
  5769. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  5770.  
  5771. try {
  5772.  
  5773. int length = 0;
  5774.  
  5775. this.zaznam_dochazky = dis.readInt();
  5776.  
  5777. this.idzamestnanci = dis.readInt();
  5778.  
  5779. this.datum_rok = dis.readShort();
  5780.  
  5781. this.datum_mesic = dis.readShort();
  5782.  
  5783. this.doba_v_praci = dis.readInt();
  5784.  
  5785. this.prescas = dis.readInt();
  5786.  
  5787. } catch (IOException e) {
  5788. throw new RuntimeException(e);
  5789.  
  5790. }
  5791.  
  5792. }
  5793.  
  5794. }
  5795.  
  5796. public void writeData(ObjectOutputStream dos) {
  5797. try {
  5798.  
  5799. // int
  5800.  
  5801. dos.writeInt(this.zaznam_dochazky);
  5802.  
  5803. // int
  5804.  
  5805. dos.writeInt(this.idzamestnanci);
  5806.  
  5807. // short
  5808.  
  5809. dos.writeShort(this.datum_rok);
  5810.  
  5811. // short
  5812.  
  5813. dos.writeShort(this.datum_mesic);
  5814.  
  5815. // int
  5816.  
  5817. dos.writeInt(this.doba_v_praci);
  5818.  
  5819. // int
  5820.  
  5821. dos.writeInt(this.prescas);
  5822.  
  5823. } catch (IOException e) {
  5824. throw new RuntimeException(e);
  5825. }
  5826.  
  5827. }
  5828.  
  5829. public String toString() {
  5830.  
  5831. StringBuilder sb = new StringBuilder();
  5832. sb.append(super.toString());
  5833. sb.append("[");
  5834. sb.append("zaznam_dochazky=" + String.valueOf(zaznam_dochazky));
  5835. sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
  5836. sb.append(",datum_rok=" + String.valueOf(datum_rok));
  5837. sb.append(",datum_mesic=" + String.valueOf(datum_mesic));
  5838. sb.append(",doba_v_praci=" + String.valueOf(doba_v_praci));
  5839. sb.append(",prescas=" + String.valueOf(prescas));
  5840. sb.append("]");
  5841.  
  5842. return sb.toString();
  5843. }
  5844.  
  5845. /**
  5846. * Compare keys
  5847. */
  5848. public int compareTo(row10Struct other) {
  5849.  
  5850. int returnValue = -1;
  5851.  
  5852. returnValue = checkNullsAndCompare(this.zaznam_dochazky,
  5853. other.zaznam_dochazky);
  5854. if (returnValue != 0) {
  5855. return returnValue;
  5856. }
  5857.  
  5858. return returnValue;
  5859. }
  5860.  
  5861. private int checkNullsAndCompare(Object object1, Object object2) {
  5862. int returnValue = 0;
  5863. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  5864. returnValue = ((Comparable) object1).compareTo(object2);
  5865. } else if (object1 != null && object2 != null) {
  5866. returnValue = compareStrings(object1.toString(),
  5867. object2.toString());
  5868. } else if (object1 == null && object2 != null) {
  5869. returnValue = 1;
  5870. } else if (object1 != null && object2 == null) {
  5871. returnValue = -1;
  5872. } else {
  5873. returnValue = 0;
  5874. }
  5875.  
  5876. return returnValue;
  5877. }
  5878.  
  5879. private int compareStrings(String string1, String string2) {
  5880. return string1.compareTo(string2);
  5881. }
  5882.  
  5883. }
  5884.  
  5885. public static class after_tDBInput_6Struct implements
  5886. routines.system.IPersistableRow<after_tDBInput_6Struct> {
  5887. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  5888. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  5889. protected static final int DEFAULT_HASHCODE = 1;
  5890. protected static final int PRIME = 31;
  5891. protected int hashCode = DEFAULT_HASHCODE;
  5892. public boolean hashCodeDirty = true;
  5893.  
  5894. public String loopKey;
  5895.  
  5896. public int zaznam_dochazky;
  5897.  
  5898. public int getZaznam_dochazky() {
  5899. return this.zaznam_dochazky;
  5900. }
  5901.  
  5902. public int idzamestnanci;
  5903.  
  5904. public int getIdzamestnanci() {
  5905. return this.idzamestnanci;
  5906. }
  5907.  
  5908. public short datum_rok;
  5909.  
  5910. public short getDatum_rok() {
  5911. return this.datum_rok;
  5912. }
  5913.  
  5914. public short datum_mesic;
  5915.  
  5916. public short getDatum_mesic() {
  5917. return this.datum_mesic;
  5918. }
  5919.  
  5920. public int doba_v_praci;
  5921.  
  5922. public int getDoba_v_praci() {
  5923. return this.doba_v_praci;
  5924. }
  5925.  
  5926. public int prescas;
  5927.  
  5928. public int getPrescas() {
  5929. return this.prescas;
  5930. }
  5931.  
  5932. @Override
  5933. public int hashCode() {
  5934. if (this.hashCodeDirty) {
  5935. final int prime = PRIME;
  5936. int result = DEFAULT_HASHCODE;
  5937.  
  5938. result = prime * result + (int) this.zaznam_dochazky;
  5939.  
  5940. this.hashCode = result;
  5941. this.hashCodeDirty = false;
  5942. }
  5943. return this.hashCode;
  5944. }
  5945.  
  5946. @Override
  5947. public boolean equals(Object obj) {
  5948. if (this == obj)
  5949. return true;
  5950. if (obj == null)
  5951. return false;
  5952. if (getClass() != obj.getClass())
  5953. return false;
  5954. final after_tDBInput_6Struct other = (after_tDBInput_6Struct) obj;
  5955.  
  5956. if (this.zaznam_dochazky != other.zaznam_dochazky)
  5957. return false;
  5958.  
  5959. return true;
  5960. }
  5961.  
  5962. public void copyDataTo(after_tDBInput_6Struct other) {
  5963.  
  5964. other.zaznam_dochazky = this.zaznam_dochazky;
  5965. other.idzamestnanci = this.idzamestnanci;
  5966. other.datum_rok = this.datum_rok;
  5967. other.datum_mesic = this.datum_mesic;
  5968. other.doba_v_praci = this.doba_v_praci;
  5969. other.prescas = this.prescas;
  5970.  
  5971. }
  5972.  
  5973. public void copyKeysDataTo(after_tDBInput_6Struct other) {
  5974.  
  5975. other.zaznam_dochazky = this.zaznam_dochazky;
  5976.  
  5977. }
  5978.  
  5979. public void readData(ObjectInputStream dis) {
  5980.  
  5981. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  5982.  
  5983. try {
  5984.  
  5985. int length = 0;
  5986.  
  5987. this.zaznam_dochazky = dis.readInt();
  5988.  
  5989. this.idzamestnanci = dis.readInt();
  5990.  
  5991. this.datum_rok = dis.readShort();
  5992.  
  5993. this.datum_mesic = dis.readShort();
  5994.  
  5995. this.doba_v_praci = dis.readInt();
  5996.  
  5997. this.prescas = dis.readInt();
  5998.  
  5999. } catch (IOException e) {
  6000. throw new RuntimeException(e);
  6001.  
  6002. }
  6003.  
  6004. }
  6005.  
  6006. }
  6007.  
  6008. public void writeData(ObjectOutputStream dos) {
  6009. try {
  6010.  
  6011. // int
  6012.  
  6013. dos.writeInt(this.zaznam_dochazky);
  6014.  
  6015. // int
  6016.  
  6017. dos.writeInt(this.idzamestnanci);
  6018.  
  6019. // short
  6020.  
  6021. dos.writeShort(this.datum_rok);
  6022.  
  6023. // short
  6024.  
  6025. dos.writeShort(this.datum_mesic);
  6026.  
  6027. // int
  6028.  
  6029. dos.writeInt(this.doba_v_praci);
  6030.  
  6031. // int
  6032.  
  6033. dos.writeInt(this.prescas);
  6034.  
  6035. } catch (IOException e) {
  6036. throw new RuntimeException(e);
  6037. }
  6038.  
  6039. }
  6040.  
  6041. public String toString() {
  6042.  
  6043. StringBuilder sb = new StringBuilder();
  6044. sb.append(super.toString());
  6045. sb.append("[");
  6046. sb.append("zaznam_dochazky=" + String.valueOf(zaznam_dochazky));
  6047. sb.append(",idzamestnanci=" + String.valueOf(idzamestnanci));
  6048. sb.append(",datum_rok=" + String.valueOf(datum_rok));
  6049. sb.append(",datum_mesic=" + String.valueOf(datum_mesic));
  6050. sb.append(",doba_v_praci=" + String.valueOf(doba_v_praci));
  6051. sb.append(",prescas=" + String.valueOf(prescas));
  6052. sb.append("]");
  6053.  
  6054. return sb.toString();
  6055. }
  6056.  
  6057. /**
  6058. * Compare keys
  6059. */
  6060. public int compareTo(after_tDBInput_6Struct other) {
  6061.  
  6062. int returnValue = -1;
  6063.  
  6064. returnValue = checkNullsAndCompare(this.zaznam_dochazky,
  6065. other.zaznam_dochazky);
  6066. if (returnValue != 0) {
  6067. return returnValue;
  6068. }
  6069.  
  6070. return returnValue;
  6071. }
  6072.  
  6073. private int checkNullsAndCompare(Object object1, Object object2) {
  6074. int returnValue = 0;
  6075. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  6076. returnValue = ((Comparable) object1).compareTo(object2);
  6077. } else if (object1 != null && object2 != null) {
  6078. returnValue = compareStrings(object1.toString(),
  6079. object2.toString());
  6080. } else if (object1 == null && object2 != null) {
  6081. returnValue = 1;
  6082. } else if (object1 != null && object2 == null) {
  6083. returnValue = -1;
  6084. } else {
  6085. returnValue = 0;
  6086. }
  6087.  
  6088. return returnValue;
  6089. }
  6090.  
  6091. private int compareStrings(String string1, String string2) {
  6092. return string1.compareTo(string2);
  6093. }
  6094.  
  6095. }
  6096.  
  6097. public void tDBInput_6Process(final java.util.Map<String, Object> globalMap)
  6098. throws TalendException {
  6099. globalMap.put("tDBInput_6_SUBPROCESS_STATE", 0);
  6100.  
  6101. final boolean execStat = this.execStat;
  6102. String currentVirtualComponent = null;
  6103.  
  6104. String iterateId = "";
  6105.  
  6106. String currentComponent = "";
  6107. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  6108.  
  6109. try {
  6110. // TDI-39566 avoid throwing an useless Exception
  6111. boolean resumeIt = true;
  6112. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  6113. String currentMethodName = new java.lang.Exception()
  6114. .getStackTrace()[0].getMethodName();
  6115. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  6116. }
  6117. if (resumeIt || globalResumeTicket) { // start the resume
  6118. globalResumeTicket = true;
  6119.  
  6120. tDBInput_1Process(globalMap);
  6121. tDBInput_3Process(globalMap);
  6122. tDBInput_5Process(globalMap);
  6123. tDBInput_7Process(globalMap);
  6124. tDBInput_8Process(globalMap);
  6125. tDBInput_9Process(globalMap);
  6126. tDBInput_10Process(globalMap);
  6127.  
  6128. row10Struct row10 = new row10Struct();
  6129. row4Struct row4 = new row4Struct();
  6130. out2Struct out2 = new out2Struct();
  6131.  
  6132. /**
  6133. * [tAggregateRow_1_AGGOUT begin ] start
  6134. */
  6135.  
  6136. ok_Hash.put("tAggregateRow_1_AGGOUT", false);
  6137. start_Hash.put("tAggregateRow_1_AGGOUT",
  6138. System.currentTimeMillis());
  6139.  
  6140. currentVirtualComponent = "tAggregateRow_1";
  6141.  
  6142. currentComponent = "tAggregateRow_1_AGGOUT";
  6143.  
  6144. if (execStat) {
  6145. if (resourceMap.get("inIterateVComp") == null) {
  6146.  
  6147. runStat.updateStatOnConnection("row10" + iterateId, 0,
  6148. 0);
  6149.  
  6150. }
  6151. }
  6152.  
  6153. int tos_count_tAggregateRow_1_AGGOUT = 0;
  6154.  
  6155. // ------------ Seems it is not used
  6156.  
  6157. java.util.Map hashAggreg_tAggregateRow_1 = new java.util.HashMap();
  6158.  
  6159. // ------------
  6160.  
  6161. class UtilClass_tAggregateRow_1 { // G_OutBegin_AggR_144
  6162.  
  6163. public double sd(Double[] data) {
  6164. final int n = data.length;
  6165. if (n < 2) {
  6166. return Double.NaN;
  6167. }
  6168. double d1 = 0d;
  6169. double d2 = 0d;
  6170.  
  6171. for (int i = 0; i < data.length; i++) {
  6172. d1 += (data[i] * data[i]);
  6173. d2 += data[i];
  6174. }
  6175.  
  6176. return Math.sqrt((n * d1 - d2 * d2) / n / (n - 1));
  6177. }
  6178.  
  6179. public void checkedIADD(byte a, byte b,
  6180. boolean checkTypeOverFlow, boolean checkUlp) {
  6181. byte r = (byte) (a + b);
  6182. if (checkTypeOverFlow && ((a ^ r) & (b ^ r)) < 0) {
  6183. throw new RuntimeException(buildOverflowMessage(
  6184. String.valueOf(a), String.valueOf(b),
  6185. "'short/Short'", "'byte/Byte'"));
  6186. }
  6187. }
  6188.  
  6189. public void checkedIADD(short a, short b,
  6190. boolean checkTypeOverFlow, boolean checkUlp) {
  6191. short r = (short) (a + b);
  6192. if (checkTypeOverFlow && ((a ^ r) & (b ^ r)) < 0) {
  6193. throw new RuntimeException(buildOverflowMessage(
  6194. String.valueOf(a), String.valueOf(b),
  6195. "'int/Integer'", "'short/Short'"));
  6196. }
  6197. }
  6198.  
  6199. public void checkedIADD(int a, int b,
  6200. boolean checkTypeOverFlow, boolean checkUlp) {
  6201. int r = a + b;
  6202. if (checkTypeOverFlow && ((a ^ r) & (b ^ r)) < 0) {
  6203. throw new RuntimeException(buildOverflowMessage(
  6204. String.valueOf(a), String.valueOf(b),
  6205. "'long/Long'", "'int/Integer'"));
  6206. }
  6207. }
  6208.  
  6209. public void checkedIADD(long a, long b,
  6210. boolean checkTypeOverFlow, boolean checkUlp) {
  6211. long r = a + b;
  6212. if (checkTypeOverFlow && ((a ^ r) & (b ^ r)) < 0) {
  6213. throw new RuntimeException(buildOverflowMessage(
  6214. String.valueOf(a), String.valueOf(b),
  6215. "'BigDecimal'", "'long/Long'"));
  6216. }
  6217. }
  6218.  
  6219. public void checkedIADD(float a, float b,
  6220. boolean checkTypeOverFlow, boolean checkUlp) {
  6221.  
  6222. if (checkUlp) {
  6223. float minAddedValue = Math.ulp(a);
  6224. if (minAddedValue > Math.abs(b)) {
  6225. throw new RuntimeException(
  6226. buildPrecisionMessage(
  6227. String.valueOf(a),
  6228. String.valueOf(b),
  6229. "'double' or 'BigDecimal'",
  6230. "'float/Float'"));
  6231. }
  6232. }
  6233.  
  6234. if (checkTypeOverFlow
  6235. && ((double) a + (double) b > (double) Float.MAX_VALUE)
  6236. || ((double) a + (double) b < (double) -Float.MAX_VALUE)) {
  6237. throw new RuntimeException(
  6238. buildOverflowMessage(String.valueOf(a),
  6239. String.valueOf(b),
  6240. "'double' or 'BigDecimal'",
  6241. "'float/Float'"));
  6242. }
  6243. }
  6244.  
  6245. public void checkedIADD(double a, double b,
  6246. boolean checkTypeOverFlow, boolean checkUlp) {
  6247.  
  6248. if (checkUlp) {
  6249. double minAddedValue = Math.ulp(a);
  6250. if (minAddedValue > Math.abs(b)) {
  6251. throw new RuntimeException(
  6252. buildPrecisionMessage(
  6253. String.valueOf(a),
  6254. String.valueOf(a),
  6255. "'BigDecimal'",
  6256. "'double/Double'"));
  6257. }
  6258. }
  6259.  
  6260. if (checkTypeOverFlow
  6261. && (a + b > (double) Double.MAX_VALUE)
  6262. || (a + b < -Double.MAX_VALUE)) {
  6263. throw new RuntimeException(buildOverflowMessage(
  6264. String.valueOf(a), String.valueOf(b),
  6265. "'BigDecimal'", "'double/Double'"));
  6266. }
  6267. }
  6268.  
  6269. public void checkedIADD(double a, byte b,
  6270. boolean checkTypeOverFlow, boolean checkUlp) {
  6271.  
  6272. if (checkTypeOverFlow
  6273. && (a + b > (double) Double.MAX_VALUE)
  6274. || (a + b < -Double.MAX_VALUE)) {
  6275. throw new RuntimeException(buildOverflowMessage(
  6276. String.valueOf(a), String.valueOf(b),
  6277. "'BigDecimal'", "'double/Double'"));
  6278. }
  6279. }
  6280.  
  6281. public void checkedIADD(double a, short b,
  6282. boolean checkTypeOverFlow, boolean checkUlp) {
  6283.  
  6284. if (checkTypeOverFlow
  6285. && (a + b > (double) Double.MAX_VALUE)
  6286. || (a + b < -Double.MAX_VALUE)) {
  6287. throw new RuntimeException(buildOverflowMessage(
  6288. String.valueOf(a), String.valueOf(b),
  6289. "'BigDecimal'", "'double/Double'"));
  6290. }
  6291. }
  6292.  
  6293. public void checkedIADD(double a, int b,
  6294. boolean checkTypeOverFlow, boolean checkUlp) {
  6295.  
  6296. if (checkTypeOverFlow
  6297. && (a + b > (double) Double.MAX_VALUE)
  6298. || (a + b < -Double.MAX_VALUE)) {
  6299. throw new RuntimeException(buildOverflowMessage(
  6300. String.valueOf(a), String.valueOf(b),
  6301. "'BigDecimal'", "'double/Double'"));
  6302. }
  6303. }
  6304.  
  6305. public void checkedIADD(double a, float b,
  6306. boolean checkTypeOverFlow, boolean checkUlp) {
  6307.  
  6308. if (checkUlp) {
  6309. double minAddedValue = Math.ulp(a);
  6310. if (minAddedValue > Math.abs(b)) {
  6311. throw new RuntimeException(
  6312. buildPrecisionMessage(
  6313. String.valueOf(a),
  6314. String.valueOf(a),
  6315. "'BigDecimal'",
  6316. "'double/Double'"));
  6317. }
  6318. }
  6319.  
  6320. if (checkTypeOverFlow
  6321. && (a + b > (double) Double.MAX_VALUE)
  6322. || (a + b < -Double.MAX_VALUE)) {
  6323. throw new RuntimeException(buildOverflowMessage(
  6324. String.valueOf(a), String.valueOf(b),
  6325. "'BigDecimal'", "'double/Double'"));
  6326. }
  6327. }
  6328.  
  6329. private String buildOverflowMessage(String a, String b,
  6330. String advicedTypes, String originalType) {
  6331. return "Type overflow when adding "
  6332. + b
  6333. + " to "
  6334. + a
  6335. + ", to resolve this problem, increase the precision by using "
  6336. + advicedTypes + " type in place of "
  6337. + originalType + ".";
  6338. }
  6339.  
  6340. private String buildPrecisionMessage(String a, String b,
  6341. String advicedTypes, String originalType) {
  6342. return "The double precision is unsufficient to add the value "
  6343. + b
  6344. + " to "
  6345. + a
  6346. + ", to resolve this problem, increase the precision by using "
  6347. + advicedTypes
  6348. + " type in place of "
  6349. + originalType + ".";
  6350. }
  6351.  
  6352. } // G_OutBegin_AggR_144
  6353.  
  6354. UtilClass_tAggregateRow_1 utilClass_tAggregateRow_1 = new UtilClass_tAggregateRow_1();
  6355.  
  6356. class AggOperationStruct_tAggregateRow_1 { // G_OutBegin_AggR_100
  6357.  
  6358. private static final int DEFAULT_HASHCODE = 1;
  6359. private static final int PRIME = 31;
  6360. private int hashCode = DEFAULT_HASHCODE;
  6361. public boolean hashCodeDirty = true;
  6362.  
  6363. int idzamestnanci;
  6364. short datum_rok;
  6365. short datum_mesic;
  6366. Integer doba_v_praci_sum;
  6367. Integer prescas_sum;
  6368.  
  6369. @Override
  6370. public int hashCode() {
  6371. if (this.hashCodeDirty) {
  6372. final int prime = PRIME;
  6373. int result = DEFAULT_HASHCODE;
  6374.  
  6375. result = prime * result + (int) this.idzamestnanci;
  6376.  
  6377. result = prime * result + (int) this.datum_rok;
  6378.  
  6379. result = prime * result + (int) this.datum_mesic;
  6380.  
  6381. this.hashCode = result;
  6382. this.hashCodeDirty = false;
  6383. }
  6384. return this.hashCode;
  6385. }
  6386.  
  6387. @Override
  6388. public boolean equals(Object obj) {
  6389. if (this == obj)
  6390. return true;
  6391. if (obj == null)
  6392. return false;
  6393. if (getClass() != obj.getClass())
  6394. return false;
  6395. final AggOperationStruct_tAggregateRow_1 other = (AggOperationStruct_tAggregateRow_1) obj;
  6396.  
  6397. if (this.idzamestnanci != other.idzamestnanci)
  6398. return false;
  6399.  
  6400. if (this.datum_rok != other.datum_rok)
  6401. return false;
  6402.  
  6403. if (this.datum_mesic != other.datum_mesic)
  6404. return false;
  6405.  
  6406. return true;
  6407. }
  6408.  
  6409. } // G_OutBegin_AggR_100
  6410.  
  6411. AggOperationStruct_tAggregateRow_1 operation_result_tAggregateRow_1 = null;
  6412. AggOperationStruct_tAggregateRow_1 operation_finder_tAggregateRow_1 = new AggOperationStruct_tAggregateRow_1();
  6413. java.util.Map<AggOperationStruct_tAggregateRow_1, AggOperationStruct_tAggregateRow_1> hash_tAggregateRow_1 = new java.util.HashMap<AggOperationStruct_tAggregateRow_1, AggOperationStruct_tAggregateRow_1>();
  6414.  
  6415. /**
  6416. * [tAggregateRow_1_AGGOUT begin ] stop
  6417. */
  6418.  
  6419. /**
  6420. * [tDBInput_6 begin ] start
  6421. */
  6422.  
  6423. ok_Hash.put("tDBInput_6", false);
  6424. start_Hash.put("tDBInput_6", System.currentTimeMillis());
  6425.  
  6426. currentComponent = "tDBInput_6";
  6427.  
  6428. int tos_count_tDBInput_6 = 0;
  6429.  
  6430. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_6 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  6431. .getMSSqlGenerateTimestampUtil();
  6432.  
  6433. java.util.List<String> talendToDBList_tDBInput_6 = new java.util.ArrayList();
  6434. String[] talendToDBArray_tDBInput_6 = new String[] { "FLOAT",
  6435. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  6436. "DECIMAL IDENTITY", "REAL" };
  6437. java.util.Collections.addAll(talendToDBList_tDBInput_6,
  6438. talendToDBArray_tDBInput_6);
  6439. int nb_line_tDBInput_6 = 0;
  6440. java.sql.Connection conn_tDBInput_6 = null;
  6441. String driverClass_tDBInput_6 = "net.sourceforge.jtds.jdbc.Driver";
  6442. java.lang.Class.forName(driverClass_tDBInput_6);
  6443. String dbUser_tDBInput_6 = "tym1";
  6444.  
  6445. final String decryptedPassword_tDBInput_6 = routines.system.PasswordEncryptUtil
  6446. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  6447.  
  6448. String dbPwd_tDBInput_6 = decryptedPassword_tDBInput_6;
  6449.  
  6450. String port_tDBInput_6 = "1433";
  6451. String dbname_tDBInput_6 = "bi_zdroj01";
  6452. String url_tDBInput_6 = "jdbc:jtds:sqlserver://"
  6453. + "158.196.160.60";
  6454. if (!"".equals(port_tDBInput_6)) {
  6455. url_tDBInput_6 += ":" + "1433";
  6456. }
  6457. if (!"".equals(dbname_tDBInput_6)) {
  6458. url_tDBInput_6 += "//" + "bi_zdroj01";
  6459. }
  6460. url_tDBInput_6 += ";appName=" + projectName + ";" + "";
  6461. String dbschema_tDBInput_6 = "";
  6462.  
  6463. conn_tDBInput_6 = java.sql.DriverManager.getConnection(
  6464. url_tDBInput_6, dbUser_tDBInput_6, dbPwd_tDBInput_6);
  6465.  
  6466. java.sql.Statement stmt_tDBInput_6 = conn_tDBInput_6
  6467. .createStatement();
  6468.  
  6469. String dbquery_tDBInput_6 = "SELECT evidence_dochazky.zaznam_dochazky,\nevidence_dochazky.idzamestnanci,\nYEAR(evidence_dochazky.datum) AS datum_rok"
  6470. + ",\nMONTH(evidence_dochazky.datum) AS datum_mesic,\nDATEDIFF(second, evidence_dochazky.cas_prichodu, cas_odchodu)\nAS dob"
  6471. + "a_v_praci,\n IIF(DATEDIFF(second, evidence_dochazky.cas_prichodu, cas_odchodu) -\n8*3600 > 0,\nDATEDIFF(second, evidence"
  6472. + "_dochazky.cas_prichodu, cas_odchodu) -\n8*3600, 0) AS prescas\nFROM evidence_dochazky";
  6473.  
  6474. globalMap.put("tDBInput_6_QUERY", dbquery_tDBInput_6);
  6475. java.sql.ResultSet rs_tDBInput_6 = null;
  6476.  
  6477. try {
  6478. rs_tDBInput_6 = stmt_tDBInput_6
  6479. .executeQuery(dbquery_tDBInput_6);
  6480. java.sql.ResultSetMetaData rsmd_tDBInput_6 = rs_tDBInput_6
  6481. .getMetaData();
  6482. int colQtyInRs_tDBInput_6 = rsmd_tDBInput_6
  6483. .getColumnCount();
  6484.  
  6485. String tmpContent_tDBInput_6 = null;
  6486.  
  6487. while (rs_tDBInput_6.next()) {
  6488. nb_line_tDBInput_6++;
  6489.  
  6490. if (colQtyInRs_tDBInput_6 < 1) {
  6491. row10.zaznam_dochazky = 0;
  6492. } else {
  6493.  
  6494. if (rs_tDBInput_6.getObject(1) != null) {
  6495. row10.zaznam_dochazky = rs_tDBInput_6.getInt(1);
  6496. } else {
  6497. throw new RuntimeException(
  6498. "Null value in non-Nullable column");
  6499. }
  6500. }
  6501. if (colQtyInRs_tDBInput_6 < 2) {
  6502. row10.idzamestnanci = 0;
  6503. } else {
  6504.  
  6505. if (rs_tDBInput_6.getObject(2) != null) {
  6506. row10.idzamestnanci = rs_tDBInput_6.getInt(2);
  6507. } else {
  6508. throw new RuntimeException(
  6509. "Null value in non-Nullable column");
  6510. }
  6511. }
  6512. if (colQtyInRs_tDBInput_6 < 3) {
  6513. row10.datum_rok = 0;
  6514. } else {
  6515.  
  6516. if (rs_tDBInput_6.getObject(3) != null) {
  6517. row10.datum_rok = rs_tDBInput_6.getShort(3);
  6518. } else {
  6519. throw new RuntimeException(
  6520. "Null value in non-Nullable column");
  6521. }
  6522. }
  6523. if (colQtyInRs_tDBInput_6 < 4) {
  6524. row10.datum_mesic = 0;
  6525. } else {
  6526.  
  6527. if (rs_tDBInput_6.getObject(4) != null) {
  6528. row10.datum_mesic = rs_tDBInput_6.getShort(4);
  6529. } else {
  6530. throw new RuntimeException(
  6531. "Null value in non-Nullable column");
  6532. }
  6533. }
  6534. if (colQtyInRs_tDBInput_6 < 5) {
  6535. row10.doba_v_praci = 0;
  6536. } else {
  6537.  
  6538. if (rs_tDBInput_6.getObject(5) != null) {
  6539. row10.doba_v_praci = rs_tDBInput_6.getInt(5);
  6540. } else {
  6541. throw new RuntimeException(
  6542. "Null value in non-Nullable column");
  6543. }
  6544. }
  6545. if (colQtyInRs_tDBInput_6 < 6) {
  6546. row10.prescas = 0;
  6547. } else {
  6548.  
  6549. if (rs_tDBInput_6.getObject(6) != null) {
  6550. row10.prescas = rs_tDBInput_6.getInt(6);
  6551. } else {
  6552. throw new RuntimeException(
  6553. "Null value in non-Nullable column");
  6554. }
  6555. }
  6556.  
  6557. /**
  6558. * [tDBInput_6 begin ] stop
  6559. */
  6560.  
  6561. /**
  6562. * [tDBInput_6 main ] start
  6563. */
  6564.  
  6565. currentComponent = "tDBInput_6";
  6566.  
  6567. tos_count_tDBInput_6++;
  6568.  
  6569. /**
  6570. * [tDBInput_6 main ] stop
  6571. */
  6572.  
  6573. /**
  6574. * [tDBInput_6 process_data_begin ] start
  6575. */
  6576.  
  6577. currentComponent = "tDBInput_6";
  6578.  
  6579. /**
  6580. * [tDBInput_6 process_data_begin ] stop
  6581. */
  6582.  
  6583. /**
  6584. * [tAggregateRow_1_AGGOUT main ] start
  6585. */
  6586.  
  6587. currentVirtualComponent = "tAggregateRow_1";
  6588.  
  6589. currentComponent = "tAggregateRow_1_AGGOUT";
  6590.  
  6591. // row10
  6592. // row10
  6593.  
  6594. if (execStat) {
  6595. runStat.updateStatOnConnection("row10" + iterateId,
  6596. 1, 1);
  6597. }
  6598.  
  6599. operation_finder_tAggregateRow_1.idzamestnanci = row10.idzamestnanci;
  6600. operation_finder_tAggregateRow_1.datum_rok = row10.datum_rok;
  6601. operation_finder_tAggregateRow_1.datum_mesic = row10.datum_mesic;
  6602.  
  6603. operation_finder_tAggregateRow_1.hashCodeDirty = true;
  6604.  
  6605. operation_result_tAggregateRow_1 = hash_tAggregateRow_1
  6606. .get(operation_finder_tAggregateRow_1);
  6607.  
  6608. if (operation_result_tAggregateRow_1 == null) { // G_OutMain_AggR_001
  6609.  
  6610. operation_result_tAggregateRow_1 = new AggOperationStruct_tAggregateRow_1();
  6611.  
  6612. operation_result_tAggregateRow_1.idzamestnanci = operation_finder_tAggregateRow_1.idzamestnanci;
  6613. operation_result_tAggregateRow_1.datum_rok = operation_finder_tAggregateRow_1.datum_rok;
  6614. operation_result_tAggregateRow_1.datum_mesic = operation_finder_tAggregateRow_1.datum_mesic;
  6615.  
  6616. hash_tAggregateRow_1.put(
  6617. operation_result_tAggregateRow_1,
  6618. operation_result_tAggregateRow_1);
  6619.  
  6620. } // G_OutMain_AggR_001
  6621.  
  6622. if (operation_result_tAggregateRow_1.doba_v_praci_sum == null) {
  6623. operation_result_tAggregateRow_1.doba_v_praci_sum = (int) 0;
  6624. }
  6625.  
  6626. operation_result_tAggregateRow_1.doba_v_praci_sum += row10.doba_v_praci;
  6627.  
  6628. if (operation_result_tAggregateRow_1.prescas_sum == null) {
  6629. operation_result_tAggregateRow_1.prescas_sum = (int) 0;
  6630. }
  6631.  
  6632. operation_result_tAggregateRow_1.prescas_sum += row10.prescas;
  6633.  
  6634. tos_count_tAggregateRow_1_AGGOUT++;
  6635.  
  6636. /**
  6637. * [tAggregateRow_1_AGGOUT main ] stop
  6638. */
  6639.  
  6640. /**
  6641. * [tAggregateRow_1_AGGOUT process_data_begin ] start
  6642. */
  6643.  
  6644. currentVirtualComponent = "tAggregateRow_1";
  6645.  
  6646. currentComponent = "tAggregateRow_1_AGGOUT";
  6647.  
  6648. /**
  6649. * [tAggregateRow_1_AGGOUT process_data_begin ] stop
  6650. */
  6651.  
  6652. /**
  6653. * [tAggregateRow_1_AGGOUT process_data_end ] start
  6654. */
  6655.  
  6656. currentVirtualComponent = "tAggregateRow_1";
  6657.  
  6658. currentComponent = "tAggregateRow_1_AGGOUT";
  6659.  
  6660. /**
  6661. * [tAggregateRow_1_AGGOUT process_data_end ] stop
  6662. */
  6663.  
  6664. /**
  6665. * [tDBInput_6 process_data_end ] start
  6666. */
  6667.  
  6668. currentComponent = "tDBInput_6";
  6669.  
  6670. /**
  6671. * [tDBInput_6 process_data_end ] stop
  6672. */
  6673.  
  6674. /**
  6675. * [tDBInput_6 end ] start
  6676. */
  6677.  
  6678. currentComponent = "tDBInput_6";
  6679.  
  6680. }
  6681. } finally {
  6682. if (rs_tDBInput_6 != null) {
  6683. rs_tDBInput_6.close();
  6684. }
  6685. if (stmt_tDBInput_6 != null) {
  6686. stmt_tDBInput_6.close();
  6687. }
  6688. if (conn_tDBInput_6 != null && !conn_tDBInput_6.isClosed()) {
  6689.  
  6690. conn_tDBInput_6.close();
  6691.  
  6692. }
  6693. }
  6694. globalMap.put("tDBInput_6_NB_LINE", nb_line_tDBInput_6);
  6695.  
  6696. ok_Hash.put("tDBInput_6", true);
  6697. end_Hash.put("tDBInput_6", System.currentTimeMillis());
  6698.  
  6699. /**
  6700. * [tDBInput_6 end ] stop
  6701. */
  6702.  
  6703. /**
  6704. * [tAggregateRow_1_AGGOUT end ] start
  6705. */
  6706.  
  6707. currentVirtualComponent = "tAggregateRow_1";
  6708.  
  6709. currentComponent = "tAggregateRow_1_AGGOUT";
  6710.  
  6711. if (execStat) {
  6712. if (resourceMap.get("inIterateVComp") == null
  6713. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  6714. runStat.updateStatOnConnection("row10" + iterateId, 2,
  6715. 0);
  6716. }
  6717. }
  6718.  
  6719. ok_Hash.put("tAggregateRow_1_AGGOUT", true);
  6720. end_Hash.put("tAggregateRow_1_AGGOUT",
  6721. System.currentTimeMillis());
  6722.  
  6723. /**
  6724. * [tAggregateRow_1_AGGOUT end ] stop
  6725. */
  6726.  
  6727. /**
  6728. * [tDBOutput_1 begin ] start
  6729. */
  6730.  
  6731. ok_Hash.put("tDBOutput_1", false);
  6732. start_Hash.put("tDBOutput_1", System.currentTimeMillis());
  6733.  
  6734. currentComponent = "tDBOutput_1";
  6735.  
  6736. if (execStat) {
  6737. if (resourceMap.get("inIterateVComp") == null) {
  6738.  
  6739. runStat.updateStatOnConnection("out2" + iterateId, 0, 0);
  6740.  
  6741. }
  6742. }
  6743.  
  6744. int tos_count_tDBOutput_1 = 0;
  6745.  
  6746. int nb_line_tDBOutput_1 = 0;
  6747. int nb_line_update_tDBOutput_1 = 0;
  6748. int nb_line_inserted_tDBOutput_1 = 0;
  6749. int nb_line_deleted_tDBOutput_1 = 0;
  6750. int nb_line_rejected_tDBOutput_1 = 0;
  6751.  
  6752. int deletedCount_tDBOutput_1 = 0;
  6753. int updatedCount_tDBOutput_1 = 0;
  6754. int insertedCount_tDBOutput_1 = 0;
  6755. int rejectedCount_tDBOutput_1 = 0;
  6756. String dbschema_tDBOutput_1 = null;
  6757. String tableName_tDBOutput_1 = null;
  6758. boolean whetherReject_tDBOutput_1 = false;
  6759.  
  6760. java.util.Calendar calendar_tDBOutput_1 = java.util.Calendar
  6761. .getInstance();
  6762. long year1_tDBOutput_1 = TalendDate.parseDate("yyyy-MM-dd",
  6763. "0001-01-01").getTime();
  6764. long year2_tDBOutput_1 = TalendDate.parseDate("yyyy-MM-dd",
  6765. "1753-01-01").getTime();
  6766. long year10000_tDBOutput_1 = TalendDate.parseDate(
  6767. "yyyy-MM-dd HH:mm:ss", "9999-12-31 24:00:00").getTime();
  6768. long date_tDBOutput_1;
  6769.  
  6770. java.util.Calendar calendar_datetimeoffset_tDBOutput_1 = java.util.Calendar
  6771. .getInstance(java.util.TimeZone.getTimeZone("UTC"));
  6772.  
  6773. java.sql.Connection conn_tDBOutput_1 = null;
  6774. String dbUser_tDBOutput_1 = null;
  6775. dbschema_tDBOutput_1 = "";
  6776. String driverClass_tDBOutput_1 = "net.sourceforge.jtds.jdbc.Driver";
  6777.  
  6778. java.lang.Class.forName(driverClass_tDBOutput_1);
  6779. String port_tDBOutput_1 = "1433";
  6780. String dbname_tDBOutput_1 = "tym1";
  6781. String url_tDBOutput_1 = "jdbc:jtds:sqlserver://"
  6782. + "158.196.160.60";
  6783. if (!"".equals(port_tDBOutput_1)) {
  6784. url_tDBOutput_1 += ":" + "1433";
  6785. }
  6786. if (!"".equals(dbname_tDBOutput_1)) {
  6787. url_tDBOutput_1 += "//" + "tym1";
  6788.  
  6789. }
  6790. url_tDBOutput_1 += ";appName=" + projectName + ";" + "";
  6791. dbUser_tDBOutput_1 = "tym1";
  6792.  
  6793. final String decryptedPassword_tDBOutput_1 = routines.system.PasswordEncryptUtil
  6794. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  6795.  
  6796. String dbPwd_tDBOutput_1 = decryptedPassword_tDBOutput_1;
  6797. conn_tDBOutput_1 = java.sql.DriverManager.getConnection(
  6798. url_tDBOutput_1, dbUser_tDBOutput_1, dbPwd_tDBOutput_1);
  6799.  
  6800. resourceMap.put("conn_tDBOutput_1", conn_tDBOutput_1);
  6801.  
  6802. conn_tDBOutput_1.setAutoCommit(false);
  6803. int commitEvery_tDBOutput_1 = 10000;
  6804. int commitCounter_tDBOutput_1 = 0;
  6805.  
  6806. int batchSize_tDBOutput_1 = 10000;
  6807. int batchSizeCounter_tDBOutput_1 = 0;
  6808.  
  6809. if (dbschema_tDBOutput_1 == null
  6810. || dbschema_tDBOutput_1.trim().length() == 0) {
  6811. tableName_tDBOutput_1 = "FACT_snimek_dochazky";
  6812. } else {
  6813. tableName_tDBOutput_1 = dbschema_tDBOutput_1 + "].["
  6814. + "FACT_snimek_dochazky";
  6815. }
  6816. int count_tDBOutput_1 = 0;
  6817.  
  6818. String insert_tDBOutput_1 = "INSERT INTO ["
  6819. + tableName_tDBOutput_1
  6820. + "] ([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 (?,?,?,?,?,?,?,?,?,?)";
  6821. java.sql.PreparedStatement pstmt_tDBOutput_1 = conn_tDBOutput_1
  6822. .prepareStatement(insert_tDBOutput_1);
  6823. resourceMap.put("pstmt_tDBOutput_1", pstmt_tDBOutput_1);
  6824.  
  6825. /**
  6826. * [tDBOutput_1 begin ] stop
  6827. */
  6828.  
  6829. /**
  6830. * [tMap_2 begin ] start
  6831. */
  6832.  
  6833. ok_Hash.put("tMap_2", false);
  6834. start_Hash.put("tMap_2", System.currentTimeMillis());
  6835.  
  6836. currentComponent = "tMap_2";
  6837.  
  6838. if (execStat) {
  6839. if (resourceMap.get("inIterateVComp") == null) {
  6840.  
  6841. runStat.updateStatOnConnection("row4" + iterateId, 0, 0);
  6842.  
  6843. }
  6844. }
  6845.  
  6846. int tos_count_tMap_2 = 0;
  6847.  
  6848. // ###############################
  6849. // # Lookup's keys initialization
  6850.  
  6851. 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
  6852. .get("tHash_Lookup_row7"));
  6853.  
  6854. row7Struct row7HashKey = new row7Struct();
  6855. row7Struct row7Default = new row7Struct();
  6856.  
  6857. 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
  6858. .get("tHash_Lookup_zamestnanec"));
  6859.  
  6860. zamestnanecStruct zamestnanecHashKey = new zamestnanecStruct();
  6861. zamestnanecStruct zamestnanecDefault = new zamestnanecStruct();
  6862.  
  6863. 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
  6864. .get("tHash_Lookup_row11"));
  6865.  
  6866. row11Struct row11HashKey = new row11Struct();
  6867. row11Struct row11Default = new row11Struct();
  6868.  
  6869. 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
  6870. .get("tHash_Lookup_row5"));
  6871.  
  6872. row5Struct row5HashKey = new row5Struct();
  6873. row5Struct row5Default = new row5Struct();
  6874.  
  6875. 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
  6876. .get("tHash_Lookup_row9"));
  6877.  
  6878. row9Struct row9HashKey = new row9Struct();
  6879. row9Struct row9Default = new row9Struct();
  6880.  
  6881. 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
  6882. .get("tHash_Lookup_row8"));
  6883.  
  6884. row8Struct row8HashKey = new row8Struct();
  6885. row8Struct row8Default = new row8Struct();
  6886.  
  6887. 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
  6888. .get("tHash_Lookup_row6"));
  6889.  
  6890. row6Struct row6HashKey = new row6Struct();
  6891. row6Struct row6Default = new row6Struct();
  6892. // ###############################
  6893.  
  6894. // ###############################
  6895. // # Vars initialization
  6896. class Var__tMap_2__Struct {
  6897. }
  6898. Var__tMap_2__Struct Var__tMap_2 = new Var__tMap_2__Struct();
  6899. // ###############################
  6900.  
  6901. // ###############################
  6902. // # Outputs initialization
  6903. out2Struct out2_tmp = new out2Struct();
  6904. // ###############################
  6905.  
  6906. /**
  6907. * [tMap_2 begin ] stop
  6908. */
  6909.  
  6910. /**
  6911. * [tAggregateRow_1_AGGIN begin ] start
  6912. */
  6913.  
  6914. ok_Hash.put("tAggregateRow_1_AGGIN", false);
  6915. start_Hash.put("tAggregateRow_1_AGGIN",
  6916. System.currentTimeMillis());
  6917.  
  6918. currentVirtualComponent = "tAggregateRow_1";
  6919.  
  6920. currentComponent = "tAggregateRow_1_AGGIN";
  6921.  
  6922. int tos_count_tAggregateRow_1_AGGIN = 0;
  6923.  
  6924. java.util.Collection<AggOperationStruct_tAggregateRow_1> values_tAggregateRow_1 = hash_tAggregateRow_1
  6925. .values();
  6926.  
  6927. globalMap.put("tAggregateRow_1_NB_LINE",
  6928. values_tAggregateRow_1.size());
  6929.  
  6930. for (AggOperationStruct_tAggregateRow_1 aggregated_row_tAggregateRow_1 : values_tAggregateRow_1) { // G_AggR_600
  6931.  
  6932. /**
  6933. * [tAggregateRow_1_AGGIN begin ] stop
  6934. */
  6935.  
  6936. /**
  6937. * [tAggregateRow_1_AGGIN main ] start
  6938. */
  6939.  
  6940. currentVirtualComponent = "tAggregateRow_1";
  6941.  
  6942. currentComponent = "tAggregateRow_1_AGGIN";
  6943.  
  6944. row4.idzamestnanci = aggregated_row_tAggregateRow_1.idzamestnanci;
  6945.  
  6946. row4.datum_rok = aggregated_row_tAggregateRow_1.datum_rok;
  6947.  
  6948. row4.datum_mesic = aggregated_row_tAggregateRow_1.datum_mesic;
  6949. row4.doba_v_praci = aggregated_row_tAggregateRow_1.doba_v_praci_sum;
  6950. row4.prescas = aggregated_row_tAggregateRow_1.prescas_sum;
  6951.  
  6952. tos_count_tAggregateRow_1_AGGIN++;
  6953.  
  6954. /**
  6955. * [tAggregateRow_1_AGGIN main ] stop
  6956. */
  6957.  
  6958. /**
  6959. * [tAggregateRow_1_AGGIN process_data_begin ] start
  6960. */
  6961.  
  6962. currentVirtualComponent = "tAggregateRow_1";
  6963.  
  6964. currentComponent = "tAggregateRow_1_AGGIN";
  6965.  
  6966. /**
  6967. * [tAggregateRow_1_AGGIN process_data_begin ] stop
  6968. */
  6969.  
  6970. /**
  6971. * [tMap_2 main ] start
  6972. */
  6973.  
  6974. currentComponent = "tMap_2";
  6975.  
  6976. // row4
  6977. // row4
  6978.  
  6979. if (execStat) {
  6980. runStat.updateStatOnConnection("row4" + iterateId, 1, 1);
  6981. }
  6982.  
  6983. boolean hasCasePrimitiveKeyWithNull_tMap_2 = false;
  6984.  
  6985. // ###############################
  6986. // # Input tables (lookups)
  6987. boolean rejectedInnerJoin_tMap_2 = false;
  6988. boolean mainRowRejected_tMap_2 = false;
  6989.  
  6990. // /////////////////////////////////////////////
  6991. // Starting Lookup Table "row7"
  6992. // /////////////////////////////////////////////
  6993.  
  6994. boolean forceLooprow7 = false;
  6995.  
  6996. row7Struct row7ObjectFromLookup = null;
  6997.  
  6998. if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
  6999.  
  7000. hasCasePrimitiveKeyWithNull_tMap_2 = false;
  7001.  
  7002. Object exprKeyValue_row7__nazev_mesice = row4.datum_mesic;
  7003. if (exprKeyValue_row7__nazev_mesice == null) {
  7004. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  7005. } else {
  7006. row7HashKey.nazev_mesice = (short) (Short) exprKeyValue_row7__nazev_mesice;
  7007. }
  7008.  
  7009. Object exprKeyValue_row7__rok = row4.datum_rok;
  7010. if (exprKeyValue_row7__rok == null) {
  7011. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  7012. } else {
  7013. row7HashKey.rok = (short) (Short) exprKeyValue_row7__rok;
  7014. }
  7015.  
  7016. row7HashKey.hashCodeDirty = true;
  7017.  
  7018. if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
  7019.  
  7020. tHash_Lookup_row7.lookup(row7HashKey);
  7021.  
  7022. } // G_TM_M_091
  7023.  
  7024. } // G_TM_M_020
  7025.  
  7026. if (tHash_Lookup_row7 != null
  7027. && tHash_Lookup_row7.getCount(row7HashKey) > 1) { // G
  7028. // 071
  7029.  
  7030. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row7' and it contains more one result from keys : row7.nazev_mesice = '"
  7031. // + row7HashKey.nazev_mesice + "', row7.rok = '" +
  7032. // row7HashKey.rok + "'");
  7033. } // G 071
  7034.  
  7035. row7Struct row7 = null;
  7036.  
  7037. row7Struct fromLookup_row7 = null;
  7038. row7 = row7Default;
  7039.  
  7040. if (tHash_Lookup_row7 != null
  7041. && tHash_Lookup_row7.hasNext()) { // G 099
  7042.  
  7043. fromLookup_row7 = tHash_Lookup_row7.next();
  7044.  
  7045. } // G 099
  7046.  
  7047. if (fromLookup_row7 != null) {
  7048. row7 = fromLookup_row7;
  7049. }
  7050.  
  7051. // /////////////////////////////////////////////
  7052. // Starting Lookup Table "zamestnanec"
  7053. // /////////////////////////////////////////////
  7054.  
  7055. boolean forceLoopzamestnanec = false;
  7056.  
  7057. zamestnanecStruct zamestnanecObjectFromLookup = null;
  7058.  
  7059. if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
  7060.  
  7061. hasCasePrimitiveKeyWithNull_tMap_2 = false;
  7062.  
  7063. Object exprKeyValue_zamestnanec__cislo_zamestnance = row4.idzamestnanci;
  7064. if (exprKeyValue_zamestnanec__cislo_zamestnance == null) {
  7065. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  7066. } else {
  7067. zamestnanecHashKey.cislo_zamestnance = (int) (Integer) exprKeyValue_zamestnanec__cislo_zamestnance;
  7068. }
  7069.  
  7070. zamestnanecHashKey.hashCodeDirty = true;
  7071.  
  7072. if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
  7073.  
  7074. tHash_Lookup_zamestnanec.lookup(zamestnanecHashKey);
  7075.  
  7076. } // G_TM_M_091
  7077.  
  7078. if (hasCasePrimitiveKeyWithNull_tMap_2
  7079. || !tHash_Lookup_zamestnanec.hasNext()) { // G_TM_M_090
  7080.  
  7081. rejectedInnerJoin_tMap_2 = true;
  7082.  
  7083. } // G_TM_M_090
  7084.  
  7085. } // G_TM_M_020
  7086.  
  7087. if (tHash_Lookup_zamestnanec != null
  7088. && tHash_Lookup_zamestnanec
  7089. .getCount(zamestnanecHashKey) > 1) { // G
  7090. // 071
  7091.  
  7092. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'zamestnanec' and it contains more one result from keys : zamestnanec.cislo_zamestnance = '"
  7093. // + zamestnanecHashKey.cislo_zamestnance + "'");
  7094. } // G 071
  7095.  
  7096. zamestnanecStruct zamestnanec = null;
  7097.  
  7098. zamestnanecStruct fromLookup_zamestnanec = null;
  7099. zamestnanec = zamestnanecDefault;
  7100.  
  7101. if (tHash_Lookup_zamestnanec != null
  7102. && tHash_Lookup_zamestnanec.hasNext()) { // G 099
  7103.  
  7104. fromLookup_zamestnanec = tHash_Lookup_zamestnanec
  7105. .next();
  7106.  
  7107. } // G 099
  7108.  
  7109. if (fromLookup_zamestnanec != null) {
  7110. zamestnanec = fromLookup_zamestnanec;
  7111. }
  7112.  
  7113. // /////////////////////////////////////////////
  7114. // Starting Lookup Table "row11"
  7115. // /////////////////////////////////////////////
  7116.  
  7117. boolean forceLooprow11 = false;
  7118.  
  7119. row11Struct row11ObjectFromLookup = null;
  7120.  
  7121. if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
  7122.  
  7123. hasCasePrimitiveKeyWithNull_tMap_2 = false;
  7124.  
  7125. Object exprKeyValue_row11__idzamestnanci = row4.idzamestnanci;
  7126. if (exprKeyValue_row11__idzamestnanci == null) {
  7127. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  7128. } else {
  7129. row11HashKey.idzamestnanci = (int) (Integer) exprKeyValue_row11__idzamestnanci;
  7130. }
  7131.  
  7132. Object exprKeyValue_row11__mesic = row4.datum_mesic;
  7133. if (exprKeyValue_row11__mesic == null) {
  7134. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  7135. } else {
  7136. row11HashKey.mesic = (short) (Short) exprKeyValue_row11__mesic;
  7137. }
  7138.  
  7139. Object exprKeyValue_row11__rok = row4.datum_rok;
  7140. if (exprKeyValue_row11__rok == null) {
  7141. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  7142. } else {
  7143. row11HashKey.rok = (short) (Short) exprKeyValue_row11__rok;
  7144. }
  7145.  
  7146. row11HashKey.hashCodeDirty = true;
  7147.  
  7148. if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
  7149.  
  7150. tHash_Lookup_row11.lookup(row11HashKey);
  7151.  
  7152. } // G_TM_M_091
  7153.  
  7154. } // G_TM_M_020
  7155.  
  7156. if (tHash_Lookup_row11 != null
  7157. && tHash_Lookup_row11.getCount(row11HashKey) > 1) { // G
  7158. // 071
  7159.  
  7160. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row11' and it contains more one result from keys : row11.idzamestnanci = '"
  7161. // + row11HashKey.idzamestnanci + "', row11.mesic = '" +
  7162. // row11HashKey.mesic + "', row11.rok = '" +
  7163. // row11HashKey.rok + "'");
  7164. } // G 071
  7165.  
  7166. row11Struct row11 = null;
  7167.  
  7168. row11Struct fromLookup_row11 = null;
  7169. row11 = row11Default;
  7170.  
  7171. if (tHash_Lookup_row11 != null
  7172. && tHash_Lookup_row11.hasNext()) { // G 099
  7173.  
  7174. fromLookup_row11 = tHash_Lookup_row11.next();
  7175.  
  7176. } // G 099
  7177.  
  7178. if (fromLookup_row11 != null) {
  7179. row11 = fromLookup_row11;
  7180. }
  7181.  
  7182. // /////////////////////////////////////////////
  7183. // Starting Lookup Table "row5"
  7184. // /////////////////////////////////////////////
  7185.  
  7186. boolean forceLooprow5 = false;
  7187.  
  7188. row5Struct row5ObjectFromLookup = null;
  7189.  
  7190. if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
  7191.  
  7192. hasCasePrimitiveKeyWithNull_tMap_2 = false;
  7193.  
  7194. Object exprKeyValue_row5__idzamestnanci = row4.idzamestnanci;
  7195. if (exprKeyValue_row5__idzamestnanci == null) {
  7196. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  7197. } else {
  7198. row5HashKey.idzamestnanci = (int) (Integer) exprKeyValue_row5__idzamestnanci;
  7199. }
  7200.  
  7201. row5HashKey.rok = row4.datum_rok;
  7202.  
  7203. row5HashKey.hashCodeDirty = true;
  7204.  
  7205. if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
  7206.  
  7207. tHash_Lookup_row5.lookup(row5HashKey);
  7208.  
  7209. } // G_TM_M_091
  7210.  
  7211. if (hasCasePrimitiveKeyWithNull_tMap_2
  7212. || !tHash_Lookup_row5.hasNext()) { // G_TM_M_090
  7213.  
  7214. rejectedInnerJoin_tMap_2 = true;
  7215.  
  7216. } // G_TM_M_090
  7217.  
  7218. } // G_TM_M_020
  7219.  
  7220. if (tHash_Lookup_row5 != null
  7221. && tHash_Lookup_row5.getCount(row5HashKey) > 1) { // G
  7222. // 071
  7223.  
  7224. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row5' and it contains more one result from keys : row5.idzamestnanci = '"
  7225. // + row5HashKey.idzamestnanci + "', row5.rok = '" +
  7226. // row5HashKey.rok + "'");
  7227. } // G 071
  7228.  
  7229. row5Struct row5 = null;
  7230.  
  7231. row5Struct fromLookup_row5 = null;
  7232. row5 = row5Default;
  7233.  
  7234. if (tHash_Lookup_row5 != null
  7235. && tHash_Lookup_row5.hasNext()) { // G 099
  7236.  
  7237. fromLookup_row5 = tHash_Lookup_row5.next();
  7238.  
  7239. } // G 099
  7240.  
  7241. if (fromLookup_row5 != null) {
  7242. row5 = fromLookup_row5;
  7243. }
  7244.  
  7245. // /////////////////////////////////////////////
  7246. // Starting Lookup Table "row9"
  7247. // /////////////////////////////////////////////
  7248.  
  7249. boolean forceLooprow9 = false;
  7250.  
  7251. row9Struct row9ObjectFromLookup = null;
  7252.  
  7253. if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
  7254.  
  7255. hasCasePrimitiveKeyWithNull_tMap_2 = false;
  7256.  
  7257. Object exprKeyValue_row9__cislo_pracoviste = zamestnanec.idpracoviste;
  7258. if (exprKeyValue_row9__cislo_pracoviste == null) {
  7259. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  7260. } else {
  7261. row9HashKey.cislo_pracoviste = (int) (Integer) exprKeyValue_row9__cislo_pracoviste;
  7262. }
  7263.  
  7264. row9HashKey.hashCodeDirty = true;
  7265.  
  7266. if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
  7267.  
  7268. tHash_Lookup_row9.lookup(row9HashKey);
  7269.  
  7270. } // G_TM_M_091
  7271.  
  7272. if (hasCasePrimitiveKeyWithNull_tMap_2
  7273. || !tHash_Lookup_row9.hasNext()) { // G_TM_M_090
  7274.  
  7275. rejectedInnerJoin_tMap_2 = true;
  7276.  
  7277. } // G_TM_M_090
  7278.  
  7279. } // G_TM_M_020
  7280.  
  7281. if (tHash_Lookup_row9 != null
  7282. && tHash_Lookup_row9.getCount(row9HashKey) > 1) { // G
  7283. // 071
  7284.  
  7285. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row9' and it contains more one result from keys : row9.cislo_pracoviste = '"
  7286. // + row9HashKey.cislo_pracoviste + "'");
  7287. } // G 071
  7288.  
  7289. row9Struct row9 = null;
  7290.  
  7291. row9Struct fromLookup_row9 = null;
  7292. row9 = row9Default;
  7293.  
  7294. if (tHash_Lookup_row9 != null
  7295. && tHash_Lookup_row9.hasNext()) { // G 099
  7296.  
  7297. fromLookup_row9 = tHash_Lookup_row9.next();
  7298.  
  7299. } // G 099
  7300.  
  7301. if (fromLookup_row9 != null) {
  7302. row9 = fromLookup_row9;
  7303. }
  7304.  
  7305. // /////////////////////////////////////////////
  7306. // Starting Lookup Table "row8"
  7307. // /////////////////////////////////////////////
  7308.  
  7309. boolean forceLooprow8 = false;
  7310.  
  7311. row8Struct row8ObjectFromLookup = null;
  7312.  
  7313. if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
  7314.  
  7315. hasCasePrimitiveKeyWithNull_tMap_2 = false;
  7316.  
  7317. row8HashKey.nazev_profese = zamestnanec.nazev_profese;
  7318.  
  7319. row8HashKey.hashCodeDirty = true;
  7320.  
  7321. tHash_Lookup_row8.lookup(row8HashKey);
  7322.  
  7323. if (!tHash_Lookup_row8.hasNext()) { // G_TM_M_090
  7324.  
  7325. rejectedInnerJoin_tMap_2 = true;
  7326.  
  7327. } // G_TM_M_090
  7328.  
  7329. } // G_TM_M_020
  7330.  
  7331. if (tHash_Lookup_row8 != null
  7332. && tHash_Lookup_row8.getCount(row8HashKey) > 1) { // G
  7333. // 071
  7334.  
  7335. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row8' and it contains more one result from keys : row8.nazev_profese = '"
  7336. // + row8HashKey.nazev_profese + "'");
  7337. } // G 071
  7338.  
  7339. row8Struct row8 = null;
  7340.  
  7341. row8Struct fromLookup_row8 = null;
  7342. row8 = row8Default;
  7343.  
  7344. if (tHash_Lookup_row8 != null
  7345. && tHash_Lookup_row8.hasNext()) { // G 099
  7346.  
  7347. fromLookup_row8 = tHash_Lookup_row8.next();
  7348.  
  7349. } // G 099
  7350.  
  7351. if (fromLookup_row8 != null) {
  7352. row8 = fromLookup_row8;
  7353. }
  7354.  
  7355. // /////////////////////////////////////////////
  7356. // Starting Lookup Table "row6"
  7357. // /////////////////////////////////////////////
  7358.  
  7359. boolean forceLooprow6 = false;
  7360.  
  7361. row6Struct row6ObjectFromLookup = null;
  7362.  
  7363. if (!rejectedInnerJoin_tMap_2) { // G_TM_M_020
  7364.  
  7365. hasCasePrimitiveKeyWithNull_tMap_2 = false;
  7366.  
  7367. Object exprKeyValue_row6__idzamestnanci = zamestnanec.idzamestnanci;
  7368. if (exprKeyValue_row6__idzamestnanci == null) {
  7369. hasCasePrimitiveKeyWithNull_tMap_2 = true;
  7370. } else {
  7371. row6HashKey.idzamestnanci = (int) (Integer) exprKeyValue_row6__idzamestnanci;
  7372. }
  7373.  
  7374. row6HashKey.dovolena_rok = row4.datum_rok;
  7375.  
  7376. row6HashKey.hashCodeDirty = true;
  7377.  
  7378. if (!hasCasePrimitiveKeyWithNull_tMap_2) { // G_TM_M_091
  7379.  
  7380. tHash_Lookup_row6.lookup(row6HashKey);
  7381.  
  7382. } // G_TM_M_091
  7383.  
  7384. } // G_TM_M_020
  7385.  
  7386. if (tHash_Lookup_row6 != null
  7387. && tHash_Lookup_row6.getCount(row6HashKey) > 1) { // G
  7388. // 071
  7389.  
  7390. // System.out.println("WARNING: UNIQUE MATCH is configured for the lookup 'row6' and it contains more one result from keys : row6.idzamestnanci = '"
  7391. // + row6HashKey.idzamestnanci +
  7392. // "', row6.dovolena_rok = '" + row6HashKey.dovolena_rok
  7393. // + "'");
  7394. } // G 071
  7395.  
  7396. row6Struct row6 = null;
  7397.  
  7398. row6Struct fromLookup_row6 = null;
  7399. row6 = row6Default;
  7400.  
  7401. if (tHash_Lookup_row6 != null
  7402. && tHash_Lookup_row6.hasNext()) { // G 099
  7403.  
  7404. fromLookup_row6 = tHash_Lookup_row6.next();
  7405.  
  7406. } // G 099
  7407.  
  7408. if (fromLookup_row6 != null) {
  7409. row6 = fromLookup_row6;
  7410. }
  7411.  
  7412. // ###############################
  7413. { // start of Var scope
  7414.  
  7415. // ###############################
  7416. // # Vars tables
  7417.  
  7418. Var__tMap_2__Struct Var = Var__tMap_2;// ###############################
  7419. // ###############################
  7420. // # Output tables
  7421.  
  7422. out2 = null;
  7423.  
  7424. if (!rejectedInnerJoin_tMap_2) {
  7425.  
  7426. // # Output table : 'out2'
  7427. out2_tmp.odpracovano_hodin = BigDecimal
  7428. .valueOf(row4.doba_v_praci / 3600);
  7429. out2_tmp.prescasy = BigDecimal
  7430. .valueOf(row4.prescas / 3600);
  7431. out2_tmp.celkova_mzda = BigDecimal
  7432. .valueOf(zamestnanec.hodinova_sazba
  7433. * (row4.doba_v_praci / 3600)
  7434. + zamestnanec.osobni_priplatek
  7435. + (Relational.ISNULL(row11.odmena) ? 0
  7436. : row11.odmena));
  7437. out2_tmp.dovolena_vybrana = BigDecimal
  7438. .valueOf(row6.dovolena_mesic == row4.datum_mesic ? row6.dovolena_cerpani
  7439. : 0);
  7440. out2_tmp.dovolena_zustatek = BigDecimal
  7441. .valueOf(row4.datum_mesic >= row6.dovolena_mesic ? row5.dovolena_celkem
  7442. - row6.dovolena_cerpani
  7443. : row5.dovolena_celkem);
  7444. out2_tmp.dovolena_celkem = row5.dovolena_celkem;
  7445. out2_tmp.DIM_zamestnanci_idzamestnanci = zamestnanec.idzamestnanci;
  7446. out2_tmp.DIM_pracoviste_idpracoviste = row9.idpracoviste;
  7447. out2_tmp.DIM_kalendar_idkalendare = row7.idkalendare;
  7448. out2_tmp.DIM_mzdove_sazby_idsazby = row8.idsazby;
  7449. out2 = out2_tmp;
  7450. } // closing inner join bracket (2)
  7451. // ###############################
  7452.  
  7453. } // end of Var scope
  7454.  
  7455. rejectedInnerJoin_tMap_2 = false;
  7456.  
  7457. tos_count_tMap_2++;
  7458.  
  7459. /**
  7460. * [tMap_2 main ] stop
  7461. */
  7462.  
  7463. /**
  7464. * [tMap_2 process_data_begin ] start
  7465. */
  7466.  
  7467. currentComponent = "tMap_2";
  7468.  
  7469. /**
  7470. * [tMap_2 process_data_begin ] stop
  7471. */
  7472. // Start of branch "out2"
  7473. if (out2 != null) {
  7474.  
  7475. /**
  7476. * [tDBOutput_1 main ] start
  7477. */
  7478.  
  7479. currentComponent = "tDBOutput_1";
  7480.  
  7481. // out2
  7482. // out2
  7483.  
  7484. if (execStat) {
  7485. runStat.updateStatOnConnection("out2" + iterateId,
  7486. 1, 1);
  7487. }
  7488.  
  7489. whetherReject_tDBOutput_1 = false;
  7490. pstmt_tDBOutput_1.setBigDecimal(1,
  7491. out2.odpracovano_hodin);
  7492.  
  7493. pstmt_tDBOutput_1.setBigDecimal(2, out2.prescasy);
  7494.  
  7495. pstmt_tDBOutput_1.setBigDecimal(3, out2.celkova_mzda);
  7496.  
  7497. pstmt_tDBOutput_1.setBigDecimal(4,
  7498. out2.dovolena_vybrana);
  7499.  
  7500. pstmt_tDBOutput_1.setBigDecimal(5,
  7501. out2.dovolena_zustatek);
  7502.  
  7503. if (out2.dovolena_celkem == null) {
  7504. pstmt_tDBOutput_1
  7505. .setNull(6, java.sql.Types.INTEGER);
  7506. } else {
  7507. pstmt_tDBOutput_1.setInt(6, out2.dovolena_celkem);
  7508. }
  7509.  
  7510. if (out2.DIM_zamestnanci_idzamestnanci == null) {
  7511. pstmt_tDBOutput_1
  7512. .setNull(7, java.sql.Types.INTEGER);
  7513. } else {
  7514. pstmt_tDBOutput_1.setInt(7,
  7515. out2.DIM_zamestnanci_idzamestnanci);
  7516. }
  7517.  
  7518. if (out2.DIM_pracoviste_idpracoviste == null) {
  7519. pstmt_tDBOutput_1
  7520. .setNull(8, java.sql.Types.INTEGER);
  7521. } else {
  7522. pstmt_tDBOutput_1.setInt(8,
  7523. out2.DIM_pracoviste_idpracoviste);
  7524. }
  7525.  
  7526. if (out2.DIM_kalendar_idkalendare == null) {
  7527. pstmt_tDBOutput_1
  7528. .setNull(9, java.sql.Types.INTEGER);
  7529. } else {
  7530. pstmt_tDBOutput_1.setInt(9,
  7531. out2.DIM_kalendar_idkalendare);
  7532. }
  7533.  
  7534. if (out2.DIM_mzdove_sazby_idsazby == null) {
  7535. pstmt_tDBOutput_1.setNull(10,
  7536. java.sql.Types.INTEGER);
  7537. } else {
  7538. pstmt_tDBOutput_1.setInt(10,
  7539. out2.DIM_mzdove_sazby_idsazby);
  7540. }
  7541.  
  7542. pstmt_tDBOutput_1.addBatch();
  7543. nb_line_tDBOutput_1++;
  7544.  
  7545. batchSizeCounter_tDBOutput_1++;
  7546.  
  7547. // ////////batch execute by batch size///////
  7548. class LimitBytesHelper_tDBOutput_1 {
  7549. public int limitBytePart1(int counter,
  7550. java.sql.PreparedStatement pstmt_tDBOutput_1)
  7551. throws Exception {
  7552. try {
  7553.  
  7554. for (int countEach_tDBOutput_1 : pstmt_tDBOutput_1
  7555. .executeBatch()) {
  7556. if (countEach_tDBOutput_1 == -2
  7557. || countEach_tDBOutput_1 == -3) {
  7558. break;
  7559. }
  7560. counter += countEach_tDBOutput_1;
  7561. }
  7562.  
  7563. } catch (java.sql.BatchUpdateException e) {
  7564.  
  7565. int countSum_tDBOutput_1 = 0;
  7566. for (int countEach_tDBOutput_1 : e
  7567. .getUpdateCounts()) {
  7568. counter += (countEach_tDBOutput_1 < 0 ? 0
  7569. : countEach_tDBOutput_1);
  7570. }
  7571.  
  7572. System.err.println(e.getMessage());
  7573.  
  7574. }
  7575. return counter;
  7576. }
  7577.  
  7578. public int limitBytePart2(int counter,
  7579. java.sql.PreparedStatement pstmt_tDBOutput_1)
  7580. throws Exception {
  7581. try {
  7582.  
  7583. for (int countEach_tDBOutput_1 : pstmt_tDBOutput_1
  7584. .executeBatch()) {
  7585. if (countEach_tDBOutput_1 == -2
  7586. || countEach_tDBOutput_1 == -3) {
  7587. break;
  7588. }
  7589. counter += countEach_tDBOutput_1;
  7590. }
  7591.  
  7592. } catch (java.sql.BatchUpdateException e) {
  7593.  
  7594. for (int countEach_tDBOutput_1 : e
  7595. .getUpdateCounts()) {
  7596. counter += (countEach_tDBOutput_1 < 0 ? 0
  7597. : countEach_tDBOutput_1);
  7598. }
  7599.  
  7600. System.err.println(e.getMessage());
  7601.  
  7602. }
  7603. return counter;
  7604. }
  7605. }
  7606. if ((batchSize_tDBOutput_1 > 0)
  7607. && (batchSize_tDBOutput_1 <= batchSizeCounter_tDBOutput_1)) {
  7608.  
  7609. insertedCount_tDBOutput_1 = new LimitBytesHelper_tDBOutput_1()
  7610. .limitBytePart1(insertedCount_tDBOutput_1,
  7611. pstmt_tDBOutput_1);
  7612.  
  7613. batchSizeCounter_tDBOutput_1 = 0;
  7614. }
  7615.  
  7616. // //////////commit every////////////
  7617.  
  7618. commitCounter_tDBOutput_1++;
  7619. if (commitEvery_tDBOutput_1 <= commitCounter_tDBOutput_1) {
  7620. if ((batchSize_tDBOutput_1 > 0)
  7621. && (batchSizeCounter_tDBOutput_1 > 0)) {
  7622.  
  7623. insertedCount_tDBOutput_1 = new LimitBytesHelper_tDBOutput_1()
  7624. .limitBytePart1(
  7625. insertedCount_tDBOutput_1,
  7626. pstmt_tDBOutput_1);
  7627.  
  7628. batchSizeCounter_tDBOutput_1 = 0;
  7629. }
  7630.  
  7631. conn_tDBOutput_1.commit();
  7632.  
  7633. commitCounter_tDBOutput_1 = 0;
  7634. }
  7635.  
  7636. tos_count_tDBOutput_1++;
  7637.  
  7638. /**
  7639. * [tDBOutput_1 main ] stop
  7640. */
  7641.  
  7642. /**
  7643. * [tDBOutput_1 process_data_begin ] start
  7644. */
  7645.  
  7646. currentComponent = "tDBOutput_1";
  7647.  
  7648. /**
  7649. * [tDBOutput_1 process_data_begin ] stop
  7650. */
  7651.  
  7652. /**
  7653. * [tDBOutput_1 process_data_end ] start
  7654. */
  7655.  
  7656. currentComponent = "tDBOutput_1";
  7657.  
  7658. /**
  7659. * [tDBOutput_1 process_data_end ] stop
  7660. */
  7661.  
  7662. } // End of branch "out2"
  7663.  
  7664. /**
  7665. * [tMap_2 process_data_end ] start
  7666. */
  7667.  
  7668. currentComponent = "tMap_2";
  7669.  
  7670. /**
  7671. * [tMap_2 process_data_end ] stop
  7672. */
  7673.  
  7674. /**
  7675. * [tAggregateRow_1_AGGIN process_data_end ] start
  7676. */
  7677.  
  7678. currentVirtualComponent = "tAggregateRow_1";
  7679.  
  7680. currentComponent = "tAggregateRow_1_AGGIN";
  7681.  
  7682. /**
  7683. * [tAggregateRow_1_AGGIN process_data_end ] stop
  7684. */
  7685.  
  7686. /**
  7687. * [tAggregateRow_1_AGGIN end ] start
  7688. */
  7689.  
  7690. currentVirtualComponent = "tAggregateRow_1";
  7691.  
  7692. currentComponent = "tAggregateRow_1_AGGIN";
  7693.  
  7694. } // G_AggR_600
  7695.  
  7696. ok_Hash.put("tAggregateRow_1_AGGIN", true);
  7697. end_Hash.put("tAggregateRow_1_AGGIN",
  7698. System.currentTimeMillis());
  7699.  
  7700. /**
  7701. * [tAggregateRow_1_AGGIN end ] stop
  7702. */
  7703.  
  7704. /**
  7705. * [tMap_2 end ] start
  7706. */
  7707.  
  7708. currentComponent = "tMap_2";
  7709.  
  7710. // ###############################
  7711. // # Lookup hashes releasing
  7712. if (tHash_Lookup_row7 != null) {
  7713. tHash_Lookup_row7.endGet();
  7714. }
  7715. globalMap.remove("tHash_Lookup_row7");
  7716.  
  7717. if (tHash_Lookup_zamestnanec != null) {
  7718. tHash_Lookup_zamestnanec.endGet();
  7719. }
  7720. globalMap.remove("tHash_Lookup_zamestnanec");
  7721.  
  7722. if (tHash_Lookup_row11 != null) {
  7723. tHash_Lookup_row11.endGet();
  7724. }
  7725. globalMap.remove("tHash_Lookup_row11");
  7726.  
  7727. if (tHash_Lookup_row5 != null) {
  7728. tHash_Lookup_row5.endGet();
  7729. }
  7730. globalMap.remove("tHash_Lookup_row5");
  7731.  
  7732. if (tHash_Lookup_row9 != null) {
  7733. tHash_Lookup_row9.endGet();
  7734. }
  7735. globalMap.remove("tHash_Lookup_row9");
  7736.  
  7737. if (tHash_Lookup_row8 != null) {
  7738. tHash_Lookup_row8.endGet();
  7739. }
  7740. globalMap.remove("tHash_Lookup_row8");
  7741.  
  7742. if (tHash_Lookup_row6 != null) {
  7743. tHash_Lookup_row6.endGet();
  7744. }
  7745. globalMap.remove("tHash_Lookup_row6");
  7746.  
  7747. // ###############################
  7748.  
  7749. if (execStat) {
  7750. if (resourceMap.get("inIterateVComp") == null
  7751. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  7752. runStat.updateStatOnConnection("row4" + iterateId, 2, 0);
  7753. }
  7754. }
  7755.  
  7756. ok_Hash.put("tMap_2", true);
  7757. end_Hash.put("tMap_2", System.currentTimeMillis());
  7758.  
  7759. /**
  7760. * [tMap_2 end ] stop
  7761. */
  7762.  
  7763. /**
  7764. * [tDBOutput_1 end ] start
  7765. */
  7766.  
  7767. currentComponent = "tDBOutput_1";
  7768.  
  7769. try {
  7770. int countSum_tDBOutput_1 = 0;
  7771. if (pstmt_tDBOutput_1 != null
  7772. && batchSizeCounter_tDBOutput_1 > 0) {
  7773.  
  7774. for (int countEach_tDBOutput_1 : pstmt_tDBOutput_1
  7775. .executeBatch()) {
  7776. if (countEach_tDBOutput_1 == -2
  7777. || countEach_tDBOutput_1 == -3) {
  7778. break;
  7779. }
  7780. countSum_tDBOutput_1 += countEach_tDBOutput_1;
  7781. }
  7782.  
  7783. }
  7784.  
  7785. insertedCount_tDBOutput_1 += countSum_tDBOutput_1;
  7786.  
  7787. } catch (java.sql.BatchUpdateException e) {
  7788.  
  7789. int countSum_tDBOutput_1 = 0;
  7790. for (int countEach_tDBOutput_1 : e.getUpdateCounts()) {
  7791. countSum_tDBOutput_1 += (countEach_tDBOutput_1 < 0 ? 0
  7792. : countEach_tDBOutput_1);
  7793. }
  7794.  
  7795. insertedCount_tDBOutput_1 += countSum_tDBOutput_1;
  7796.  
  7797. System.err.println(e.getMessage());
  7798.  
  7799. }
  7800. if (pstmt_tDBOutput_1 != null) {
  7801.  
  7802. pstmt_tDBOutput_1.close();
  7803. resourceMap.remove("pstmt_tDBOutput_1");
  7804.  
  7805. }
  7806. resourceMap.put("statementClosed_tDBOutput_1", true);
  7807. conn_tDBOutput_1.commit();
  7808.  
  7809. conn_tDBOutput_1.close();
  7810. resourceMap.put("finish_tDBOutput_1", true);
  7811.  
  7812. nb_line_deleted_tDBOutput_1 = nb_line_deleted_tDBOutput_1
  7813. + deletedCount_tDBOutput_1;
  7814. nb_line_update_tDBOutput_1 = nb_line_update_tDBOutput_1
  7815. + updatedCount_tDBOutput_1;
  7816. nb_line_inserted_tDBOutput_1 = nb_line_inserted_tDBOutput_1
  7817. + insertedCount_tDBOutput_1;
  7818. nb_line_rejected_tDBOutput_1 = nb_line_rejected_tDBOutput_1
  7819. + rejectedCount_tDBOutput_1;
  7820.  
  7821. globalMap.put("tDBOutput_1_NB_LINE", nb_line_tDBOutput_1);
  7822. globalMap.put("tDBOutput_1_NB_LINE_UPDATED",
  7823. nb_line_update_tDBOutput_1);
  7824. globalMap.put("tDBOutput_1_NB_LINE_INSERTED",
  7825. nb_line_inserted_tDBOutput_1);
  7826. globalMap.put("tDBOutput_1_NB_LINE_DELETED",
  7827. nb_line_deleted_tDBOutput_1);
  7828. globalMap.put("tDBOutput_1_NB_LINE_REJECTED",
  7829. nb_line_rejected_tDBOutput_1);
  7830.  
  7831. if (execStat) {
  7832. if (resourceMap.get("inIterateVComp") == null
  7833. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  7834. runStat.updateStatOnConnection("out2" + iterateId, 2, 0);
  7835. }
  7836. }
  7837.  
  7838. ok_Hash.put("tDBOutput_1", true);
  7839. end_Hash.put("tDBOutput_1", System.currentTimeMillis());
  7840.  
  7841. /**
  7842. * [tDBOutput_1 end ] stop
  7843. */
  7844.  
  7845. }// end the resume
  7846.  
  7847. } catch (java.lang.Exception e) {
  7848.  
  7849. TalendException te = new TalendException(e, currentComponent,
  7850. globalMap);
  7851.  
  7852. te.setVirtualComponentName(currentVirtualComponent);
  7853.  
  7854. throw te;
  7855. } catch (java.lang.Error error) {
  7856.  
  7857. runStat.stopThreadStat();
  7858.  
  7859. throw error;
  7860. } finally {
  7861.  
  7862. // free memory for "tMap_2"
  7863. globalMap.remove("tHash_Lookup_zamestnanec");
  7864.  
  7865. // free memory for "tMap_2"
  7866. globalMap.remove("tHash_Lookup_row11");
  7867.  
  7868. // free memory for "tMap_2"
  7869. globalMap.remove("tHash_Lookup_row5");
  7870.  
  7871. // free memory for "tMap_2"
  7872. globalMap.remove("tHash_Lookup_row6");
  7873.  
  7874. // free memory for "tMap_2"
  7875. globalMap.remove("tHash_Lookup_row7");
  7876.  
  7877. // free memory for "tMap_2"
  7878. globalMap.remove("tHash_Lookup_row8");
  7879.  
  7880. // free memory for "tMap_2"
  7881. globalMap.remove("tHash_Lookup_row9");
  7882.  
  7883. // free memory for "tAggregateRow_1_AGGIN"
  7884. globalMap.remove("tAggregateRow_1");
  7885.  
  7886. try {
  7887.  
  7888. /**
  7889. * [tDBInput_6 finally ] start
  7890. */
  7891.  
  7892. currentComponent = "tDBInput_6";
  7893.  
  7894. /**
  7895. * [tDBInput_6 finally ] stop
  7896. */
  7897.  
  7898. /**
  7899. * [tAggregateRow_1_AGGOUT finally ] start
  7900. */
  7901.  
  7902. currentVirtualComponent = "tAggregateRow_1";
  7903.  
  7904. currentComponent = "tAggregateRow_1_AGGOUT";
  7905.  
  7906. /**
  7907. * [tAggregateRow_1_AGGOUT finally ] stop
  7908. */
  7909.  
  7910. /**
  7911. * [tAggregateRow_1_AGGIN finally ] start
  7912. */
  7913.  
  7914. currentVirtualComponent = "tAggregateRow_1";
  7915.  
  7916. currentComponent = "tAggregateRow_1_AGGIN";
  7917.  
  7918. /**
  7919. * [tAggregateRow_1_AGGIN finally ] stop
  7920. */
  7921.  
  7922. /**
  7923. * [tMap_2 finally ] start
  7924. */
  7925.  
  7926. currentComponent = "tMap_2";
  7927.  
  7928. /**
  7929. * [tMap_2 finally ] stop
  7930. */
  7931.  
  7932. /**
  7933. * [tDBOutput_1 finally ] start
  7934. */
  7935.  
  7936. currentComponent = "tDBOutput_1";
  7937.  
  7938. try {
  7939. if (resourceMap.get("statementClosed_tDBOutput_1") == null) {
  7940. java.sql.PreparedStatement pstmtToClose_tDBOutput_1 = null;
  7941. if ((pstmtToClose_tDBOutput_1 = (java.sql.PreparedStatement) resourceMap
  7942. .remove("pstmt_tDBOutput_1")) != null) {
  7943. pstmtToClose_tDBOutput_1.close();
  7944. }
  7945. }
  7946. } finally {
  7947. if (resourceMap.get("finish_tDBOutput_1") == null) {
  7948. java.sql.Connection ctn_tDBOutput_1 = null;
  7949. if ((ctn_tDBOutput_1 = (java.sql.Connection) resourceMap
  7950. .get("conn_tDBOutput_1")) != null) {
  7951. try {
  7952. ctn_tDBOutput_1.close();
  7953. } catch (java.sql.SQLException sqlEx_tDBOutput_1) {
  7954. String errorMessage_tDBOutput_1 = "failed to close the connection in tDBOutput_1 :"
  7955. + sqlEx_tDBOutput_1.getMessage();
  7956. System.err.println(errorMessage_tDBOutput_1);
  7957. }
  7958. }
  7959. }
  7960. }
  7961.  
  7962. /**
  7963. * [tDBOutput_1 finally ] stop
  7964. */
  7965.  
  7966. } catch (java.lang.Exception e) {
  7967. // ignore
  7968. } catch (java.lang.Error error) {
  7969. // ignore
  7970. }
  7971. resourceMap = null;
  7972. }
  7973.  
  7974. globalMap.put("tDBInput_6_SUBPROCESS_STATE", 1);
  7975. }
  7976.  
  7977. public static class row6Struct implements
  7978. routines.system.IPersistableComparableLookupRow<row6Struct> {
  7979. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  7980. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  7981. protected static final int DEFAULT_HASHCODE = 1;
  7982. protected static final int PRIME = 31;
  7983. protected int hashCode = DEFAULT_HASHCODE;
  7984. public boolean hashCodeDirty = true;
  7985.  
  7986. public String loopKey;
  7987.  
  7988. public int idzamestnanci;
  7989.  
  7990. public int getIdzamestnanci() {
  7991. return this.idzamestnanci;
  7992. }
  7993.  
  7994. public Short dovolena_mesic;
  7995.  
  7996. public Short getDovolena_mesic() {
  7997. return this.dovolena_mesic;
  7998. }
  7999.  
  8000. public Short dovolena_rok;
  8001.  
  8002. public Short getDovolena_rok() {
  8003. return this.dovolena_rok;
  8004. }
  8005.  
  8006. public Integer dovolena_cerpani;
  8007.  
  8008. public Integer getDovolena_cerpani() {
  8009. return this.dovolena_cerpani;
  8010. }
  8011.  
  8012. @Override
  8013. public int hashCode() {
  8014. if (this.hashCodeDirty) {
  8015. final int prime = PRIME;
  8016. int result = DEFAULT_HASHCODE;
  8017.  
  8018. result = prime * result + (int) this.idzamestnanci;
  8019.  
  8020. result = prime
  8021. * result
  8022. + ((this.dovolena_rok == null) ? 0 : this.dovolena_rok
  8023. .hashCode());
  8024.  
  8025. this.hashCode = result;
  8026. this.hashCodeDirty = false;
  8027. }
  8028. return this.hashCode;
  8029. }
  8030.  
  8031. @Override
  8032. public boolean equals(Object obj) {
  8033. if (this == obj)
  8034. return true;
  8035. if (obj == null)
  8036. return false;
  8037. if (getClass() != obj.getClass())
  8038. return false;
  8039. final row6Struct other = (row6Struct) obj;
  8040.  
  8041. if (this.idzamestnanci != other.idzamestnanci)
  8042. return false;
  8043.  
  8044. if (this.dovolena_rok == null) {
  8045. if (other.dovolena_rok != null)
  8046. return false;
  8047.  
  8048. } else if (!this.dovolena_rok.equals(other.dovolena_rok))
  8049.  
  8050. return false;
  8051.  
  8052. return true;
  8053. }
  8054.  
  8055. public void copyDataTo(row6Struct other) {
  8056.  
  8057. other.idzamestnanci = this.idzamestnanci;
  8058. other.dovolena_mesic = this.dovolena_mesic;
  8059. other.dovolena_rok = this.dovolena_rok;
  8060. other.dovolena_cerpani = this.dovolena_cerpani;
  8061.  
  8062. }
  8063.  
  8064. public void copyKeysDataTo(row6Struct other) {
  8065.  
  8066. other.idzamestnanci = this.idzamestnanci;
  8067. other.dovolena_rok = this.dovolena_rok;
  8068.  
  8069. }
  8070.  
  8071. private Integer readInteger(DataInputStream dis, ObjectInputStream ois)
  8072. throws IOException {
  8073. Integer intReturn;
  8074. int length = 0;
  8075. length = dis.readByte();
  8076. if (length == -1) {
  8077. intReturn = null;
  8078. } else {
  8079. intReturn = dis.readInt();
  8080. }
  8081. return intReturn;
  8082. }
  8083.  
  8084. private void writeInteger(Integer intNum, DataOutputStream dos,
  8085. ObjectOutputStream oos) throws IOException {
  8086. if (intNum == null) {
  8087. dos.writeByte(-1);
  8088. } else {
  8089. dos.writeByte(0);
  8090. dos.writeInt(intNum);
  8091. }
  8092. }
  8093.  
  8094. public void readKeysData(ObjectInputStream dis) {
  8095.  
  8096. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  8097.  
  8098. try {
  8099.  
  8100. int length = 0;
  8101.  
  8102. this.idzamestnanci = dis.readInt();
  8103.  
  8104. length = dis.readByte();
  8105. if (length == -1) {
  8106. this.dovolena_rok = null;
  8107. } else {
  8108. this.dovolena_rok = dis.readShort();
  8109. }
  8110.  
  8111. } catch (IOException e) {
  8112. throw new RuntimeException(e);
  8113.  
  8114. }
  8115.  
  8116. }
  8117.  
  8118. }
  8119.  
  8120. public void writeKeysData(ObjectOutputStream dos) {
  8121. try {
  8122.  
  8123. // int
  8124.  
  8125. dos.writeInt(this.idzamestnanci);
  8126.  
  8127. // Short
  8128.  
  8129. if (this.dovolena_rok == null) {
  8130. dos.writeByte(-1);
  8131. } else {
  8132. dos.writeByte(0);
  8133. dos.writeShort(this.dovolena_rok);
  8134. }
  8135.  
  8136. } catch (IOException e) {
  8137. throw new RuntimeException(e);
  8138. }
  8139.  
  8140. }
  8141.  
  8142. /**
  8143. * Fill Values data by reading ObjectInputStream.
  8144. */
  8145. public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
  8146. try {
  8147.  
  8148. int length = 0;
  8149.  
  8150. length = dis.readByte();
  8151. if (length == -1) {
  8152. this.dovolena_mesic = null;
  8153. } else {
  8154. this.dovolena_mesic = dis.readShort();
  8155. }
  8156.  
  8157. this.dovolena_cerpani = readInteger(dis, ois);
  8158.  
  8159. } catch (IOException e) {
  8160. throw new RuntimeException(e);
  8161.  
  8162. }
  8163.  
  8164. }
  8165.  
  8166. /**
  8167. * Return a byte array which represents Values data.
  8168. */
  8169. public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
  8170. try {
  8171.  
  8172. if (this.dovolena_mesic == null) {
  8173. dos.writeByte(-1);
  8174. } else {
  8175. dos.writeByte(0);
  8176. dos.writeShort(this.dovolena_mesic);
  8177. }
  8178.  
  8179. writeInteger(this.dovolena_cerpani, dos, oos);
  8180.  
  8181. } catch (IOException e) {
  8182. throw new RuntimeException(e);
  8183. }
  8184.  
  8185. }
  8186.  
  8187. public String toString() {
  8188.  
  8189. StringBuilder sb = new StringBuilder();
  8190. sb.append(super.toString());
  8191. sb.append("[");
  8192. sb.append("idzamestnanci=" + String.valueOf(idzamestnanci));
  8193. sb.append(",dovolena_mesic=" + String.valueOf(dovolena_mesic));
  8194. sb.append(",dovolena_rok=" + String.valueOf(dovolena_rok));
  8195. sb.append(",dovolena_cerpani=" + String.valueOf(dovolena_cerpani));
  8196. sb.append("]");
  8197.  
  8198. return sb.toString();
  8199. }
  8200.  
  8201. /**
  8202. * Compare keys
  8203. */
  8204. public int compareTo(row6Struct other) {
  8205.  
  8206. int returnValue = -1;
  8207.  
  8208. returnValue = checkNullsAndCompare(this.idzamestnanci,
  8209. other.idzamestnanci);
  8210. if (returnValue != 0) {
  8211. return returnValue;
  8212. }
  8213.  
  8214. returnValue = checkNullsAndCompare(this.dovolena_rok,
  8215. other.dovolena_rok);
  8216. if (returnValue != 0) {
  8217. return returnValue;
  8218. }
  8219.  
  8220. return returnValue;
  8221. }
  8222.  
  8223. private int checkNullsAndCompare(Object object1, Object object2) {
  8224. int returnValue = 0;
  8225. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  8226. returnValue = ((Comparable) object1).compareTo(object2);
  8227. } else if (object1 != null && object2 != null) {
  8228. returnValue = compareStrings(object1.toString(),
  8229. object2.toString());
  8230. } else if (object1 == null && object2 != null) {
  8231. returnValue = 1;
  8232. } else if (object1 != null && object2 == null) {
  8233. returnValue = -1;
  8234. } else {
  8235. returnValue = 0;
  8236. }
  8237.  
  8238. return returnValue;
  8239. }
  8240.  
  8241. private int compareStrings(String string1, String string2) {
  8242. return string1.compareTo(string2);
  8243. }
  8244.  
  8245. }
  8246.  
  8247. public void tDBInput_7Process(final java.util.Map<String, Object> globalMap)
  8248. throws TalendException {
  8249. globalMap.put("tDBInput_7_SUBPROCESS_STATE", 0);
  8250.  
  8251. final boolean execStat = this.execStat;
  8252.  
  8253. String iterateId = "";
  8254.  
  8255. String currentComponent = "";
  8256. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  8257.  
  8258. try {
  8259. // TDI-39566 avoid throwing an useless Exception
  8260. boolean resumeIt = true;
  8261. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  8262. String currentMethodName = new java.lang.Exception()
  8263. .getStackTrace()[0].getMethodName();
  8264. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  8265. }
  8266. if (resumeIt || globalResumeTicket) { // start the resume
  8267. globalResumeTicket = true;
  8268.  
  8269. row6Struct row6 = new row6Struct();
  8270.  
  8271. /**
  8272. * [tAdvancedHash_row6 begin ] start
  8273. */
  8274.  
  8275. ok_Hash.put("tAdvancedHash_row6", false);
  8276. start_Hash
  8277. .put("tAdvancedHash_row6", System.currentTimeMillis());
  8278.  
  8279. currentComponent = "tAdvancedHash_row6";
  8280.  
  8281. if (execStat) {
  8282. if (resourceMap.get("inIterateVComp") == null) {
  8283.  
  8284. runStat.updateStatOnConnection("row6" + iterateId, 0, 0);
  8285.  
  8286. }
  8287. }
  8288.  
  8289. int tos_count_tAdvancedHash_row6 = 0;
  8290.  
  8291. // connection name:row6
  8292. // source node:tDBInput_7 - inputs:(after_tDBInput_6)
  8293. // outputs:(row6,row6) | target node:tAdvancedHash_row6 -
  8294. // inputs:(row6) outputs:()
  8295. // linked node: tMap_2 -
  8296. // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
  8297. // outputs:(out2)
  8298.  
  8299. org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row6 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
  8300.  
  8301. org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row6Struct> tHash_Lookup_row6 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
  8302. .<row6Struct> getLookup(matchingModeEnum_row6);
  8303.  
  8304. globalMap.put("tHash_Lookup_row6", tHash_Lookup_row6);
  8305.  
  8306. /**
  8307. * [tAdvancedHash_row6 begin ] stop
  8308. */
  8309.  
  8310. /**
  8311. * [tDBInput_7 begin ] start
  8312. */
  8313.  
  8314. ok_Hash.put("tDBInput_7", false);
  8315. start_Hash.put("tDBInput_7", System.currentTimeMillis());
  8316.  
  8317. currentComponent = "tDBInput_7";
  8318.  
  8319. int tos_count_tDBInput_7 = 0;
  8320.  
  8321. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_7 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  8322. .getMSSqlGenerateTimestampUtil();
  8323.  
  8324. java.util.List<String> talendToDBList_tDBInput_7 = new java.util.ArrayList();
  8325. String[] talendToDBArray_tDBInput_7 = new String[] { "FLOAT",
  8326. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  8327. "DECIMAL IDENTITY", "REAL" };
  8328. java.util.Collections.addAll(talendToDBList_tDBInput_7,
  8329. talendToDBArray_tDBInput_7);
  8330. int nb_line_tDBInput_7 = 0;
  8331. java.sql.Connection conn_tDBInput_7 = null;
  8332. String driverClass_tDBInput_7 = "net.sourceforge.jtds.jdbc.Driver";
  8333. java.lang.Class.forName(driverClass_tDBInput_7);
  8334. String dbUser_tDBInput_7 = "tym1";
  8335.  
  8336. final String decryptedPassword_tDBInput_7 = routines.system.PasswordEncryptUtil
  8337. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  8338.  
  8339. String dbPwd_tDBInput_7 = decryptedPassword_tDBInput_7;
  8340.  
  8341. String port_tDBInput_7 = "1433";
  8342. String dbname_tDBInput_7 = "bi_zdroj01";
  8343. String url_tDBInput_7 = "jdbc:jtds:sqlserver://"
  8344. + "158.196.160.60";
  8345. if (!"".equals(port_tDBInput_7)) {
  8346. url_tDBInput_7 += ":" + "1433";
  8347. }
  8348. if (!"".equals(dbname_tDBInput_7)) {
  8349. url_tDBInput_7 += "//" + "bi_zdroj01";
  8350. }
  8351. url_tDBInput_7 += ";appName=" + projectName + ";" + "";
  8352. String dbschema_tDBInput_7 = "";
  8353.  
  8354. conn_tDBInput_7 = java.sql.DriverManager.getConnection(
  8355. url_tDBInput_7, dbUser_tDBInput_7, dbPwd_tDBInput_7);
  8356.  
  8357. java.sql.Statement stmt_tDBInput_7 = conn_tDBInput_7
  8358. .createStatement();
  8359.  
  8360. String dbquery_tDBInput_7 = "SELECT\n cerpani_dovolene.idzamestnanci,\n MONTH(cerpani_dovolene.dovolena_od) AS dovolena_mesic,\n YEAR(cerpani_dov"
  8361. + "olene.dovolena_do) AS dovolena_rok,\n DATEDIFF(day, dovolena_od, dovolena_do) AS dovolena_cerpani\nFROM cerpani_dovolen"
  8362. + "e ORDER BY dovolena_rok, dovolena_mesic";
  8363.  
  8364. globalMap.put("tDBInput_7_QUERY", dbquery_tDBInput_7);
  8365. java.sql.ResultSet rs_tDBInput_7 = null;
  8366.  
  8367. try {
  8368. rs_tDBInput_7 = stmt_tDBInput_7
  8369. .executeQuery(dbquery_tDBInput_7);
  8370. java.sql.ResultSetMetaData rsmd_tDBInput_7 = rs_tDBInput_7
  8371. .getMetaData();
  8372. int colQtyInRs_tDBInput_7 = rsmd_tDBInput_7
  8373. .getColumnCount();
  8374.  
  8375. String tmpContent_tDBInput_7 = null;
  8376.  
  8377. while (rs_tDBInput_7.next()) {
  8378. nb_line_tDBInput_7++;
  8379.  
  8380. if (colQtyInRs_tDBInput_7 < 1) {
  8381. row6.idzamestnanci = 0;
  8382. } else {
  8383.  
  8384. if (rs_tDBInput_7.getObject(1) != null) {
  8385. row6.idzamestnanci = rs_tDBInput_7.getInt(1);
  8386. } else {
  8387. throw new RuntimeException(
  8388. "Null value in non-Nullable column");
  8389. }
  8390. }
  8391. if (colQtyInRs_tDBInput_7 < 2) {
  8392. row6.dovolena_mesic = null;
  8393. } else {
  8394.  
  8395. if (rs_tDBInput_7.getObject(2) != null) {
  8396. row6.dovolena_mesic = rs_tDBInput_7.getShort(2);
  8397. } else {
  8398. row6.dovolena_mesic = null;
  8399. }
  8400. }
  8401. if (colQtyInRs_tDBInput_7 < 3) {
  8402. row6.dovolena_rok = null;
  8403. } else {
  8404.  
  8405. if (rs_tDBInput_7.getObject(3) != null) {
  8406. row6.dovolena_rok = rs_tDBInput_7.getShort(3);
  8407. } else {
  8408. row6.dovolena_rok = null;
  8409. }
  8410. }
  8411. if (colQtyInRs_tDBInput_7 < 4) {
  8412. row6.dovolena_cerpani = null;
  8413. } else {
  8414.  
  8415. if (rs_tDBInput_7.getObject(4) != null) {
  8416. row6.dovolena_cerpani = rs_tDBInput_7.getInt(4);
  8417. } else {
  8418. row6.dovolena_cerpani = null;
  8419. }
  8420. }
  8421.  
  8422. /**
  8423. * [tDBInput_7 begin ] stop
  8424. */
  8425.  
  8426. /**
  8427. * [tDBInput_7 main ] start
  8428. */
  8429.  
  8430. currentComponent = "tDBInput_7";
  8431.  
  8432. tos_count_tDBInput_7++;
  8433.  
  8434. /**
  8435. * [tDBInput_7 main ] stop
  8436. */
  8437.  
  8438. /**
  8439. * [tDBInput_7 process_data_begin ] start
  8440. */
  8441.  
  8442. currentComponent = "tDBInput_7";
  8443.  
  8444. /**
  8445. * [tDBInput_7 process_data_begin ] stop
  8446. */
  8447.  
  8448. /**
  8449. * [tAdvancedHash_row6 main ] start
  8450. */
  8451.  
  8452. currentComponent = "tAdvancedHash_row6";
  8453.  
  8454. // row6
  8455. // row6
  8456.  
  8457. if (execStat) {
  8458. runStat.updateStatOnConnection("row6" + iterateId,
  8459. 1, 1);
  8460. }
  8461.  
  8462. row6Struct row6_HashRow = new row6Struct();
  8463.  
  8464. row6_HashRow.idzamestnanci = row6.idzamestnanci;
  8465.  
  8466. row6_HashRow.dovolena_mesic = row6.dovolena_mesic;
  8467.  
  8468. row6_HashRow.dovolena_rok = row6.dovolena_rok;
  8469.  
  8470. row6_HashRow.dovolena_cerpani = row6.dovolena_cerpani;
  8471.  
  8472. tHash_Lookup_row6.put(row6_HashRow);
  8473.  
  8474. tos_count_tAdvancedHash_row6++;
  8475.  
  8476. /**
  8477. * [tAdvancedHash_row6 main ] stop
  8478. */
  8479.  
  8480. /**
  8481. * [tAdvancedHash_row6 process_data_begin ] start
  8482. */
  8483.  
  8484. currentComponent = "tAdvancedHash_row6";
  8485.  
  8486. /**
  8487. * [tAdvancedHash_row6 process_data_begin ] stop
  8488. */
  8489.  
  8490. /**
  8491. * [tAdvancedHash_row6 process_data_end ] start
  8492. */
  8493.  
  8494. currentComponent = "tAdvancedHash_row6";
  8495.  
  8496. /**
  8497. * [tAdvancedHash_row6 process_data_end ] stop
  8498. */
  8499.  
  8500. /**
  8501. * [tDBInput_7 process_data_end ] start
  8502. */
  8503.  
  8504. currentComponent = "tDBInput_7";
  8505.  
  8506. /**
  8507. * [tDBInput_7 process_data_end ] stop
  8508. */
  8509.  
  8510. /**
  8511. * [tDBInput_7 end ] start
  8512. */
  8513.  
  8514. currentComponent = "tDBInput_7";
  8515.  
  8516. }
  8517. } finally {
  8518. if (rs_tDBInput_7 != null) {
  8519. rs_tDBInput_7.close();
  8520. }
  8521. if (stmt_tDBInput_7 != null) {
  8522. stmt_tDBInput_7.close();
  8523. }
  8524. if (conn_tDBInput_7 != null && !conn_tDBInput_7.isClosed()) {
  8525.  
  8526. conn_tDBInput_7.close();
  8527.  
  8528. }
  8529. }
  8530. globalMap.put("tDBInput_7_NB_LINE", nb_line_tDBInput_7);
  8531.  
  8532. ok_Hash.put("tDBInput_7", true);
  8533. end_Hash.put("tDBInput_7", System.currentTimeMillis());
  8534.  
  8535. /**
  8536. * [tDBInput_7 end ] stop
  8537. */
  8538.  
  8539. /**
  8540. * [tAdvancedHash_row6 end ] start
  8541. */
  8542.  
  8543. currentComponent = "tAdvancedHash_row6";
  8544.  
  8545. tHash_Lookup_row6.endPut();
  8546.  
  8547. if (execStat) {
  8548. if (resourceMap.get("inIterateVComp") == null
  8549. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  8550. runStat.updateStatOnConnection("row6" + iterateId, 2, 0);
  8551. }
  8552. }
  8553.  
  8554. ok_Hash.put("tAdvancedHash_row6", true);
  8555. end_Hash.put("tAdvancedHash_row6", System.currentTimeMillis());
  8556.  
  8557. /**
  8558. * [tAdvancedHash_row6 end ] stop
  8559. */
  8560.  
  8561. }// end the resume
  8562.  
  8563. } catch (java.lang.Exception e) {
  8564.  
  8565. TalendException te = new TalendException(e, currentComponent,
  8566. globalMap);
  8567.  
  8568. throw te;
  8569. } catch (java.lang.Error error) {
  8570.  
  8571. runStat.stopThreadStat();
  8572.  
  8573. throw error;
  8574. } finally {
  8575.  
  8576. try {
  8577.  
  8578. /**
  8579. * [tDBInput_7 finally ] start
  8580. */
  8581.  
  8582. currentComponent = "tDBInput_7";
  8583.  
  8584. /**
  8585. * [tDBInput_7 finally ] stop
  8586. */
  8587.  
  8588. /**
  8589. * [tAdvancedHash_row6 finally ] start
  8590. */
  8591.  
  8592. currentComponent = "tAdvancedHash_row6";
  8593.  
  8594. /**
  8595. * [tAdvancedHash_row6 finally ] stop
  8596. */
  8597.  
  8598. } catch (java.lang.Exception e) {
  8599. // ignore
  8600. } catch (java.lang.Error error) {
  8601. // ignore
  8602. }
  8603. resourceMap = null;
  8604. }
  8605.  
  8606. globalMap.put("tDBInput_7_SUBPROCESS_STATE", 1);
  8607. }
  8608.  
  8609. public static class row7Struct implements
  8610. routines.system.IPersistableComparableLookupRow<row7Struct> {
  8611. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  8612. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  8613. protected static final int DEFAULT_HASHCODE = 1;
  8614. protected static final int PRIME = 31;
  8615. protected int hashCode = DEFAULT_HASHCODE;
  8616. public boolean hashCodeDirty = true;
  8617.  
  8618. public String loopKey;
  8619.  
  8620. public int idkalendare;
  8621.  
  8622. public int getIdkalendare() {
  8623. return this.idkalendare;
  8624. }
  8625.  
  8626. public short nazev_mesice;
  8627.  
  8628. public short getNazev_mesice() {
  8629. return this.nazev_mesice;
  8630. }
  8631.  
  8632. public short ctvrtleti;
  8633.  
  8634. public short getCtvrtleti() {
  8635. return this.ctvrtleti;
  8636. }
  8637.  
  8638. public short rok;
  8639.  
  8640. public short getRok() {
  8641. return this.rok;
  8642. }
  8643.  
  8644. @Override
  8645. public int hashCode() {
  8646. if (this.hashCodeDirty) {
  8647. final int prime = PRIME;
  8648. int result = DEFAULT_HASHCODE;
  8649.  
  8650. result = prime * result + (int) this.nazev_mesice;
  8651.  
  8652. result = prime * result + (int) this.rok;
  8653.  
  8654. this.hashCode = result;
  8655. this.hashCodeDirty = false;
  8656. }
  8657. return this.hashCode;
  8658. }
  8659.  
  8660. @Override
  8661. public boolean equals(Object obj) {
  8662. if (this == obj)
  8663. return true;
  8664. if (obj == null)
  8665. return false;
  8666. if (getClass() != obj.getClass())
  8667. return false;
  8668. final row7Struct other = (row7Struct) obj;
  8669.  
  8670. if (this.nazev_mesice != other.nazev_mesice)
  8671. return false;
  8672.  
  8673. if (this.rok != other.rok)
  8674. return false;
  8675.  
  8676. return true;
  8677. }
  8678.  
  8679. public void copyDataTo(row7Struct other) {
  8680.  
  8681. other.idkalendare = this.idkalendare;
  8682. other.nazev_mesice = this.nazev_mesice;
  8683. other.ctvrtleti = this.ctvrtleti;
  8684. other.rok = this.rok;
  8685.  
  8686. }
  8687.  
  8688. public void copyKeysDataTo(row7Struct other) {
  8689.  
  8690. other.nazev_mesice = this.nazev_mesice;
  8691. other.rok = this.rok;
  8692.  
  8693. }
  8694.  
  8695. public void readKeysData(ObjectInputStream dis) {
  8696.  
  8697. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  8698.  
  8699. try {
  8700.  
  8701. int length = 0;
  8702.  
  8703. this.nazev_mesice = dis.readShort();
  8704.  
  8705. this.rok = dis.readShort();
  8706.  
  8707. } catch (IOException e) {
  8708. throw new RuntimeException(e);
  8709.  
  8710. }
  8711.  
  8712. }
  8713.  
  8714. }
  8715.  
  8716. public void writeKeysData(ObjectOutputStream dos) {
  8717. try {
  8718.  
  8719. // short
  8720.  
  8721. dos.writeShort(this.nazev_mesice);
  8722.  
  8723. // short
  8724.  
  8725. dos.writeShort(this.rok);
  8726.  
  8727. } catch (IOException e) {
  8728. throw new RuntimeException(e);
  8729. }
  8730.  
  8731. }
  8732.  
  8733. /**
  8734. * Fill Values data by reading ObjectInputStream.
  8735. */
  8736. public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
  8737. try {
  8738.  
  8739. int length = 0;
  8740.  
  8741. this.idkalendare = dis.readInt();
  8742.  
  8743. this.ctvrtleti = dis.readShort();
  8744.  
  8745. } catch (IOException e) {
  8746. throw new RuntimeException(e);
  8747.  
  8748. }
  8749.  
  8750. }
  8751.  
  8752. /**
  8753. * Return a byte array which represents Values data.
  8754. */
  8755. public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
  8756. try {
  8757.  
  8758. dos.writeInt(this.idkalendare);
  8759.  
  8760. dos.writeShort(this.ctvrtleti);
  8761.  
  8762. } catch (IOException e) {
  8763. throw new RuntimeException(e);
  8764. }
  8765.  
  8766. }
  8767.  
  8768. public String toString() {
  8769.  
  8770. StringBuilder sb = new StringBuilder();
  8771. sb.append(super.toString());
  8772. sb.append("[");
  8773. sb.append("idkalendare=" + String.valueOf(idkalendare));
  8774. sb.append(",nazev_mesice=" + String.valueOf(nazev_mesice));
  8775. sb.append(",ctvrtleti=" + String.valueOf(ctvrtleti));
  8776. sb.append(",rok=" + String.valueOf(rok));
  8777. sb.append("]");
  8778.  
  8779. return sb.toString();
  8780. }
  8781.  
  8782. /**
  8783. * Compare keys
  8784. */
  8785. public int compareTo(row7Struct other) {
  8786.  
  8787. int returnValue = -1;
  8788.  
  8789. returnValue = checkNullsAndCompare(this.nazev_mesice,
  8790. other.nazev_mesice);
  8791. if (returnValue != 0) {
  8792. return returnValue;
  8793. }
  8794.  
  8795. returnValue = checkNullsAndCompare(this.rok, other.rok);
  8796. if (returnValue != 0) {
  8797. return returnValue;
  8798. }
  8799.  
  8800. return returnValue;
  8801. }
  8802.  
  8803. private int checkNullsAndCompare(Object object1, Object object2) {
  8804. int returnValue = 0;
  8805. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  8806. returnValue = ((Comparable) object1).compareTo(object2);
  8807. } else if (object1 != null && object2 != null) {
  8808. returnValue = compareStrings(object1.toString(),
  8809. object2.toString());
  8810. } else if (object1 == null && object2 != null) {
  8811. returnValue = 1;
  8812. } else if (object1 != null && object2 == null) {
  8813. returnValue = -1;
  8814. } else {
  8815. returnValue = 0;
  8816. }
  8817.  
  8818. return returnValue;
  8819. }
  8820.  
  8821. private int compareStrings(String string1, String string2) {
  8822. return string1.compareTo(string2);
  8823. }
  8824.  
  8825. }
  8826.  
  8827. public void tDBInput_8Process(final java.util.Map<String, Object> globalMap)
  8828. throws TalendException {
  8829. globalMap.put("tDBInput_8_SUBPROCESS_STATE", 0);
  8830.  
  8831. final boolean execStat = this.execStat;
  8832.  
  8833. String iterateId = "";
  8834.  
  8835. String currentComponent = "";
  8836. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  8837.  
  8838. try {
  8839. // TDI-39566 avoid throwing an useless Exception
  8840. boolean resumeIt = true;
  8841. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  8842. String currentMethodName = new java.lang.Exception()
  8843. .getStackTrace()[0].getMethodName();
  8844. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  8845. }
  8846. if (resumeIt || globalResumeTicket) { // start the resume
  8847. globalResumeTicket = true;
  8848.  
  8849. row7Struct row7 = new row7Struct();
  8850.  
  8851. /**
  8852. * [tAdvancedHash_row7 begin ] start
  8853. */
  8854.  
  8855. ok_Hash.put("tAdvancedHash_row7", false);
  8856. start_Hash
  8857. .put("tAdvancedHash_row7", System.currentTimeMillis());
  8858.  
  8859. currentComponent = "tAdvancedHash_row7";
  8860.  
  8861. if (execStat) {
  8862. if (resourceMap.get("inIterateVComp") == null) {
  8863.  
  8864. runStat.updateStatOnConnection("row7" + iterateId, 0, 0);
  8865.  
  8866. }
  8867. }
  8868.  
  8869. int tos_count_tAdvancedHash_row7 = 0;
  8870.  
  8871. // connection name:row7
  8872. // source node:tDBInput_8 - inputs:(after_tDBInput_6)
  8873. // outputs:(row7,row7) | target node:tAdvancedHash_row7 -
  8874. // inputs:(row7) outputs:()
  8875. // linked node: tMap_2 -
  8876. // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
  8877. // outputs:(out2)
  8878.  
  8879. org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row7 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
  8880.  
  8881. org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row7Struct> tHash_Lookup_row7 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
  8882. .<row7Struct> getLookup(matchingModeEnum_row7);
  8883.  
  8884. globalMap.put("tHash_Lookup_row7", tHash_Lookup_row7);
  8885.  
  8886. /**
  8887. * [tAdvancedHash_row7 begin ] stop
  8888. */
  8889.  
  8890. /**
  8891. * [tDBInput_8 begin ] start
  8892. */
  8893.  
  8894. ok_Hash.put("tDBInput_8", false);
  8895. start_Hash.put("tDBInput_8", System.currentTimeMillis());
  8896.  
  8897. currentComponent = "tDBInput_8";
  8898.  
  8899. int tos_count_tDBInput_8 = 0;
  8900.  
  8901. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_8 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  8902. .getMSSqlGenerateTimestampUtil();
  8903.  
  8904. java.util.List<String> talendToDBList_tDBInput_8 = new java.util.ArrayList();
  8905. String[] talendToDBArray_tDBInput_8 = new String[] { "FLOAT",
  8906. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  8907. "DECIMAL IDENTITY", "REAL" };
  8908. java.util.Collections.addAll(talendToDBList_tDBInput_8,
  8909. talendToDBArray_tDBInput_8);
  8910. int nb_line_tDBInput_8 = 0;
  8911. java.sql.Connection conn_tDBInput_8 = null;
  8912. String driverClass_tDBInput_8 = "net.sourceforge.jtds.jdbc.Driver";
  8913. java.lang.Class.forName(driverClass_tDBInput_8);
  8914. String dbUser_tDBInput_8 = "tym1";
  8915.  
  8916. final String decryptedPassword_tDBInput_8 = routines.system.PasswordEncryptUtil
  8917. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  8918.  
  8919. String dbPwd_tDBInput_8 = decryptedPassword_tDBInput_8;
  8920.  
  8921. String port_tDBInput_8 = "1433";
  8922. String dbname_tDBInput_8 = "tym1";
  8923. String url_tDBInput_8 = "jdbc:jtds:sqlserver://"
  8924. + "158.196.160.60";
  8925. if (!"".equals(port_tDBInput_8)) {
  8926. url_tDBInput_8 += ":" + "1433";
  8927. }
  8928. if (!"".equals(dbname_tDBInput_8)) {
  8929. url_tDBInput_8 += "//" + "tym1";
  8930. }
  8931. url_tDBInput_8 += ";appName=" + projectName + ";" + "";
  8932. String dbschema_tDBInput_8 = "";
  8933.  
  8934. conn_tDBInput_8 = java.sql.DriverManager.getConnection(
  8935. url_tDBInput_8, dbUser_tDBInput_8, dbPwd_tDBInput_8);
  8936.  
  8937. java.sql.Statement stmt_tDBInput_8 = conn_tDBInput_8
  8938. .createStatement();
  8939.  
  8940. String dbquery_tDBInput_8 = "SELECT DIM_kalendar.idkalendare,\n DIM_kalendar.nazev_mesice,\n DIM_kalendar.ctvrtleti,\n DIM_kalendar.rok\nFROM DIM_kal"
  8941. + "endar";
  8942.  
  8943. globalMap.put("tDBInput_8_QUERY", dbquery_tDBInput_8);
  8944. java.sql.ResultSet rs_tDBInput_8 = null;
  8945.  
  8946. try {
  8947. rs_tDBInput_8 = stmt_tDBInput_8
  8948. .executeQuery(dbquery_tDBInput_8);
  8949. java.sql.ResultSetMetaData rsmd_tDBInput_8 = rs_tDBInput_8
  8950. .getMetaData();
  8951. int colQtyInRs_tDBInput_8 = rsmd_tDBInput_8
  8952. .getColumnCount();
  8953.  
  8954. String tmpContent_tDBInput_8 = null;
  8955.  
  8956. while (rs_tDBInput_8.next()) {
  8957. nb_line_tDBInput_8++;
  8958.  
  8959. if (colQtyInRs_tDBInput_8 < 1) {
  8960. row7.idkalendare = 0;
  8961. } else {
  8962.  
  8963. if (rs_tDBInput_8.getObject(1) != null) {
  8964. row7.idkalendare = rs_tDBInput_8.getInt(1);
  8965. } else {
  8966. throw new RuntimeException(
  8967. "Null value in non-Nullable column");
  8968. }
  8969. }
  8970. if (colQtyInRs_tDBInput_8 < 2) {
  8971. row7.nazev_mesice = 0;
  8972. } else {
  8973.  
  8974. if (rs_tDBInput_8.getObject(2) != null) {
  8975. row7.nazev_mesice = rs_tDBInput_8.getShort(2);
  8976. } else {
  8977. throw new RuntimeException(
  8978. "Null value in non-Nullable column");
  8979. }
  8980. }
  8981. if (colQtyInRs_tDBInput_8 < 3) {
  8982. row7.ctvrtleti = 0;
  8983. } else {
  8984.  
  8985. if (rs_tDBInput_8.getObject(3) != null) {
  8986. row7.ctvrtleti = rs_tDBInput_8.getShort(3);
  8987. } else {
  8988. throw new RuntimeException(
  8989. "Null value in non-Nullable column");
  8990. }
  8991. }
  8992. if (colQtyInRs_tDBInput_8 < 4) {
  8993. row7.rok = 0;
  8994. } else {
  8995.  
  8996. if (rs_tDBInput_8.getObject(4) != null) {
  8997. row7.rok = rs_tDBInput_8.getShort(4);
  8998. } else {
  8999. throw new RuntimeException(
  9000. "Null value in non-Nullable column");
  9001. }
  9002. }
  9003.  
  9004. /**
  9005. * [tDBInput_8 begin ] stop
  9006. */
  9007.  
  9008. /**
  9009. * [tDBInput_8 main ] start
  9010. */
  9011.  
  9012. currentComponent = "tDBInput_8";
  9013.  
  9014. tos_count_tDBInput_8++;
  9015.  
  9016. /**
  9017. * [tDBInput_8 main ] stop
  9018. */
  9019.  
  9020. /**
  9021. * [tDBInput_8 process_data_begin ] start
  9022. */
  9023.  
  9024. currentComponent = "tDBInput_8";
  9025.  
  9026. /**
  9027. * [tDBInput_8 process_data_begin ] stop
  9028. */
  9029.  
  9030. /**
  9031. * [tAdvancedHash_row7 main ] start
  9032. */
  9033.  
  9034. currentComponent = "tAdvancedHash_row7";
  9035.  
  9036. // row7
  9037. // row7
  9038.  
  9039. if (execStat) {
  9040. runStat.updateStatOnConnection("row7" + iterateId,
  9041. 1, 1);
  9042. }
  9043.  
  9044. row7Struct row7_HashRow = new row7Struct();
  9045.  
  9046. row7_HashRow.idkalendare = row7.idkalendare;
  9047.  
  9048. row7_HashRow.nazev_mesice = row7.nazev_mesice;
  9049.  
  9050. row7_HashRow.ctvrtleti = row7.ctvrtleti;
  9051.  
  9052. row7_HashRow.rok = row7.rok;
  9053.  
  9054. tHash_Lookup_row7.put(row7_HashRow);
  9055.  
  9056. tos_count_tAdvancedHash_row7++;
  9057.  
  9058. /**
  9059. * [tAdvancedHash_row7 main ] stop
  9060. */
  9061.  
  9062. /**
  9063. * [tAdvancedHash_row7 process_data_begin ] start
  9064. */
  9065.  
  9066. currentComponent = "tAdvancedHash_row7";
  9067.  
  9068. /**
  9069. * [tAdvancedHash_row7 process_data_begin ] stop
  9070. */
  9071.  
  9072. /**
  9073. * [tAdvancedHash_row7 process_data_end ] start
  9074. */
  9075.  
  9076. currentComponent = "tAdvancedHash_row7";
  9077.  
  9078. /**
  9079. * [tAdvancedHash_row7 process_data_end ] stop
  9080. */
  9081.  
  9082. /**
  9083. * [tDBInput_8 process_data_end ] start
  9084. */
  9085.  
  9086. currentComponent = "tDBInput_8";
  9087.  
  9088. /**
  9089. * [tDBInput_8 process_data_end ] stop
  9090. */
  9091.  
  9092. /**
  9093. * [tDBInput_8 end ] start
  9094. */
  9095.  
  9096. currentComponent = "tDBInput_8";
  9097.  
  9098. }
  9099. } finally {
  9100. if (rs_tDBInput_8 != null) {
  9101. rs_tDBInput_8.close();
  9102. }
  9103. if (stmt_tDBInput_8 != null) {
  9104. stmt_tDBInput_8.close();
  9105. }
  9106. if (conn_tDBInput_8 != null && !conn_tDBInput_8.isClosed()) {
  9107.  
  9108. conn_tDBInput_8.close();
  9109.  
  9110. }
  9111. }
  9112. globalMap.put("tDBInput_8_NB_LINE", nb_line_tDBInput_8);
  9113.  
  9114. ok_Hash.put("tDBInput_8", true);
  9115. end_Hash.put("tDBInput_8", System.currentTimeMillis());
  9116.  
  9117. /**
  9118. * [tDBInput_8 end ] stop
  9119. */
  9120.  
  9121. /**
  9122. * [tAdvancedHash_row7 end ] start
  9123. */
  9124.  
  9125. currentComponent = "tAdvancedHash_row7";
  9126.  
  9127. tHash_Lookup_row7.endPut();
  9128.  
  9129. if (execStat) {
  9130. if (resourceMap.get("inIterateVComp") == null
  9131. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  9132. runStat.updateStatOnConnection("row7" + iterateId, 2, 0);
  9133. }
  9134. }
  9135.  
  9136. ok_Hash.put("tAdvancedHash_row7", true);
  9137. end_Hash.put("tAdvancedHash_row7", System.currentTimeMillis());
  9138.  
  9139. /**
  9140. * [tAdvancedHash_row7 end ] stop
  9141. */
  9142.  
  9143. }// end the resume
  9144.  
  9145. } catch (java.lang.Exception e) {
  9146.  
  9147. TalendException te = new TalendException(e, currentComponent,
  9148. globalMap);
  9149.  
  9150. throw te;
  9151. } catch (java.lang.Error error) {
  9152.  
  9153. runStat.stopThreadStat();
  9154.  
  9155. throw error;
  9156. } finally {
  9157.  
  9158. try {
  9159.  
  9160. /**
  9161. * [tDBInput_8 finally ] start
  9162. */
  9163.  
  9164. currentComponent = "tDBInput_8";
  9165.  
  9166. /**
  9167. * [tDBInput_8 finally ] stop
  9168. */
  9169.  
  9170. /**
  9171. * [tAdvancedHash_row7 finally ] start
  9172. */
  9173.  
  9174. currentComponent = "tAdvancedHash_row7";
  9175.  
  9176. /**
  9177. * [tAdvancedHash_row7 finally ] stop
  9178. */
  9179.  
  9180. } catch (java.lang.Exception e) {
  9181. // ignore
  9182. } catch (java.lang.Error error) {
  9183. // ignore
  9184. }
  9185. resourceMap = null;
  9186. }
  9187.  
  9188. globalMap.put("tDBInput_8_SUBPROCESS_STATE", 1);
  9189. }
  9190.  
  9191. public static class row8Struct implements
  9192. routines.system.IPersistableComparableLookupRow<row8Struct> {
  9193. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  9194. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  9195. protected static final int DEFAULT_HASHCODE = 1;
  9196. protected static final int PRIME = 31;
  9197. protected int hashCode = DEFAULT_HASHCODE;
  9198. public boolean hashCodeDirty = true;
  9199.  
  9200. public String loopKey;
  9201.  
  9202. public int idsazby;
  9203.  
  9204. public int getIdsazby() {
  9205. return this.idsazby;
  9206. }
  9207.  
  9208. public int cislo_sazby;
  9209.  
  9210. public int getCislo_sazby() {
  9211. return this.cislo_sazby;
  9212. }
  9213.  
  9214. public String nazev_profese;
  9215.  
  9216. public String getNazev_profese() {
  9217. return this.nazev_profese;
  9218. }
  9219.  
  9220. public int hodinova_sazba;
  9221.  
  9222. public int getHodinova_sazba() {
  9223. return this.hodinova_sazba;
  9224. }
  9225.  
  9226. @Override
  9227. public int hashCode() {
  9228. if (this.hashCodeDirty) {
  9229. final int prime = PRIME;
  9230. int result = DEFAULT_HASHCODE;
  9231.  
  9232. result = prime
  9233. * result
  9234. + ((this.nazev_profese == null) ? 0
  9235. : this.nazev_profese.hashCode());
  9236.  
  9237. this.hashCode = result;
  9238. this.hashCodeDirty = false;
  9239. }
  9240. return this.hashCode;
  9241. }
  9242.  
  9243. @Override
  9244. public boolean equals(Object obj) {
  9245. if (this == obj)
  9246. return true;
  9247. if (obj == null)
  9248. return false;
  9249. if (getClass() != obj.getClass())
  9250. return false;
  9251. final row8Struct other = (row8Struct) obj;
  9252.  
  9253. if (this.nazev_profese == null) {
  9254. if (other.nazev_profese != null)
  9255. return false;
  9256.  
  9257. } else if (!this.nazev_profese.equals(other.nazev_profese))
  9258.  
  9259. return false;
  9260.  
  9261. return true;
  9262. }
  9263.  
  9264. public void copyDataTo(row8Struct other) {
  9265.  
  9266. other.idsazby = this.idsazby;
  9267. other.cislo_sazby = this.cislo_sazby;
  9268. other.nazev_profese = this.nazev_profese;
  9269. other.hodinova_sazba = this.hodinova_sazba;
  9270.  
  9271. }
  9272.  
  9273. public void copyKeysDataTo(row8Struct other) {
  9274.  
  9275. other.nazev_profese = this.nazev_profese;
  9276.  
  9277. }
  9278.  
  9279. private String readString(ObjectInputStream dis) throws IOException {
  9280. String strReturn = null;
  9281. int length = 0;
  9282. length = dis.readInt();
  9283. if (length == -1) {
  9284. strReturn = null;
  9285. } else {
  9286. if (length > commonByteArray_BI_FACT_snimek_dochazky.length) {
  9287. if (length < 1024
  9288. && commonByteArray_BI_FACT_snimek_dochazky.length == 0) {
  9289. commonByteArray_BI_FACT_snimek_dochazky = new byte[1024];
  9290. } else {
  9291. commonByteArray_BI_FACT_snimek_dochazky = new byte[2 * length];
  9292. }
  9293. }
  9294. dis.readFully(commonByteArray_BI_FACT_snimek_dochazky, 0,
  9295. length);
  9296. strReturn = new String(commonByteArray_BI_FACT_snimek_dochazky,
  9297. 0, length, utf8Charset);
  9298. }
  9299. return strReturn;
  9300. }
  9301.  
  9302. private void writeString(String str, ObjectOutputStream dos)
  9303. throws IOException {
  9304. if (str == null) {
  9305. dos.writeInt(-1);
  9306. } else {
  9307. byte[] byteArray = str.getBytes(utf8Charset);
  9308. dos.writeInt(byteArray.length);
  9309. dos.write(byteArray);
  9310. }
  9311. }
  9312.  
  9313. public void readKeysData(ObjectInputStream dis) {
  9314.  
  9315. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  9316.  
  9317. try {
  9318.  
  9319. int length = 0;
  9320.  
  9321. this.nazev_profese = readString(dis);
  9322.  
  9323. } catch (IOException e) {
  9324. throw new RuntimeException(e);
  9325.  
  9326. }
  9327.  
  9328. }
  9329.  
  9330. }
  9331.  
  9332. public void writeKeysData(ObjectOutputStream dos) {
  9333. try {
  9334.  
  9335. // String
  9336.  
  9337. writeString(this.nazev_profese, dos);
  9338.  
  9339. } catch (IOException e) {
  9340. throw new RuntimeException(e);
  9341. }
  9342.  
  9343. }
  9344.  
  9345. /**
  9346. * Fill Values data by reading ObjectInputStream.
  9347. */
  9348. public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
  9349. try {
  9350.  
  9351. int length = 0;
  9352.  
  9353. this.idsazby = dis.readInt();
  9354.  
  9355. this.cislo_sazby = dis.readInt();
  9356.  
  9357. this.hodinova_sazba = dis.readInt();
  9358.  
  9359. } catch (IOException e) {
  9360. throw new RuntimeException(e);
  9361.  
  9362. }
  9363.  
  9364. }
  9365.  
  9366. /**
  9367. * Return a byte array which represents Values data.
  9368. */
  9369. public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
  9370. try {
  9371.  
  9372. dos.writeInt(this.idsazby);
  9373.  
  9374. dos.writeInt(this.cislo_sazby);
  9375.  
  9376. dos.writeInt(this.hodinova_sazba);
  9377.  
  9378. } catch (IOException e) {
  9379. throw new RuntimeException(e);
  9380. }
  9381.  
  9382. }
  9383.  
  9384. public String toString() {
  9385.  
  9386. StringBuilder sb = new StringBuilder();
  9387. sb.append(super.toString());
  9388. sb.append("[");
  9389. sb.append("idsazby=" + String.valueOf(idsazby));
  9390. sb.append(",cislo_sazby=" + String.valueOf(cislo_sazby));
  9391. sb.append(",nazev_profese=" + nazev_profese);
  9392. sb.append(",hodinova_sazba=" + String.valueOf(hodinova_sazba));
  9393. sb.append("]");
  9394.  
  9395. return sb.toString();
  9396. }
  9397.  
  9398. /**
  9399. * Compare keys
  9400. */
  9401. public int compareTo(row8Struct other) {
  9402.  
  9403. int returnValue = -1;
  9404.  
  9405. returnValue = checkNullsAndCompare(this.nazev_profese,
  9406. other.nazev_profese);
  9407. if (returnValue != 0) {
  9408. return returnValue;
  9409. }
  9410.  
  9411. return returnValue;
  9412. }
  9413.  
  9414. private int checkNullsAndCompare(Object object1, Object object2) {
  9415. int returnValue = 0;
  9416. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  9417. returnValue = ((Comparable) object1).compareTo(object2);
  9418. } else if (object1 != null && object2 != null) {
  9419. returnValue = compareStrings(object1.toString(),
  9420. object2.toString());
  9421. } else if (object1 == null && object2 != null) {
  9422. returnValue = 1;
  9423. } else if (object1 != null && object2 == null) {
  9424. returnValue = -1;
  9425. } else {
  9426. returnValue = 0;
  9427. }
  9428.  
  9429. return returnValue;
  9430. }
  9431.  
  9432. private int compareStrings(String string1, String string2) {
  9433. return string1.compareTo(string2);
  9434. }
  9435.  
  9436. }
  9437.  
  9438. public void tDBInput_9Process(final java.util.Map<String, Object> globalMap)
  9439. throws TalendException {
  9440. globalMap.put("tDBInput_9_SUBPROCESS_STATE", 0);
  9441.  
  9442. final boolean execStat = this.execStat;
  9443.  
  9444. String iterateId = "";
  9445.  
  9446. String currentComponent = "";
  9447. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  9448.  
  9449. try {
  9450. // TDI-39566 avoid throwing an useless Exception
  9451. boolean resumeIt = true;
  9452. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  9453. String currentMethodName = new java.lang.Exception()
  9454. .getStackTrace()[0].getMethodName();
  9455. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  9456. }
  9457. if (resumeIt || globalResumeTicket) { // start the resume
  9458. globalResumeTicket = true;
  9459.  
  9460. row8Struct row8 = new row8Struct();
  9461.  
  9462. /**
  9463. * [tAdvancedHash_row8 begin ] start
  9464. */
  9465.  
  9466. ok_Hash.put("tAdvancedHash_row8", false);
  9467. start_Hash
  9468. .put("tAdvancedHash_row8", System.currentTimeMillis());
  9469.  
  9470. currentComponent = "tAdvancedHash_row8";
  9471.  
  9472. if (execStat) {
  9473. if (resourceMap.get("inIterateVComp") == null) {
  9474.  
  9475. runStat.updateStatOnConnection("row8" + iterateId, 0, 0);
  9476.  
  9477. }
  9478. }
  9479.  
  9480. int tos_count_tAdvancedHash_row8 = 0;
  9481.  
  9482. // connection name:row8
  9483. // source node:tDBInput_9 - inputs:(after_tDBInput_6)
  9484. // outputs:(row8,row8) | target node:tAdvancedHash_row8 -
  9485. // inputs:(row8) outputs:()
  9486. // linked node: tMap_2 -
  9487. // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
  9488. // outputs:(out2)
  9489.  
  9490. org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row8 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
  9491.  
  9492. org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row8Struct> tHash_Lookup_row8 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
  9493. .<row8Struct> getLookup(matchingModeEnum_row8);
  9494.  
  9495. globalMap.put("tHash_Lookup_row8", tHash_Lookup_row8);
  9496.  
  9497. /**
  9498. * [tAdvancedHash_row8 begin ] stop
  9499. */
  9500.  
  9501. /**
  9502. * [tDBInput_9 begin ] start
  9503. */
  9504.  
  9505. ok_Hash.put("tDBInput_9", false);
  9506. start_Hash.put("tDBInput_9", System.currentTimeMillis());
  9507.  
  9508. currentComponent = "tDBInput_9";
  9509.  
  9510. int tos_count_tDBInput_9 = 0;
  9511.  
  9512. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_9 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  9513. .getMSSqlGenerateTimestampUtil();
  9514.  
  9515. java.util.List<String> talendToDBList_tDBInput_9 = new java.util.ArrayList();
  9516. String[] talendToDBArray_tDBInput_9 = new String[] { "FLOAT",
  9517. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  9518. "DECIMAL IDENTITY", "REAL" };
  9519. java.util.Collections.addAll(talendToDBList_tDBInput_9,
  9520. talendToDBArray_tDBInput_9);
  9521. int nb_line_tDBInput_9 = 0;
  9522. java.sql.Connection conn_tDBInput_9 = null;
  9523. String driverClass_tDBInput_9 = "net.sourceforge.jtds.jdbc.Driver";
  9524. java.lang.Class.forName(driverClass_tDBInput_9);
  9525. String dbUser_tDBInput_9 = "tym1";
  9526.  
  9527. final String decryptedPassword_tDBInput_9 = routines.system.PasswordEncryptUtil
  9528. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  9529.  
  9530. String dbPwd_tDBInput_9 = decryptedPassword_tDBInput_9;
  9531.  
  9532. String port_tDBInput_9 = "1433";
  9533. String dbname_tDBInput_9 = "tym1";
  9534. String url_tDBInput_9 = "jdbc:jtds:sqlserver://"
  9535. + "158.196.160.60";
  9536. if (!"".equals(port_tDBInput_9)) {
  9537. url_tDBInput_9 += ":" + "1433";
  9538. }
  9539. if (!"".equals(dbname_tDBInput_9)) {
  9540. url_tDBInput_9 += "//" + "tym1";
  9541. }
  9542. url_tDBInput_9 += ";appName=" + projectName + ";" + "";
  9543. String dbschema_tDBInput_9 = "";
  9544.  
  9545. conn_tDBInput_9 = java.sql.DriverManager.getConnection(
  9546. url_tDBInput_9, dbUser_tDBInput_9, dbPwd_tDBInput_9);
  9547.  
  9548. java.sql.Statement stmt_tDBInput_9 = conn_tDBInput_9
  9549. .createStatement();
  9550.  
  9551. 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"
  9552. + "odinova_sazba\nFROM DIM_mzdove_sazby";
  9553.  
  9554. globalMap.put("tDBInput_9_QUERY", dbquery_tDBInput_9);
  9555. java.sql.ResultSet rs_tDBInput_9 = null;
  9556.  
  9557. try {
  9558. rs_tDBInput_9 = stmt_tDBInput_9
  9559. .executeQuery(dbquery_tDBInput_9);
  9560. java.sql.ResultSetMetaData rsmd_tDBInput_9 = rs_tDBInput_9
  9561. .getMetaData();
  9562. int colQtyInRs_tDBInput_9 = rsmd_tDBInput_9
  9563. .getColumnCount();
  9564.  
  9565. String tmpContent_tDBInput_9 = null;
  9566.  
  9567. while (rs_tDBInput_9.next()) {
  9568. nb_line_tDBInput_9++;
  9569.  
  9570. if (colQtyInRs_tDBInput_9 < 1) {
  9571. row8.idsazby = 0;
  9572. } else {
  9573.  
  9574. if (rs_tDBInput_9.getObject(1) != null) {
  9575. row8.idsazby = rs_tDBInput_9.getInt(1);
  9576. } else {
  9577. throw new RuntimeException(
  9578. "Null value in non-Nullable column");
  9579. }
  9580. }
  9581. if (colQtyInRs_tDBInput_9 < 2) {
  9582. row8.cislo_sazby = 0;
  9583. } else {
  9584.  
  9585. if (rs_tDBInput_9.getObject(2) != null) {
  9586. row8.cislo_sazby = rs_tDBInput_9.getInt(2);
  9587. } else {
  9588. throw new RuntimeException(
  9589. "Null value in non-Nullable column");
  9590. }
  9591. }
  9592. if (colQtyInRs_tDBInput_9 < 3) {
  9593. row8.nazev_profese = null;
  9594. } else {
  9595.  
  9596. tmpContent_tDBInput_9 = rs_tDBInput_9.getString(3);
  9597. if (tmpContent_tDBInput_9 != null) {
  9598. if (talendToDBList_tDBInput_9
  9599. .contains(rsmd_tDBInput_9
  9600. .getColumnTypeName(3)
  9601. .toUpperCase(
  9602. java.util.Locale.ENGLISH))) {
  9603. row8.nazev_profese = FormatterUtils
  9604. .formatUnwithE(tmpContent_tDBInput_9);
  9605. } else {
  9606. row8.nazev_profese = tmpContent_tDBInput_9;
  9607. }
  9608. } else {
  9609. row8.nazev_profese = null;
  9610. }
  9611. }
  9612. if (colQtyInRs_tDBInput_9 < 4) {
  9613. row8.hodinova_sazba = 0;
  9614. } else {
  9615.  
  9616. if (rs_tDBInput_9.getObject(4) != null) {
  9617. row8.hodinova_sazba = rs_tDBInput_9.getInt(4);
  9618. } else {
  9619. throw new RuntimeException(
  9620. "Null value in non-Nullable column");
  9621. }
  9622. }
  9623.  
  9624. /**
  9625. * [tDBInput_9 begin ] stop
  9626. */
  9627.  
  9628. /**
  9629. * [tDBInput_9 main ] start
  9630. */
  9631.  
  9632. currentComponent = "tDBInput_9";
  9633.  
  9634. tos_count_tDBInput_9++;
  9635.  
  9636. /**
  9637. * [tDBInput_9 main ] stop
  9638. */
  9639.  
  9640. /**
  9641. * [tDBInput_9 process_data_begin ] start
  9642. */
  9643.  
  9644. currentComponent = "tDBInput_9";
  9645.  
  9646. /**
  9647. * [tDBInput_9 process_data_begin ] stop
  9648. */
  9649.  
  9650. /**
  9651. * [tAdvancedHash_row8 main ] start
  9652. */
  9653.  
  9654. currentComponent = "tAdvancedHash_row8";
  9655.  
  9656. // row8
  9657. // row8
  9658.  
  9659. if (execStat) {
  9660. runStat.updateStatOnConnection("row8" + iterateId,
  9661. 1, 1);
  9662. }
  9663.  
  9664. row8Struct row8_HashRow = new row8Struct();
  9665.  
  9666. row8_HashRow.idsazby = row8.idsazby;
  9667.  
  9668. row8_HashRow.cislo_sazby = row8.cislo_sazby;
  9669.  
  9670. row8_HashRow.nazev_profese = row8.nazev_profese;
  9671.  
  9672. row8_HashRow.hodinova_sazba = row8.hodinova_sazba;
  9673.  
  9674. tHash_Lookup_row8.put(row8_HashRow);
  9675.  
  9676. tos_count_tAdvancedHash_row8++;
  9677.  
  9678. /**
  9679. * [tAdvancedHash_row8 main ] stop
  9680. */
  9681.  
  9682. /**
  9683. * [tAdvancedHash_row8 process_data_begin ] start
  9684. */
  9685.  
  9686. currentComponent = "tAdvancedHash_row8";
  9687.  
  9688. /**
  9689. * [tAdvancedHash_row8 process_data_begin ] stop
  9690. */
  9691.  
  9692. /**
  9693. * [tAdvancedHash_row8 process_data_end ] start
  9694. */
  9695.  
  9696. currentComponent = "tAdvancedHash_row8";
  9697.  
  9698. /**
  9699. * [tAdvancedHash_row8 process_data_end ] stop
  9700. */
  9701.  
  9702. /**
  9703. * [tDBInput_9 process_data_end ] start
  9704. */
  9705.  
  9706. currentComponent = "tDBInput_9";
  9707.  
  9708. /**
  9709. * [tDBInput_9 process_data_end ] stop
  9710. */
  9711.  
  9712. /**
  9713. * [tDBInput_9 end ] start
  9714. */
  9715.  
  9716. currentComponent = "tDBInput_9";
  9717.  
  9718. }
  9719. } finally {
  9720. if (rs_tDBInput_9 != null) {
  9721. rs_tDBInput_9.close();
  9722. }
  9723. if (stmt_tDBInput_9 != null) {
  9724. stmt_tDBInput_9.close();
  9725. }
  9726. if (conn_tDBInput_9 != null && !conn_tDBInput_9.isClosed()) {
  9727.  
  9728. conn_tDBInput_9.close();
  9729.  
  9730. }
  9731. }
  9732. globalMap.put("tDBInput_9_NB_LINE", nb_line_tDBInput_9);
  9733.  
  9734. ok_Hash.put("tDBInput_9", true);
  9735. end_Hash.put("tDBInput_9", System.currentTimeMillis());
  9736.  
  9737. /**
  9738. * [tDBInput_9 end ] stop
  9739. */
  9740.  
  9741. /**
  9742. * [tAdvancedHash_row8 end ] start
  9743. */
  9744.  
  9745. currentComponent = "tAdvancedHash_row8";
  9746.  
  9747. tHash_Lookup_row8.endPut();
  9748.  
  9749. if (execStat) {
  9750. if (resourceMap.get("inIterateVComp") == null
  9751. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  9752. runStat.updateStatOnConnection("row8" + iterateId, 2, 0);
  9753. }
  9754. }
  9755.  
  9756. ok_Hash.put("tAdvancedHash_row8", true);
  9757. end_Hash.put("tAdvancedHash_row8", System.currentTimeMillis());
  9758.  
  9759. /**
  9760. * [tAdvancedHash_row8 end ] stop
  9761. */
  9762.  
  9763. }// end the resume
  9764.  
  9765. } catch (java.lang.Exception e) {
  9766.  
  9767. TalendException te = new TalendException(e, currentComponent,
  9768. globalMap);
  9769.  
  9770. throw te;
  9771. } catch (java.lang.Error error) {
  9772.  
  9773. runStat.stopThreadStat();
  9774.  
  9775. throw error;
  9776. } finally {
  9777.  
  9778. try {
  9779.  
  9780. /**
  9781. * [tDBInput_9 finally ] start
  9782. */
  9783.  
  9784. currentComponent = "tDBInput_9";
  9785.  
  9786. /**
  9787. * [tDBInput_9 finally ] stop
  9788. */
  9789.  
  9790. /**
  9791. * [tAdvancedHash_row8 finally ] start
  9792. */
  9793.  
  9794. currentComponent = "tAdvancedHash_row8";
  9795.  
  9796. /**
  9797. * [tAdvancedHash_row8 finally ] stop
  9798. */
  9799.  
  9800. } catch (java.lang.Exception e) {
  9801. // ignore
  9802. } catch (java.lang.Error error) {
  9803. // ignore
  9804. }
  9805. resourceMap = null;
  9806. }
  9807.  
  9808. globalMap.put("tDBInput_9_SUBPROCESS_STATE", 1);
  9809. }
  9810.  
  9811. public static class row9Struct implements
  9812. routines.system.IPersistableComparableLookupRow<row9Struct> {
  9813. final static byte[] commonByteArrayLock_BI_FACT_snimek_dochazky = new byte[0];
  9814. static byte[] commonByteArray_BI_FACT_snimek_dochazky = new byte[0];
  9815. protected static final int DEFAULT_HASHCODE = 1;
  9816. protected static final int PRIME = 31;
  9817. protected int hashCode = DEFAULT_HASHCODE;
  9818. public boolean hashCodeDirty = true;
  9819.  
  9820. public String loopKey;
  9821.  
  9822. public int idpracoviste;
  9823.  
  9824. public int getIdpracoviste() {
  9825. return this.idpracoviste;
  9826. }
  9827.  
  9828. public int cislo_pracoviste;
  9829.  
  9830. public int getCislo_pracoviste() {
  9831. return this.cislo_pracoviste;
  9832. }
  9833.  
  9834. public String nazev_pracoviste;
  9835.  
  9836. public String getNazev_pracoviste() {
  9837. return this.nazev_pracoviste;
  9838. }
  9839.  
  9840. @Override
  9841. public int hashCode() {
  9842. if (this.hashCodeDirty) {
  9843. final int prime = PRIME;
  9844. int result = DEFAULT_HASHCODE;
  9845.  
  9846. result = prime * result + (int) this.cislo_pracoviste;
  9847.  
  9848. this.hashCode = result;
  9849. this.hashCodeDirty = false;
  9850. }
  9851. return this.hashCode;
  9852. }
  9853.  
  9854. @Override
  9855. public boolean equals(Object obj) {
  9856. if (this == obj)
  9857. return true;
  9858. if (obj == null)
  9859. return false;
  9860. if (getClass() != obj.getClass())
  9861. return false;
  9862. final row9Struct other = (row9Struct) obj;
  9863.  
  9864. if (this.cislo_pracoviste != other.cislo_pracoviste)
  9865. return false;
  9866.  
  9867. return true;
  9868. }
  9869.  
  9870. public void copyDataTo(row9Struct other) {
  9871.  
  9872. other.idpracoviste = this.idpracoviste;
  9873. other.cislo_pracoviste = this.cislo_pracoviste;
  9874. other.nazev_pracoviste = this.nazev_pracoviste;
  9875.  
  9876. }
  9877.  
  9878. public void copyKeysDataTo(row9Struct other) {
  9879.  
  9880. other.cislo_pracoviste = this.cislo_pracoviste;
  9881.  
  9882. }
  9883.  
  9884. private String readString(DataInputStream dis, ObjectInputStream ois)
  9885. throws IOException {
  9886. String strReturn = null;
  9887. int length = 0;
  9888. length = dis.readInt();
  9889. if (length == -1) {
  9890. strReturn = null;
  9891. } else {
  9892. byte[] byteArray = new byte[length];
  9893. dis.read(byteArray);
  9894. strReturn = new String(byteArray, utf8Charset);
  9895. }
  9896. return strReturn;
  9897. }
  9898.  
  9899. private void writeString(String str, DataOutputStream dos,
  9900. ObjectOutputStream oos) throws IOException {
  9901. if (str == null) {
  9902. dos.writeInt(-1);
  9903. } else {
  9904. byte[] byteArray = str.getBytes(utf8Charset);
  9905. dos.writeInt(byteArray.length);
  9906. dos.write(byteArray);
  9907. }
  9908. }
  9909.  
  9910. public void readKeysData(ObjectInputStream dis) {
  9911.  
  9912. synchronized (commonByteArrayLock_BI_FACT_snimek_dochazky) {
  9913.  
  9914. try {
  9915.  
  9916. int length = 0;
  9917.  
  9918. this.cislo_pracoviste = dis.readInt();
  9919.  
  9920. } catch (IOException e) {
  9921. throw new RuntimeException(e);
  9922.  
  9923. }
  9924.  
  9925. }
  9926.  
  9927. }
  9928.  
  9929. public void writeKeysData(ObjectOutputStream dos) {
  9930. try {
  9931.  
  9932. // int
  9933.  
  9934. dos.writeInt(this.cislo_pracoviste);
  9935.  
  9936. } catch (IOException e) {
  9937. throw new RuntimeException(e);
  9938. }
  9939.  
  9940. }
  9941.  
  9942. /**
  9943. * Fill Values data by reading ObjectInputStream.
  9944. */
  9945. public void readValuesData(DataInputStream dis, ObjectInputStream ois) {
  9946. try {
  9947.  
  9948. int length = 0;
  9949.  
  9950. this.idpracoviste = dis.readInt();
  9951.  
  9952. this.nazev_pracoviste = readString(dis, ois);
  9953.  
  9954. } catch (IOException e) {
  9955. throw new RuntimeException(e);
  9956.  
  9957. }
  9958.  
  9959. }
  9960.  
  9961. /**
  9962. * Return a byte array which represents Values data.
  9963. */
  9964. public void writeValuesData(DataOutputStream dos, ObjectOutputStream oos) {
  9965. try {
  9966.  
  9967. dos.writeInt(this.idpracoviste);
  9968.  
  9969. writeString(this.nazev_pracoviste, dos, oos);
  9970.  
  9971. } catch (IOException e) {
  9972. throw new RuntimeException(e);
  9973. }
  9974.  
  9975. }
  9976.  
  9977. public String toString() {
  9978.  
  9979. StringBuilder sb = new StringBuilder();
  9980. sb.append(super.toString());
  9981. sb.append("[");
  9982. sb.append("idpracoviste=" + String.valueOf(idpracoviste));
  9983. sb.append(",cislo_pracoviste=" + String.valueOf(cislo_pracoviste));
  9984. sb.append(",nazev_pracoviste=" + nazev_pracoviste);
  9985. sb.append("]");
  9986.  
  9987. return sb.toString();
  9988. }
  9989.  
  9990. /**
  9991. * Compare keys
  9992. */
  9993. public int compareTo(row9Struct other) {
  9994.  
  9995. int returnValue = -1;
  9996.  
  9997. returnValue = checkNullsAndCompare(this.cislo_pracoviste,
  9998. other.cislo_pracoviste);
  9999. if (returnValue != 0) {
  10000. return returnValue;
  10001. }
  10002.  
  10003. return returnValue;
  10004. }
  10005.  
  10006. private int checkNullsAndCompare(Object object1, Object object2) {
  10007. int returnValue = 0;
  10008. if (object1 instanceof Comparable && object2 instanceof Comparable) {
  10009. returnValue = ((Comparable) object1).compareTo(object2);
  10010. } else if (object1 != null && object2 != null) {
  10011. returnValue = compareStrings(object1.toString(),
  10012. object2.toString());
  10013. } else if (object1 == null && object2 != null) {
  10014. returnValue = 1;
  10015. } else if (object1 != null && object2 == null) {
  10016. returnValue = -1;
  10017. } else {
  10018. returnValue = 0;
  10019. }
  10020.  
  10021. return returnValue;
  10022. }
  10023.  
  10024. private int compareStrings(String string1, String string2) {
  10025. return string1.compareTo(string2);
  10026. }
  10027.  
  10028. }
  10029.  
  10030. public void tDBInput_10Process(final java.util.Map<String, Object> globalMap)
  10031. throws TalendException {
  10032. globalMap.put("tDBInput_10_SUBPROCESS_STATE", 0);
  10033.  
  10034. final boolean execStat = this.execStat;
  10035.  
  10036. String iterateId = "";
  10037.  
  10038. String currentComponent = "";
  10039. java.util.Map<String, Object> resourceMap = new java.util.HashMap<String, Object>();
  10040.  
  10041. try {
  10042. // TDI-39566 avoid throwing an useless Exception
  10043. boolean resumeIt = true;
  10044. if (globalResumeTicket == false && resumeEntryMethodName != null) {
  10045. String currentMethodName = new java.lang.Exception()
  10046. .getStackTrace()[0].getMethodName();
  10047. resumeIt = resumeEntryMethodName.equals(currentMethodName);
  10048. }
  10049. if (resumeIt || globalResumeTicket) { // start the resume
  10050. globalResumeTicket = true;
  10051.  
  10052. row9Struct row9 = new row9Struct();
  10053.  
  10054. /**
  10055. * [tAdvancedHash_row9 begin ] start
  10056. */
  10057.  
  10058. ok_Hash.put("tAdvancedHash_row9", false);
  10059. start_Hash
  10060. .put("tAdvancedHash_row9", System.currentTimeMillis());
  10061.  
  10062. currentComponent = "tAdvancedHash_row9";
  10063.  
  10064. if (execStat) {
  10065. if (resourceMap.get("inIterateVComp") == null) {
  10066.  
  10067. runStat.updateStatOnConnection("row9" + iterateId, 0, 0);
  10068.  
  10069. }
  10070. }
  10071.  
  10072. int tos_count_tAdvancedHash_row9 = 0;
  10073.  
  10074. // connection name:row9
  10075. // source node:tDBInput_10 - inputs:(after_tDBInput_6)
  10076. // outputs:(row9,row9) | target node:tAdvancedHash_row9 -
  10077. // inputs:(row9) outputs:()
  10078. // linked node: tMap_2 -
  10079. // inputs:(zamestnanec,row11,row5,row4,row6,row7,row8,row9)
  10080. // outputs:(out2)
  10081.  
  10082. org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE matchingModeEnum_row9 = org.talend.designer.components.lookup.common.ICommonLookup.MATCHING_MODE.UNIQUE_MATCH;
  10083.  
  10084. org.talend.designer.components.lookup.memory.AdvancedMemoryLookup<row9Struct> tHash_Lookup_row9 = org.talend.designer.components.lookup.memory.AdvancedMemoryLookup
  10085. .<row9Struct> getLookup(matchingModeEnum_row9);
  10086.  
  10087. globalMap.put("tHash_Lookup_row9", tHash_Lookup_row9);
  10088.  
  10089. /**
  10090. * [tAdvancedHash_row9 begin ] stop
  10091. */
  10092.  
  10093. /**
  10094. * [tDBInput_10 begin ] start
  10095. */
  10096.  
  10097. ok_Hash.put("tDBInput_10", false);
  10098. start_Hash.put("tDBInput_10", System.currentTimeMillis());
  10099.  
  10100. currentComponent = "tDBInput_10";
  10101.  
  10102. int tos_count_tDBInput_10 = 0;
  10103.  
  10104. org.talend.designer.components.util.mssql.MSSqlGenerateTimestampUtil mssqlGTU_tDBInput_10 = org.talend.designer.components.util.mssql.MSSqlUtilFactory
  10105. .getMSSqlGenerateTimestampUtil();
  10106.  
  10107. java.util.List<String> talendToDBList_tDBInput_10 = new java.util.ArrayList();
  10108. String[] talendToDBArray_tDBInput_10 = new String[] { "FLOAT",
  10109. "NUMERIC", "NUMERIC IDENTITY", "DECIMAL",
  10110. "DECIMAL IDENTITY", "REAL" };
  10111. java.util.Collections.addAll(talendToDBList_tDBInput_10,
  10112. talendToDBArray_tDBInput_10);
  10113. int nb_line_tDBInput_10 = 0;
  10114. java.sql.Connection conn_tDBInput_10 = null;
  10115. String driverClass_tDBInput_10 = "net.sourceforge.jtds.jdbc.Driver";
  10116. java.lang.Class.forName(driverClass_tDBInput_10);
  10117. String dbUser_tDBInput_10 = "tym1";
  10118.  
  10119. final String decryptedPassword_tDBInput_10 = routines.system.PasswordEncryptUtil
  10120. .decryptPassword("5878b3fbd98ef22e57fa75971bddfaf2");
  10121.  
  10122. String dbPwd_tDBInput_10 = decryptedPassword_tDBInput_10;
  10123.  
  10124. String port_tDBInput_10 = "1433";
  10125. String dbname_tDBInput_10 = "tym1";
  10126. String url_tDBInput_10 = "jdbc:jtds:sqlserver://"
  10127. + "158.196.160.60";
  10128. if (!"".equals(port_tDBInput_10)) {
  10129. url_tDBInput_10 += ":" + "1433";
  10130. }
  10131. if (!"".equals(dbname_tDBInput_10)) {
  10132. url_tDBInput_10 += "//" + "tym1";
  10133. }
  10134. url_tDBInput_10 += ";appName=" + projectName + ";" + "";
  10135. String dbschema_tDBInput_10 = "";
  10136.  
  10137. conn_tDBInput_10 = java.sql.DriverManager.getConnection(
  10138. url_tDBInput_10, dbUser_tDBInput_10, dbPwd_tDBInput_10);
  10139.  
  10140. java.sql.Statement stmt_tDBInput_10 = conn_tDBInput_10
  10141. .createStatement();
  10142.  
  10143. String dbquery_tDBInput_10 = "SELECT DIM_pracoviste.idpracoviste,\n DIM_pracoviste.cislo_pracoviste,\n DIM_pracoviste.nazev_pracoviste\nFROM DIM_praco"
  10144. + "viste";
  10145.  
  10146. globalMap.put("tDBInput_10_QUERY", dbquery_tDBInput_10);
  10147. java.sql.ResultSet rs_tDBInput_10 = null;
  10148.  
  10149. try {
  10150. rs_tDBInput_10 = stmt_tDBInput_10
  10151. .executeQuery(dbquery_tDBInput_10);
  10152. java.sql.ResultSetMetaData rsmd_tDBInput_10 = rs_tDBInput_10
  10153. .getMetaData();
  10154. int colQtyInRs_tDBInput_10 = rsmd_tDBInput_10
  10155. .getColumnCount();
  10156.  
  10157. String tmpContent_tDBInput_10 = null;
  10158.  
  10159. while (rs_tDBInput_10.next()) {
  10160. nb_line_tDBInput_10++;
  10161.  
  10162. if (colQtyInRs_tDBInput_10 < 1) {
  10163. row9.idpracoviste = 0;
  10164. } else {
  10165.  
  10166. if (rs_tDBInput_10.getObject(1) != null) {
  10167. row9.idpracoviste = rs_tDBInput_10.getInt(1);
  10168. } else {
  10169. throw new RuntimeException(
  10170. "Null value in non-Nullable column");
  10171. }
  10172. }
  10173. if (colQtyInRs_tDBInput_10 < 2) {
  10174. row9.cislo_pracoviste = 0;
  10175. } else {
  10176.  
  10177. if (rs_tDBInput_10.getObject(2) != null) {
  10178. row9.cislo_pracoviste = rs_tDBInput_10
  10179. .getInt(2);
  10180. } else {
  10181. throw new RuntimeException(
  10182. "Null value in non-Nullable column");
  10183. }
  10184. }
  10185. if (colQtyInRs_tDBInput_10 < 3) {
  10186. row9.nazev_pracoviste = null;
  10187. } else {
  10188.  
  10189. tmpContent_tDBInput_10 = rs_tDBInput_10
  10190. .getString(3);
  10191. if (tmpContent_tDBInput_10 != null) {
  10192. if (talendToDBList_tDBInput_10
  10193. .contains(rsmd_tDBInput_10
  10194. .getColumnTypeName(3)
  10195. .toUpperCase(
  10196. java.util.Locale.ENGLISH))) {
  10197. row9.nazev_pracoviste = FormatterUtils
  10198. .formatUnwithE(tmpContent_tDBInput_10);
  10199. } else {
  10200. row9.nazev_pracoviste = tmpContent_tDBInput_10;
  10201. }
  10202. } else {
  10203. row9.nazev_pracoviste = null;
  10204. }
  10205. }
  10206.  
  10207. /**
  10208. * [tDBInput_10 begin ] stop
  10209. */
  10210.  
  10211. /**
  10212. * [tDBInput_10 main ] start
  10213. */
  10214.  
  10215. currentComponent = "tDBInput_10";
  10216.  
  10217. tos_count_tDBInput_10++;
  10218.  
  10219. /**
  10220. * [tDBInput_10 main ] stop
  10221. */
  10222.  
  10223. /**
  10224. * [tDBInput_10 process_data_begin ] start
  10225. */
  10226.  
  10227. currentComponent = "tDBInput_10";
  10228.  
  10229. /**
  10230. * [tDBInput_10 process_data_begin ] stop
  10231. */
  10232.  
  10233. /**
  10234. * [tAdvancedHash_row9 main ] start
  10235. */
  10236.  
  10237. currentComponent = "tAdvancedHash_row9";
  10238.  
  10239. // row9
  10240. // row9
  10241.  
  10242. if (execStat) {
  10243. runStat.updateStatOnConnection("row9" + iterateId,
  10244. 1, 1);
  10245. }
  10246.  
  10247. row9Struct row9_HashRow = new row9Struct();
  10248.  
  10249. row9_HashRow.idpracoviste = row9.idpracoviste;
  10250.  
  10251. row9_HashRow.cislo_pracoviste = row9.cislo_pracoviste;
  10252.  
  10253. row9_HashRow.nazev_pracoviste = row9.nazev_pracoviste;
  10254.  
  10255. tHash_Lookup_row9.put(row9_HashRow);
  10256.  
  10257. tos_count_tAdvancedHash_row9++;
  10258.  
  10259. /**
  10260. * [tAdvancedHash_row9 main ] stop
  10261. */
  10262.  
  10263. /**
  10264. * [tAdvancedHash_row9 process_data_begin ] start
  10265. */
  10266.  
  10267. currentComponent = "tAdvancedHash_row9";
  10268.  
  10269. /**
  10270. * [tAdvancedHash_row9 process_data_begin ] stop
  10271. */
  10272.  
  10273. /**
  10274. * [tAdvancedHash_row9 process_data_end ] start
  10275. */
  10276.  
  10277. currentComponent = "tAdvancedHash_row9";
  10278.  
  10279. /**
  10280. * [tAdvancedHash_row9 process_data_end ] stop
  10281. */
  10282.  
  10283. /**
  10284. * [tDBInput_10 process_data_end ] start
  10285. */
  10286.  
  10287. currentComponent = "tDBInput_10";
  10288.  
  10289. /**
  10290. * [tDBInput_10 process_data_end ] stop
  10291. */
  10292.  
  10293. /**
  10294. * [tDBInput_10 end ] start
  10295. */
  10296.  
  10297. currentComponent = "tDBInput_10";
  10298.  
  10299. }
  10300. } finally {
  10301. if (rs_tDBInput_10 != null) {
  10302. rs_tDBInput_10.close();
  10303. }
  10304. if (stmt_tDBInput_10 != null) {
  10305. stmt_tDBInput_10.close();
  10306. }
  10307. if (conn_tDBInput_10 != null
  10308. && !conn_tDBInput_10.isClosed()) {
  10309.  
  10310. conn_tDBInput_10.close();
  10311.  
  10312. }
  10313. }
  10314. globalMap.put("tDBInput_10_NB_LINE", nb_line_tDBInput_10);
  10315.  
  10316. ok_Hash.put("tDBInput_10", true);
  10317. end_Hash.put("tDBInput_10", System.currentTimeMillis());
  10318.  
  10319. /**
  10320. * [tDBInput_10 end ] stop
  10321. */
  10322.  
  10323. /**
  10324. * [tAdvancedHash_row9 end ] start
  10325. */
  10326.  
  10327. currentComponent = "tAdvancedHash_row9";
  10328.  
  10329. tHash_Lookup_row9.endPut();
  10330.  
  10331. if (execStat) {
  10332. if (resourceMap.get("inIterateVComp") == null
  10333. || !((Boolean) resourceMap.get("inIterateVComp"))) {
  10334. runStat.updateStatOnConnection("row9" + iterateId, 2, 0);
  10335. }
  10336. }
  10337.  
  10338. ok_Hash.put("tAdvancedHash_row9", true);
  10339. end_Hash.put("tAdvancedHash_row9", System.currentTimeMillis());
  10340.  
  10341. /**
  10342. * [tAdvancedHash_row9 end ] stop
  10343. */
  10344.  
  10345. }// end the resume
  10346.  
  10347. } catch (java.lang.Exception e) {
  10348.  
  10349. TalendException te = new TalendException(e, currentComponent,
  10350. globalMap);
  10351.  
  10352. throw te;
  10353. } catch (java.lang.Error error) {
  10354.  
  10355. runStat.stopThreadStat();
  10356.  
  10357. throw error;
  10358. } finally {
  10359.  
  10360. try {
  10361.  
  10362. /**
  10363. * [tDBInput_10 finally ] start
  10364. */
  10365.  
  10366. currentComponent = "tDBInput_10";
  10367.  
  10368. /**
  10369. * [tDBInput_10 finally ] stop
  10370. */
  10371.  
  10372. /**
  10373. * [tAdvancedHash_row9 finally ] start
  10374. */
  10375.  
  10376. currentComponent = "tAdvancedHash_row9";
  10377.  
  10378. /**
  10379. * [tAdvancedHash_row9 finally ] stop
  10380. */
  10381.  
  10382. } catch (java.lang.Exception e) {
  10383. // ignore
  10384. } catch (java.lang.Error error) {
  10385. // ignore
  10386. }
  10387. resourceMap = null;
  10388. }
  10389.  
  10390. globalMap.put("tDBInput_10_SUBPROCESS_STATE", 1);
  10391. }
  10392.  
  10393. public String resuming_logs_dir_path = null;
  10394. public String resuming_checkpoint_path = null;
  10395. public String parent_part_launcher = null;
  10396. private String resumeEntryMethodName = null;
  10397. private boolean globalResumeTicket = false;
  10398.  
  10399. public boolean watch = false;
  10400. // portStats is null, it means don't execute the statistics
  10401. public Integer portStats = null;
  10402. public int portTraces = 4334;
  10403. public String clientHost;
  10404. public String defaultClientHost = "localhost";
  10405. public String contextStr = "Default";
  10406. public boolean isDefaultContext = true;
  10407. public String pid = "0";
  10408. public String rootPid = null;
  10409. public String fatherPid = null;
  10410. public String fatherNode = null;
  10411. public long startTime = 0;
  10412. public boolean isChildJob = false;
  10413. public String log4jLevel = "";
  10414.  
  10415. private boolean execStat = true;
  10416.  
  10417. private ThreadLocal<java.util.Map<String, String>> threadLocal = new ThreadLocal<java.util.Map<String, String>>() {
  10418. protected java.util.Map<String, String> initialValue() {
  10419. java.util.Map<String, String> threadRunResultMap = new java.util.HashMap<String, String>();
  10420. threadRunResultMap.put("errorCode", null);
  10421. threadRunResultMap.put("status", "");
  10422. return threadRunResultMap;
  10423. };
  10424. };
  10425.  
  10426. private PropertiesWithType context_param = new PropertiesWithType();
  10427. public java.util.Map<String, Object> parentContextMap = new java.util.HashMap<String, Object>();
  10428.  
  10429. public String status = "";
  10430.  
  10431. public static void main(String[] args) {
  10432. final FACT_snimek_dochazky FACT_snimek_dochazkyClass = new FACT_snimek_dochazky();
  10433.  
  10434. int exitCode = FACT_snimek_dochazkyClass.runJobInTOS(args);
  10435.  
  10436. System.exit(exitCode);
  10437. }
  10438.  
  10439. public String[][] runJob(String[] args) {
  10440.  
  10441. int exitCode = runJobInTOS(args);
  10442. String[][] bufferValue = new String[][] { { Integer.toString(exitCode) } };
  10443.  
  10444. return bufferValue;
  10445. }
  10446.  
  10447. public boolean hastBufferOutputComponent() {
  10448. boolean hastBufferOutput = false;
  10449.  
  10450. return hastBufferOutput;
  10451. }
  10452.  
  10453. public int runJobInTOS(String[] args) {
  10454. // reset status
  10455. status = "";
  10456.  
  10457. String lastStr = "";
  10458. for (String arg : args) {
  10459. if (arg.equalsIgnoreCase("--context_param")) {
  10460. lastStr = arg;
  10461. } else if (lastStr.equals("")) {
  10462. evalParam(arg);
  10463. } else {
  10464. evalParam(lastStr + " " + arg);
  10465. lastStr = "";
  10466. }
  10467. }
  10468.  
  10469. if (clientHost == null) {
  10470. clientHost = defaultClientHost;
  10471. }
  10472.  
  10473. if (pid == null || "0".equals(pid)) {
  10474. pid = TalendString.getAsciiRandomString(6);
  10475. }
  10476.  
  10477. if (rootPid == null) {
  10478. rootPid = pid;
  10479. }
  10480. if (fatherPid == null) {
  10481. fatherPid = pid;
  10482. } else {
  10483. isChildJob = true;
  10484. }
  10485.  
  10486. if (portStats != null) {
  10487. // portStats = -1; //for testing
  10488. if (portStats < 0 || portStats > 65535) {
  10489. // issue:10869, the portStats is invalid, so this client socket
  10490. // can't open
  10491. System.err.println("The statistics socket port " + portStats
  10492. + " is invalid.");
  10493. execStat = false;
  10494. }
  10495. } else {
  10496. execStat = false;
  10497. }
  10498.  
  10499. try {
  10500. // call job/subjob with an existing context, like:
  10501. // --context=production. if without this parameter, there will use
  10502. // the default context instead.
  10503. java.io.InputStream inContext = FACT_snimek_dochazky.class
  10504. .getClassLoader().getResourceAsStream(
  10505. "bi/fact_snimek_dochazky_0_1/contexts/"
  10506. + contextStr + ".properties");
  10507. if (inContext == null) {
  10508. inContext = FACT_snimek_dochazky.class
  10509. .getClassLoader()
  10510. .getResourceAsStream(
  10511. "config/contexts/" + contextStr + ".properties");
  10512. }
  10513. if (inContext != null) {
  10514. // defaultProps is in order to keep the original context value
  10515. defaultProps.load(inContext);
  10516. inContext.close();
  10517. context = new ContextProperties(defaultProps);
  10518. } else if (!isDefaultContext) {
  10519. // print info and job continue to run, for case: context_param
  10520. // is not empty.
  10521. System.err.println("Could not find the context " + contextStr);
  10522. }
  10523.  
  10524. if (!context_param.isEmpty()) {
  10525. context.putAll(context_param);
  10526. // set types for params from parentJobs
  10527. for (Object key : context_param.keySet()) {
  10528. String context_key = key.toString();
  10529. String context_type = context_param
  10530. .getContextType(context_key);
  10531. context.setContextType(context_key, context_type);
  10532.  
  10533. }
  10534. }
  10535. } catch (java.io.IOException ie) {
  10536. System.err.println("Could not load context " + contextStr);
  10537. ie.printStackTrace();
  10538. }
  10539.  
  10540. // get context value from parent directly
  10541. if (parentContextMap != null && !parentContextMap.isEmpty()) {
  10542. }
  10543.  
  10544. // Resume: init the resumeUtil
  10545. resumeEntryMethodName = ResumeUtil
  10546. .getResumeEntryMethodName(resuming_checkpoint_path);
  10547. resumeUtil = new ResumeUtil(resuming_logs_dir_path, isChildJob, rootPid);
  10548. resumeUtil.initCommonInfo(pid, rootPid, fatherPid, projectName,
  10549. jobName, contextStr, jobVersion);
  10550.  
  10551. List<String> parametersToEncrypt = new java.util.ArrayList<String>();
  10552. // Resume: jobStart
  10553. resumeUtil.addLog("JOB_STARTED", "JOB:" + jobName,
  10554. parent_part_launcher, Thread.currentThread().getId() + "", "",
  10555. "", "", "",
  10556. resumeUtil.convertToJsonText(context, parametersToEncrypt));
  10557.  
  10558. if (execStat) {
  10559. try {
  10560. runStat.openSocket(!isChildJob);
  10561. runStat.setAllPID(rootPid, fatherPid, pid, jobName);
  10562. runStat.startThreadStat(clientHost, portStats);
  10563. runStat.updateStatOnJob(RunStat.JOBSTART, fatherNode);
  10564. } catch (java.io.IOException ioException) {
  10565. ioException.printStackTrace();
  10566. }
  10567. }
  10568.  
  10569. java.util.concurrent.ConcurrentHashMap<Object, Object> concurrentHashMap = new java.util.concurrent.ConcurrentHashMap<Object, Object>();
  10570. globalMap.put("concurrentHashMap", concurrentHashMap);
  10571.  
  10572. long startUsedMemory = Runtime.getRuntime().totalMemory()
  10573. - Runtime.getRuntime().freeMemory();
  10574. long endUsedMemory = 0;
  10575. long end = 0;
  10576.  
  10577. startTime = System.currentTimeMillis();
  10578.  
  10579. this.globalResumeTicket = true;// to run tPreJob
  10580.  
  10581. this.globalResumeTicket = false;// to run others jobs
  10582.  
  10583. try {
  10584. errorCode = null;
  10585. tDBInput_6Process(globalMap);
  10586. if (!"failure".equals(status)) {
  10587. status = "end";
  10588. }
  10589. } catch (TalendException e_tDBInput_6) {
  10590. globalMap.put("tDBInput_6_SUBPROCESS_STATE", -1);
  10591.  
  10592. e_tDBInput_6.printStackTrace();
  10593.  
  10594. }
  10595.  
  10596. this.globalResumeTicket = true;// to run tPostJob
  10597.  
  10598. end = System.currentTimeMillis();
  10599.  
  10600. if (watch) {
  10601. System.out.println((end - startTime) + " milliseconds");
  10602. }
  10603.  
  10604. endUsedMemory = Runtime.getRuntime().totalMemory()
  10605. - Runtime.getRuntime().freeMemory();
  10606. if (false) {
  10607. System.out
  10608. .println((endUsedMemory - startUsedMemory)
  10609. + " bytes memory increase when running : FACT_snimek_dochazky");
  10610. }
  10611.  
  10612. if (execStat) {
  10613. runStat.updateStatOnJob(RunStat.JOBEND, fatherNode);
  10614. runStat.stopThreadStat();
  10615. }
  10616. int returnCode = 0;
  10617. if (errorCode == null) {
  10618. returnCode = status != null && status.equals("failure") ? 1 : 0;
  10619. } else {
  10620. returnCode = errorCode.intValue();
  10621. }
  10622. resumeUtil.addLog("JOB_ENDED", "JOB:" + jobName, parent_part_launcher,
  10623. Thread.currentThread().getId() + "", "", "" + returnCode, "",
  10624. "", "");
  10625.  
  10626. return returnCode;
  10627.  
  10628. }
  10629.  
  10630. // only for OSGi env
  10631. public void destroy() {
  10632.  
  10633. }
  10634.  
  10635. private java.util.Map<String, Object> getSharedConnections4REST() {
  10636. java.util.Map<String, Object> connections = new java.util.HashMap<String, Object>();
  10637.  
  10638. return connections;
  10639. }
  10640.  
  10641. private void evalParam(String arg) {
  10642. if (arg.startsWith("--resuming_logs_dir_path")) {
  10643. resuming_logs_dir_path = arg.substring(25);
  10644. } else if (arg.startsWith("--resuming_checkpoint_path")) {
  10645. resuming_checkpoint_path = arg.substring(27);
  10646. } else if (arg.startsWith("--parent_part_launcher")) {
  10647. parent_part_launcher = arg.substring(23);
  10648. } else if (arg.startsWith("--watch")) {
  10649. watch = true;
  10650. } else if (arg.startsWith("--stat_port=")) {
  10651. String portStatsStr = arg.substring(12);
  10652. if (portStatsStr != null && !portStatsStr.equals("null")) {
  10653. portStats = Integer.parseInt(portStatsStr);
  10654. }
  10655. } else if (arg.startsWith("--trace_port=")) {
  10656. portTraces = Integer.parseInt(arg.substring(13));
  10657. } else if (arg.startsWith("--client_host=")) {
  10658. clientHost = arg.substring(14);
  10659. } else if (arg.startsWith("--context=")) {
  10660. contextStr = arg.substring(10);
  10661. isDefaultContext = false;
  10662. } else if (arg.startsWith("--father_pid=")) {
  10663. fatherPid = arg.substring(13);
  10664. } else if (arg.startsWith("--root_pid=")) {
  10665. rootPid = arg.substring(11);
  10666. } else if (arg.startsWith("--father_node=")) {
  10667. fatherNode = arg.substring(14);
  10668. } else if (arg.startsWith("--pid=")) {
  10669. pid = arg.substring(6);
  10670. } else if (arg.startsWith("--context_type")) {
  10671. String keyValue = arg.substring(15);
  10672. int index = -1;
  10673. if (keyValue != null && (index = keyValue.indexOf('=')) > -1) {
  10674. if (fatherPid == null) {
  10675. context_param.setContextType(keyValue.substring(0, index),
  10676. replaceEscapeChars(keyValue.substring(index + 1)));
  10677. } else { // the subjob won't escape the especial chars
  10678. context_param.setContextType(keyValue.substring(0, index),
  10679. keyValue.substring(index + 1));
  10680. }
  10681.  
  10682. }
  10683.  
  10684. } else if (arg.startsWith("--context_param")) {
  10685. String keyValue = arg.substring(16);
  10686. int index = -1;
  10687. if (keyValue != null && (index = keyValue.indexOf('=')) > -1) {
  10688. if (fatherPid == null) {
  10689. context_param.put(keyValue.substring(0, index),
  10690. replaceEscapeChars(keyValue.substring(index + 1)));
  10691. } else { // the subjob won't escape the especial chars
  10692. context_param.put(keyValue.substring(0, index),
  10693. keyValue.substring(index + 1));
  10694. }
  10695. }
  10696. } else if (arg.startsWith("--log4jLevel=")) {
  10697. log4jLevel = arg.substring(13);
  10698. }
  10699.  
  10700. }
  10701.  
  10702. private static final String NULL_VALUE_EXPRESSION_IN_COMMAND_STRING_FOR_CHILD_JOB_ONLY = "<TALEND_NULL>";
  10703.  
  10704. private final String[][] escapeChars = { { "\\\\", "\\" }, { "\\n", "\n" },
  10705. { "\\'", "\'" }, { "\\r", "\r" }, { "\\f", "\f" }, { "\\b", "\b" },
  10706. { "\\t", "\t" } };
  10707.  
  10708. private String replaceEscapeChars(String keyValue) {
  10709.  
  10710. if (keyValue == null || ("").equals(keyValue.trim())) {
  10711. return keyValue;
  10712. }
  10713.  
  10714. StringBuilder result = new StringBuilder();
  10715. int currIndex = 0;
  10716. while (currIndex < keyValue.length()) {
  10717. int index = -1;
  10718. // judege if the left string includes escape chars
  10719. for (String[] strArray : escapeChars) {
  10720. index = keyValue.indexOf(strArray[0], currIndex);
  10721. if (index >= 0) {
  10722.  
  10723. result.append(keyValue.substring(currIndex,
  10724. index + strArray[0].length()).replace(strArray[0],
  10725. strArray[1]));
  10726. currIndex = index + strArray[0].length();
  10727. break;
  10728. }
  10729. }
  10730. // if the left string doesn't include escape chars, append the left
  10731. // into the result
  10732. if (index < 0) {
  10733. result.append(keyValue.substring(currIndex));
  10734. currIndex = currIndex + keyValue.length();
  10735. }
  10736. }
  10737.  
  10738. return result.toString();
  10739. }
  10740.  
  10741. public Integer getErrorCode() {
  10742. return errorCode;
  10743. }
  10744.  
  10745. public String getStatus() {
  10746. return status;
  10747. }
  10748.  
  10749. ResumeUtil resumeUtil = null;
  10750. }
  10751. /************************************************************************************************
  10752. * 305985 characters generated by Talend Open Studio for Data Integration on the
  10753. * 2. ledna 2019 22:02:33 CET
  10754. ************************************************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement