/** * <p>Process entity request.</p> * @param pAddParam additional param, e.g. return this line's * document in "nextEntity" for farther process * @param pRequestData Request Data * @param pEntity Entity to process * @return Entity processed for farther process or null * @throws Exception - an exception **/ @Override public final T process( final Map<String, Object> pAddParam, final T pEntity, final IRequestData pRequestData) throws Exception { if (pEntity.getIsNew()) { this.srvOrm.insertEntity(pAddParam, pEntity); pEntity.setIsNew(false); } else { this.srvOrm.updateEntity(pAddParam, pEntity); } return pEntity; }
this.srvOrm.insertEntity(pAddParam, entity); } else { this.srvOrm.updateEntity(pAddParam, entity);
/** * <p>Makes invoice tax line.</p> * @param pReqVars additional param * @param pItl PurchaseReturnTaxLine * @param pInvLn inventory line * @param pIsItemBasis Is Item Basis * @throws Exception an Exception **/ public final void makeItl(final Map<String, Object> pReqVars, final PurchaseReturnTaxLine pItl, final PurchaseInvoiceServiceLine pInvLn, final boolean pIsItemBasis) throws Exception { pItl.setItsTotal(pItl.getItsTotal().add(pInvLn.getTotalTaxes())); if (!pIsItemBasis) { pItl.setTaxableInvBas(pItl.getTaxableInvBas().add(pInvLn.getSubtotal())); } if (pItl.getIsNew()) { getSrvOrm().insertEntity(pReqVars, pItl); pItl.setIsNew(false); } else { getSrvOrm().updateEntity(pReqVars, pItl); } }
/** * <p>Makes invoice tax line.</p> * @param pReqVars additional param * @param pItl SalesReturnTaxLine * @param pInvLn inventory line * @param pIsItemBasis Is Item Basis * @throws Exception an Exception **/ public final void makeItl(final Map<String, Object> pReqVars, final SalesReturnTaxLine pItl, final SalesInvoiceServiceLine pInvLn, final boolean pIsItemBasis) throws Exception { pItl.setItsTotal(pItl.getItsTotal().add(pInvLn.getTotalTaxes())); if (!pIsItemBasis) { pItl.setTaxableInvBas(pItl.getTaxableInvBas().add(pInvLn.getSubtotal())); } if (pItl.getIsNew()) { getSrvOrm().insertEntity(pReqVars, pItl); pItl.setIsNew(false); } else { getSrvOrm().updateEntity(pReqVars, pItl); } }
getSrvOrm().insertEntity(pAddParam, pEntity); pEntity.setIsNew(false); } else {
getSrvOrm().insertEntity(pAddParam, pEntity); pEntity.setIsNew(false); } else {
/** * <p>Process entity request.</p> * @param pAddParam additional param, e.g. return this line's * document in "nextEntity" for farther process * @param pRequestData Request Data * @param pEntity Entity to process * @return Entity processed for farther process or null * @throws Exception - an exception **/ @Override public final T process( final Map<String, Object> pAddParam, final T pEntity, final IRequestData pRequestData) throws Exception { if (pEntity.getIsNew()) { this.srvOrm.insertEntity(pAddParam, pEntity); pEntity.setIsNew(false); } else { if (pEntity.getIdDatabaseBirth() != getSrvOrm().getIdDatabase()) { throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER, "can_not_change_foreign_src"); } this.srvOrm.updateEntity(pAddParam, pEntity); } return pEntity; }
getSrvOrm().insertEntity(pAddParam, pEntity); pEntity.setIsNew(false); this.srvWarehouseEntry.move(pAddParam, pEntity, pEntity
getSrvOrm().insertEntity(pReqVars, pItl); pItl.setIsNew(false); } else {
getSrvOrm().insertEntity(pReqVars, pItl); pItl.setIsNew(false); } else {
/** * <p>Lazy getter for balanceAtAllDirtyCheck.</p> * @param pAddParam additional param * @return BalanceAtAllDirtyCheck * @throws Exception - an exception **/ public final synchronized BalanceAtAllDirtyCheck lazyGetBalanceAtAllDirtyCheck( final Map<String, Object> pAddParam) throws Exception { if (this.balanceAtAllDirtyCheck == null) { BalanceAtAllDirtyCheck balLoc = new BalanceAtAllDirtyCheck(); balLoc.setItsId(1L); this.balanceAtAllDirtyCheck = getSrvOrm() .retrieveEntity(pAddParam, balLoc); if (this.balanceAtAllDirtyCheck == null) { getSrvOrm().insertEntity(pAddParam, balLoc); balLoc.setIsNew(false); this.balanceAtAllDirtyCheck = getSrvOrm() .retrieveEntity(pAddParam, balLoc); } } return this.balanceAtAllDirtyCheck; }
getSrvOrm().insertEntity(pAddParam, pEntity); pEntity.setIsNew(false); } else {
/** * <p> * Read entities from stream (by given reader) and insert them * into DB with no changes. DB must be emptied before coping. * </p> * @param pAddParam additional params * @param pReader Reader * @throws Exception - an exception **/ @Override public final void readAndStoreEntities(final Map<String, Object> pAddParam, final Reader pReader) throws Exception { try { this.srvDatabase.setIsAutocommit(false); this.srvDatabase. setTransactionIsolation(ISrvDatabase.TRANSACTION_READ_UNCOMMITTED); this.srvDatabase.beginTransaction(); while (this.utilXml.readUntilStart(pReader, "entity")) { Object entity = this.srvEntityReader.read(pAddParam, pReader); this.srvOrm.insertEntity(pAddParam, entity); } this.srvDatabase.commitTransaction(); } catch (Exception ex) { this.srvDatabase.rollBackTransaction(); throw ex; } finally { this.srvDatabase.releaseResources(); } }
this.srvOrm.insertEntity(pAddParam, pEntity); } else { this.srvOrm.updateEntity(pAddParam, pEntity);
getSrvOrm().insertEntity(pAddParam, pEntity); pEntity.setIsNew(false); } else {
pReversing.setItsTotal(pReversed.getItsTotal().negate()); pReversing.setHasMadeAccEntries(false); getSrvOrm().insertEntity(pReqVars, pReversing); pReversing.setIsNew(false); String oldDesr = "";
getSrvOrm().insertEntity(pAddParam, wr); wr.setIsNew(false); } else {
DateFormat.MEDIUM, DateFormat.SHORT, new Locale(langDef)); die.setDescription(makeDescription(pEntity, langDef, dateFormat)); getSrvOrm().insertEntity(pAddParam, die); die.setIsNew(false);
+ " " + getSrvI18n().getMsg("reversed_entry_n", langDef) + dies.getIdDatabaseBirth() + "-" + dies.getItsId()); getSrvOrm().insertEntity(pAddParam, die); die.setIsNew(false); pEntity.getManufacturingProcess().setTheRest(pEntity
wm.setDescription(makeDescription(pEntity, langDef, dateFormat)); getSrvOrm().insertEntity(pAddParam, wm); wm.setIsNew(false); makeWarehouseRest(pAddParam, pEntity, pWhSiteTo, pEntity.getItsQuantity());