//////////////////////////////
511597
public function CreateProjectDirectory($dir) {
		$filepath = "{$this->ProjectRoot}/{$dir}";

		if(!file_exists($filepath)) @mkdir($filepath,0777,true);
		if(!file_exists($filepath)) throw new Exception("unable to create {$dir}");

		return $this;
	}
914981
@Override
	public <P extends ParaObject> String create(String appid, P so) {
		if (so == null) {
			return null;
		}
		if (StringUtils.isBlank(so.getId())) {
			so.setId(Utils.getNewId());
		}
		if (so.getTimestamp() == null) {
			so.setTimestamp(Utils.timestamp());
		}
		so.setAppid(appid);
		createRow(so.getId(), appid, toRow(so, null));
		logger.debug("DAO.create() {}->{}", appid, so.getId());
		return so.getId();
	}
1000945
public final void makeSeOrdLn(final Map<String, Object> pRqVs,
    final List<CuOrSe> pOrders, final SeSeller pSel,
      final AItemPlace<?, ?> pItPl, final CartLn pCartLn,
        final TradingSettings pTs) throws Exception {
    CuOrSe cuOr = null;
    boolean isNdOrInit = true;
    for (CuOrSe co : pOrders) {
      if (co.getCurr() != null && co.getSel() != null
  && co.getSel().getSeller().getItsId().equals(pSel.getSeller().getItsId())) {
        cuOr = co;
        isNdOrInit = false;
        break;
      }
    }
    if (cuOr == null) {
      for (CuOrSe co : pOrders) {
        if (co.getCurr() == null) {
          cuOr = co;
          break;
        }
      }
    }
    if (cuOr == null) {
      cuOr = new CuOrSe();
      cuOr.setIsNew(true);
      cuOr.setTaxes(new ArrayList<CuOrSeTxLn>());
      cuOr.setGoods(new ArrayList<CuOrSeGdLn>());
      cuOr.setServs(new ArrayList<CuOrSeSrLn>());
      pOrders.add(cuOr);
    }
    if (isNdOrInit) {
      cuOr.setDat(new Date());
      cuOr.setSeller(pSel);
      cuOr.setStat(EOrdStat.NEW);
      cuOr.setDeliv(pCartLn.getItsOwner().getDeliv());
      cuOr.setPayMeth(pCartLn.getItsOwner().getPayMeth());
      cuOr.setBuyer(pCartLn.getItsOwner().getBuyer());
      //TODO  method "pickup by buyer from several places"
      //cuOr.setPlace(pItPl.getPickUpPlace());
      cuOr.setPur(pCartLn.getItsOwner().getItsVersion());
      cuOr.setCurr(pCartLn.getItsOwner().getCurr());
      cuOr.setExcRt(pCartLn.getItsOwner().getExcRt());
      cuOr.setDescr(pCartLn.getItsOwner().getDescr());
    }
    pRqVs.put(CartItTxLn.class.getSimpleName() + "itsOwnerdeepLevel", 1);
    pRqVs.put(CartItTxLn.class.getSimpleName() + "taxdeepLevel", 1);
    List<CartItTxLn> citls = getSrvOrm().retrieveListWithConditions(pRqVs,
      CartItTxLn.class, "where DISAB=0 and ITSOWNER=" + pCartLn.getItsId());
    pRqVs.remove(CartItTxLn.class.getSimpleName() + "itsOwnerdeepLevel");
    pRqVs.remove(CartItTxLn.class.getSimpleName() + "taxdeepLevel");
    ACuOrSeLn ol;
    if (pCartLn.getItTyp().equals(EShopItemType.SEGOODS)) {
      CuOrSeGdLn ogl = null;
      if (!cuOr.getIsNew()) {
        for (CuOrSeGdLn gl : cuOr.getGoods()) {
          if (gl.getGood() == null) {
            ogl = gl;
            break;
          }
        }
      }
      if (ogl == null) {
        ogl = new CuOrSeGdLn();
        ogl.setIsNew(true);
        cuOr.getGoods().add(ogl);
      }
      SeGoods gd = new SeGoods();
      gd.setSeller(pSel);
      gd.setItsId(pCartLn.getItId());
      gd.setItsName(pCartLn.getItsName());
      ogl.setGood(gd);
      if (citls.size() > 0) {
        if (ogl.getIsNew()) {
          ogl.setItTxs(new ArrayList<CuOrSeGdTxLn>());
        }
        for (CartItTxLn citl : citls) {
          CuOrSeGdTxLn oitl = null;
          if (!cuOr.getIsNew()) {
            for (CuOrSeGdTxLn itl : ogl.getItTxs()) {
              if (itl.getTax() == null) {
                oitl = itl;
                break;
              }
            }
          }
          if (oitl == null) {
            oitl = new CuOrSeGdTxLn();
            oitl.setIsNew(true);
            ogl.getItTxs().add(oitl);
          }
          oitl.setItsOwner(ogl);
          Tax tx = new Tax();
          tx.setItsId(citl.getTax().getItsId());
          tx.setItsName(citl.getTax().getItsName());
          oitl.setTax(tx);
          oitl.setTot(citl.getTot());
        }
      }
      ol = ogl;
    } else {
      CuOrSeSrLn osl = null;
      if (!cuOr.getIsNew()) {
        for (CuOrSeSrLn sl : cuOr.getServs()) {
          if (sl.getService() == null) {
            osl = sl;
            break;
          }
        }
      }
      if (osl == null) {
        osl = new CuOrSeSrLn();
        osl.setIsNew(true);
        cuOr.getServs().add(osl);
      }
      SeService sr = new SeService();
      sr.setSeller(pSel);
      sr.setItsId(pCartLn.getItId());
      sr.setItsName(pCartLn.getItsName());
      osl.setService(sr);
      osl.setDt1(pCartLn.getDt1());
      osl.setDt2(pCartLn.getDt2());
      if (citls.size() > 0) {
        if (osl.getIsNew()) {
          osl.setItTxs(new ArrayList<CuOrSeSrTxLn>());
        }
        for (CartItTxLn citl : citls) {
          CuOrSeSrTxLn oitl = null;
          if (!cuOr.getIsNew()) {
            for (CuOrSeSrTxLn itl : osl.getItTxs()) {
              if (itl.getTax() == null) {
                oitl = itl;
                break;
              }
            }
          }
          if (oitl == null) {
            oitl = new CuOrSeSrTxLn();
            oitl.setIsNew(true);
            osl.getItTxs().add(oitl);
          }
          oitl.setItsOwner(osl);
          Tax tx = new Tax();
          tx.setItsId(citl.getTax().getItsId());
          tx.setItsName(citl.getTax().getItsName());
          oitl.setTax(tx);
          oitl.setTot(citl.getTot());
        }
      }
      ol = osl;
    }
    ol.setItsName(pCartLn.getItsName());
    ol.setDescr(pCartLn.getDescr());
    ol.setUom(pCartLn.getUom());
    ol.setPrice(pCartLn.getPrice());
    ol.setQuant(pCartLn.getQuant());
    ol.setSubt(pCartLn.getSubt());
    ol.setTot(pCartLn.getTot());
    ol.setTotTx(pCartLn.getTotTx());
    ol.setTxCat(pCartLn.getTxCat());
    ol.setTxDsc(pCartLn.getTxDsc());
  }
5942
@Override
	public String onColumnName(String columnName) {
		if (onlyBindParameter)
			return null;

		if (currentSchema != null) {
			Set<SQLProperty> props = currentSchema.getPropertyBySimpleName(columnName);
			AssertKripton.assertTrueOrUnknownPropertyInJQLException(props != null && props.size() > 0, currentMethod, columnName);
			return props.iterator().next().columnName;
		} else {
			return null;
		}
	}
289322
function ( i )
	{
		var
			that = this,
			column = this.s.dt.aoColumns[i],
			dt = this.s.dt;

		var title = this.s.fnLabel===null ?
			column.sTitle :
			this.s.fnLabel( i, column.sTitle, column.nTh );

		return $(
				'<li '+(dt.bJUI ? 'class="ui-button ui-state-default"' : '')+'>'+
					'<label>'+
						'<input type="checkbox" />'+
						'<span>'+title+'</span>'+
					'</label>'+
				'</li>'
			)
			.click( function (e) {
				var showHide = !$('input', this).is(":checked");
				if (  e.target.nodeName.toLowerCase() !== "li" )
				{
					if ( e.target.nodeName.toLowerCase() == "input" || that.s.fnStateChange === null )
					{
						showHide = ! showHide;
					}
				}

				/* Need to consider the case where the initialiser created more than one table - change the
				 * API index that DataTables is using
				 */
				var oldIndex = $.fn.dataTableExt.iApiIndex;
				$.fn.dataTableExt.iApiIndex = that._fnDataTablesApiIndex.call(that);

				// Optimisation for server-side processing when scrolling - don't do a full redraw
				if ( dt.oFeatures.bServerSide )
				{
					that.s.dt.oInstance.fnSetColumnVis( i, showHide, false );
					that.s.dt.oInstance.fnAdjustColumnSizing( false );
					if (dt.oScroll.sX !== "" || dt.oScroll.sY !== "" )
					{
						that.s.dt.oInstance.oApi._fnScrollDraw( that.s.dt );
					}
					that._fnDrawCallback();
				}
				else
				{
					that.s.dt.oInstance.fnSetColumnVis( i, showHide );
				}

				$.fn.dataTableExt.iApiIndex = oldIndex; /* Restore */

				if ( that.s.fnStateChange !== null )
				{
					if ( e.target.nodeName.toLowerCase() == "span" )
					{
						e.preventDefault();
					}
					that.s.fnStateChange.call( that, i, showHide );
				}
			} )[0];
	}
1300157
protected static void reOrganizeType(QueryColumnImpl column) {
	if ((column.type == Types.OTHER) && !column.typeChecked) {
	    column.typeChecked = true;
	    if (column.size() > 0) {
		checkOther(column, column.data[0]);

		// get Type
		for (int i = 1; i < column.size(); i++) {
		    switch (column.type) {
		    case Types.NULL:
			checkOther(column, column.data[i]);
			break;
		    case Types.TIMESTAMP:
			checkDate(column, column.data[i]);
			break;
		    // case Types.DATE:checkDate(column.data[i]);break;
		    case Types.BOOLEAN:
			checkBoolean(column, column.data[i]);
			break;
		    case Types.DOUBLE:
			checkDouble(column, column.data[i]);
			break;
		    case Types.VARCHAR:
			checkBasic(column, column.data[i]);
			break;
		    default:
			break;
		    }
		}
	    }
	}
    }
897715
function(){
        var prev=this.s1Link.prev;
        var next=this.s1Link.next;
        if(prev!==null)prev.next=next;
        if(next!==null)next.prev=prev;
        if(this.shape1.contactLink==this.s1Link)this.shape1.contactLink=next;
        this.s1Link.prev=null;
        this.s1Link.next=null;
        this.s1Link.shape=null;
        this.s1Link.body=null;
        this.shape1.numContacts--;

        prev=this.s2Link.prev;
        next=this.s2Link.next;
        if(prev!==null)prev.next=next;
        if(next!==null)next.prev=prev;
        if(this.shape2.contactLink==this.s2Link)this.shape2.contactLink=next;
        this.s2Link.prev=null;
        this.s2Link.next=null;
        this.s2Link.shape=null;
        this.s2Link.body=null;
        this.shape2.numContacts--;

        prev=this.b1Link.prev;
        next=this.b1Link.next;
        if(prev!==null)prev.next=next;
        if(next!==null)next.prev=prev;
        if(this.body1.contactLink==this.b1Link)this.body1.contactLink=next;
        this.b1Link.prev=null;
        this.b1Link.next=null;
        this.b1Link.shape=null;
        this.b1Link.body=null;
        this.body1.numContacts--;

        prev=this.b2Link.prev;
        next=this.b2Link.next;
        if(prev!==null)prev.next=next;
        if(next!==null)next.prev=prev;
        if(this.body2.contactLink==this.b2Link)this.body2.contactLink=next;
        this.b2Link.prev=null;
        this.b2Link.next=null;
        this.b2Link.shape=null;
        this.b2Link.body=null;
        this.body2.numContacts--;

        this.manifold.body1=null;
        this.manifold.body2=null;
        this.constraint.body1=null;
        this.constraint.body2=null;
        this.constraint.detach();

        this.shape1=null;
        this.shape2=null;
        this.body1=null;
        this.body2=null;
    }
1238792
function(){
        var helperParameters = this.parameters;
        var linkTextPath = helperParameters.options.linkTextPath;
        var paths = getResolvedPaths(helperParameters);
        var length = paths.length;
        var path, i, normalizedPath;

        if (linkTextPath) {
          normalizedPath = getNormalizedPath(linkTextPath, helperParameters);
          this.registerObserver(normalizedPath.root, normalizedPath.path, this, this.rerender);
        }

        for(i=0; i < length; i++) {
          path = paths[i];
          if (null === path) {
            // A literal value was provided, not a path, so nothing to observe.
            continue;
          }

          normalizedPath = getNormalizedPath(path, helperParameters);
          this.registerObserver(normalizedPath.root, normalizedPath.path, this, this._paramsChanged);
        }

        var queryParamsObject = this.queryParamsObject;
        if (queryParamsObject) {
          var values = queryParamsObject.values;

          // Install observers for all of the hash options
          // provided in the (query-params) subexpression.
          for (var k in values) {
            if (!values.hasOwnProperty(k)) { continue; }

            if (queryParamsObject.types[k] === 'ID') {
              normalizedPath = getNormalizedPath(values[k], helperParameters);
              this.registerObserver(normalizedPath.root, normalizedPath.path, this, this._paramsChanged);
            }
          }
        }
      }
243748
public static void html(StringBuilder sb, String html) {
        for (int i = 0; i < html.length(); i++) {
            char c = html.charAt(i);
            switch (c) {
            case '&':
                sb.append("&amp;");
                break;
            case '"':
                sb.append("&quot;");
                break;
            case '\'':
                sb.append("&apos;");
                break;
            case '<':
                sb.append("&lt;");
                break;
            case '>':
                sb.append("&gt;");
                break;
            default:
                sb.append(c);
            }
        }
    }
928967
public static void main(String[] args) throws Exception {
    Configuration conf = HBaseConfiguration.create();
    String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
    if (otherArgs.length < 2) {
      usage("Wrong number of arguments: " + otherArgs.length);
      System.exit(-1);
    }
    if (conf.get(BigtableOptionsFactory.PROJECT_ID_KEY) == null) {
      usage("Must specify the property " + BigtableOptionsFactory.PROJECT_ID_KEY);
      System.exit(-1);
    }
    if (conf.get(BigtableOptionsFactory.INSTANCE_ID_KEY) == null) {
      usage("Must specify the property" + BigtableOptionsFactory.INSTANCE_ID_KEY);
      System.exit(-1);
    }

    Job job = createSubmittableJob(conf, otherArgs);
    System.exit(job.waitForCompletion(true)? 0 : 1);
  }
521925
public static void main(String[] args) {
    int width = 6;
    int height = 10;
    Pentomino model = new Pentomino(width, height);
    List splits = model.getSplits(2);
    for(Iterator splitItr=splits.iterator(); splitItr.hasNext(); ) {
      int[] choices = (int[]) splitItr.next();
      System.out.print("split:");
      for(int i=0; i < choices.length; ++i) {
        System.out.print(" " + choices[i]);
      }
      System.out.println();
      
      System.out.println(model.solve(choices) + " solutions found.");
    }
  }
965747
private static void proposeSolutions(String[] dataSet, int k, int startPosition, String[] result, WebLocator webLocator) throws SolutionFoundException {

        if (k == 0) {
            validateSolution(webLocator, differences(dataSet, result));
            return;
        }

        for (int i = startPosition; i <= dataSet.length - k; i++) {
            result[result.length - k] = dataSet[i];
            proposeSolutions(dataSet, k - 1, i + 1, result, webLocator);
        }
    }
917582
function(data) {
            if (data.row.index === 5) {
                data.cell.styles.fillColor = [40, 170, 100];
            }

            if ((data.row.section === 'head' || data.row.section === 'foot') && data.column.dataKey === "expenses") {
                data.cell.text = '' // Use an icon in didDrawCell instead
            }

            if (data.row.index === 0 && data.row.section === 'body' && data.column.dataKey === 'city') {
                data.cell.text = 'とうきょう'
            }
        }
789904
public static void main(String[] args)
    {
    	
    	// Override CQL version while instantiating entity manager factory.

        EntityManagerFactory emf = Persistence.createEntityManagerFactory("twissandra,twingo,twirdbms");
        EntityManager em = emf.createEntityManager();

        try
        {
        	
        //populate user set from excel sheet.
        Set<User> users = UserBroker.brokeUserList(args[0]);

        for (Iterator<User> iterator = users.iterator(); iterator.hasNext();)
        {
            User user = (User) iterator.next();

            // on Persist
            ExecutorService.onPersist(em, user);
            
                 
            // on find by id.
            ExecutorService.findByKey(em,"BigDataUser");
            
            List<User> fetchedUsers = ExecutorService.onQueryByEmail(em, user);
            
            if (fetchedUsers != null && fetchedUsers.size() > 0)
            {
                logger.info(user.toString());
            }

            logger.info("");
            System.out.println("#######################Querying##########################################");
            logger.info("");
            logger.info("");

        }

        // Execute wild search query.
        String query = "Select u from User u";
        logger.info(query);
        ExecutorService.findByQuery(em, query);

        // // Execute native CQL. Fetch tweets for given user.
        logger.info("");
        System.out.println("#######################Querying##########################################");
        logger.info("");
        logger.info("");

        query = "Select * from tweets where user_id='RDBMSUser'";
        logger.info(query);
        ExecutorService.findByNativeQuery(em,query);
    	} finally
    	{
    		onDestroyDBResources(emf, em);
    	}
    }
918301
@SuppressWarnings("unchecked")
	// <editor-fold defaultstate="collapsed"
	// desc="Generated Code">//GEN-BEGIN:initComponents
	private void initComponents() {
		java.awt.GridBagConstraints gridBagConstraints;

		jLabelHeader = new javax.swing.JLabel();
		jPanel1 = new javax.swing.JPanel();
		jButtonAccept = new javax.swing.JButton();
		jButtonSelectAll = new javax.swing.JButton();
		jButtonSelectNone = new javax.swing.JButton();
		jButtonCancel = new javax.swing.JButton();
		jPanel2 = new javax.swing.JPanel();
		jCheckBox1 = new javax.swing.JCheckBox();
		jPanel3 = new javax.swing.JPanel();
		jLabel1 = new javax.swing.JLabel();

		setMinimumSize(new java.awt.Dimension(100, 100));
		setLayout(new java.awt.GridBagLayout());

		jLabelHeader.setText("Select the prefixes relevant for your query:");
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 0;
		gridBagConstraints.gridy = 0;
		gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
		gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
		gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
		add(jLabelHeader, gridBagConstraints);

		jPanel1.setLayout(new java.awt.GridBagLayout());

		jButtonAccept.setText("Accept");
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
		gridBagConstraints.weightx = 1.0;
		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
		jPanel1.add(jButtonAccept, gridBagConstraints);

		jButtonSelectAll.setText("Select All");
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
		gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
		jPanel1.add(jButtonSelectAll, gridBagConstraints);

		jButtonSelectNone.setText("Select None");
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
		gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
		jPanel1.add(jButtonSelectNone, gridBagConstraints);

		jButtonCancel.setText("Cancel");
		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
		gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
		gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
		jPanel1.add(jButtonCancel, gridBagConstraints);

		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 0;
		gridBagConstraints.gridy = 2;
		gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
		gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
		gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
		add(jPanel1, gridBagConstraints);

		jPanel2.setLayout(new java.awt.GridBagLayout());

		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 0;
		gridBagConstraints.gridy = 1;
		gridBagConstraints.gridwidth = 2;
		gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
		gridBagConstraints.weightx = 1.0;
		gridBagConstraints.weighty = 1.0;
		jPanel2.add(jPanel3, gridBagConstraints);

		gridBagConstraints = new java.awt.GridBagConstraints();
		gridBagConstraints.gridx = 0;
		gridBagConstraints.gridy = 1;
		gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
		gridBagConstraints.weightx = 1.0;
		gridBagConstraints.weighty = 1.0;
		gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
		add(jPanel2, gridBagConstraints);
	}
1122932
@Override
    public void run() {
        switch (type) {
          case OPEN_FILE:
            try {
                debugGui.dim.compileScript(fileName, text);
            } catch (RuntimeException ex) {
                MessageDialogWrapper.showMessageDialog(
                    debugGui, ex.getMessage(), "Error Compiling "+fileName,
                    JOptionPane.ERROR_MESSAGE);
            }
            break;

          case LOAD_FILE:
            try {
                debugGui.dim.evalScript(fileName, text);
            } catch (RuntimeException ex) {
                MessageDialogWrapper.showMessageDialog(
                    debugGui, ex.getMessage(), "Run error for "+fileName,
                    JOptionPane.ERROR_MESSAGE);
            }
            break;

          case UPDATE_SOURCE_TEXT:
            {
                String fileName = sourceInfo.url();
                if (!debugGui.updateFileWindow(sourceInfo) &&
                        !fileName.equals("<stdin>")) {
                    debugGui.createFileWindow(sourceInfo, -1);
                }
            }
            break;

          case ENTER_INTERRUPT:
            debugGui.enterInterruptImpl(lastFrame, threadTitle, alertMessage);
            break;

          default:
            throw new IllegalArgumentException(String.valueOf(type));

        }
    }
1050921
@Override
  public final void makeOtherEntries(final Map<String, Object> pAddParam,
    final Wage pEntity, final IRequestData pRequestData,
      final boolean pIsNew) throws Exception {
    String actionAdd = pRequestData.getParameter("actionAdd");
    if ("fill".equals(actionAdd)) {
      //User can change method as he want
      String srvFillWgLnNm = getSrvAccSettings().lazyGetAccSettings(pAddParam)
        .getWageTaxesMethod().getServiceName();
      ISrvFillWageLines srvFillWageLines = (ISrvFillWageLines) this
        .factoryAppBeans.lazyGet(srvFillWgLnNm);
      srvFillWageLines.fillWageLines(pAddParam, pEntity);
    } else if ("makeAccEntries".equals(actionAdd)) {
      if (pEntity.getReversedId() == null) {
        WageLine wl = new WageLine();
        wl.setItsOwner(pEntity);
        List<WageLine> wageLines = getSrvOrm().
          retrieveListForField(pAddParam, wl, "itsOwner");
        for (WageLine wageLine : wageLines) {
          String whereStr = " where ITSOWNER=" + pEntity.getEmployee()
            .getItsId() + " and WAGETYPE=" + wageLine.getWageType().getItsId();
          EmployeeYearWage employeeYearWage = getSrvOrm()
            .retrieveEntityWithConditions(pAddParam,
              EmployeeYearWage.class, whereStr);
          if (employeeYearWage == null) {
            employeeYearWage = new EmployeeYearWage();
            employeeYearWage.setItsOwner(pEntity.getEmployee());
            employeeYearWage.setIsNew(true);
            employeeYearWage.setIdDatabaseBirth(getSrvOrm().getIdDatabase());
            employeeYearWage.setWageType(wageLine.getWageType());
          }
          employeeYearWage.setTotalWageYear(employeeYearWage.getTotalWageYear()
            .add(wageLine.getGrossWage())
              .subtract(wageLine.getTaxesEmployee()));
          if (employeeYearWage.getIsNew()) {
            getSrvOrm().insertEntity(pAddParam, employeeYearWage);
            employeeYearWage.setIsNew(false);
          } else {
            getSrvOrm().updateEntity(pAddParam, employeeYearWage);
          }
        }
      } else {
        WageLine wl = new WageLine();
        Wage reversed = getSrvOrm().
          retrieveEntityById(pAddParam, Wage.class, pEntity.getReversedId());
        wl.setItsOwner(reversed);
        List<WageLine> wageLines = getSrvOrm().
          retrieveListForField(pAddParam, wl, "itsOwner");
        for (WageLine wageLine : wageLines) {
          String whereStr = " where ITSOWNER=" + pEntity.getEmployee()
            .getItsId() + " and WAGETYPE=" + wageLine.getWageType().getItsId();
          EmployeeYearWage employeeYearWage = getSrvOrm()
            .retrieveEntityWithConditions(pAddParam,
              EmployeeYearWage.class, whereStr);
          employeeYearWage.setTotalWageYear(employeeYearWage.getTotalWageYear()
            .subtract(wageLine.getGrossWage())
              .add(wageLine.getTaxesEmployee()));
          getSrvOrm().updateEntity(pAddParam, employeeYearWage);
        }
      }
    }
  }