if (getSrvDatabase() != null //for test purpose, otherwise it must be set && !((APersistableBase) entity).getIdDatabaseBirth() .equals(getIdDatabase())) { throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER, "can_not_change_foreign_src");
DateFormat.MEDIUM, DateFormat.SHORT, new Locale(langDef)); String strWho = getSrvI18n().getMsg(pEntity.getClass().getSimpleName() + "short", langDef) + " #" + getSrvOrm().getIdDatabase() + "-"//only local + pEntity.getItsId(); if (pEntity.getOwnerId() == null) { strWho += " " + getSrvI18n().getMsg("in", langDef) + " " + getSrvI18n() .getMsg(getSrvTypeCode().getTypeCodeMap().get(pEntity.getOwnerType()) .getSimpleName() + "short", langDef) + " #" + getSrvOrm().getIdDatabase() + "-" + pEntity.getOwnerId() + ", " + dateFormat.format(pEntity.getDocumentDate()); + getSrvI18n().getMsg(getSrvTypeCode().getTypeCodeMap() .get(pSource.getSourceType()).getSimpleName() + "short", langDef) + " #" + getSrvOrm().getIdDatabase() + "-" + pSource.getSourceId(); return getSrvI18n().getMsg("made_at", langDef) + " " + dateFormat.format( new Date()) + " " + getSrvI18n().getMsg("by", langDef)
final T pEntity, final IRequestData pRequestData) throws Exception { T entity = this.srvOrm.retrieveEntity(pAddParam, pEntity); if (entity.getIdDatabaseBirth() != getSrvOrm().getIdDatabase()) { throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER, "can_not_change_foreign_src");
final Long pDrawingOwnerId) throws Exception { if (!pEntity.getIdDatabaseBirth() .equals(getSrvOrm().getIdDatabase())) { throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER, "can_not_make_di_entry_for_foreign_src"); String query = lazyGetQuery(drawItemSourceLine.getFileName()); query = query.replace(":IDDATABASEBIRTH", String.valueOf(getSrvOrm() .getIdDatabase())); query = query.replace(":INVITEM", pEntity.getInvItem() .getItsId().toString());
final Long pDrawingOwnerId) throws Exception { if (!pEntity.getIdDatabaseBirth() .equals(getSrvOrm().getIdDatabase())) { throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER, "can_not_make_di_entry_for_foreign_src"); List<T> diel = getSrvOrm().retrieveListWithConditions(pAddParam, getDrawItemEntryClass(), " where DRAWINGTYPE=" + pEntity.constTypeCode() + " and " + tblNm + ".IDDATABASEBIRTH=" + getSrvOrm().getIdDatabase() + " and DRAWINGID=" + pEntity.getReversedId()); BigDecimal quantityToLeaveRst = pEntity.getItsQuantity(); die.setIdDatabaseBirth(getSrvOrm().getIdDatabase()); die.setSourceType(dies.getSourceType()); die.setSourceId(dies.getSourceId()); die.setDescription(makeDescription(pAddParam, pEntity, dies) + " " + getSrvI18n().getMsg("reversed_entry_n", langDef) + getSrvOrm().getIdDatabase() + "-" + dies.getItsId()); getSrvOrm().insertEntity(pAddParam, die); die.setIsNew(false); dies.setDescription(dies.getDescription() + " " + getSrvI18n().getMsg("reversing_entry_n", langDef) + getSrvOrm().getIdDatabase() + "-" + die.getItsId()); //only local getSrvOrm().updateEntity(pAddParam, dies);
/** * <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 { T entity = this.srvOrm.retrieveEntity(pAddParam, pEntity); entity.setIsNew(true); entity.setItsId(null); entity.setIdBirth(null); entity.setIdDatabaseBirth(this.srvOrm.getIdDatabase()); pRequestData.setAttribute("entity", entity); pRequestData.setAttribute("mngUvds", this.mngUvdSettings); pRequestData.setAttribute("srvOrm", this.srvOrm); pRequestData.setAttribute("srvDate", this.srvDate); pRequestData.setAttribute("hldCnvFtfsNames", this.fieldConverterNamesHolder); pRequestData.setAttribute("fctCnvFtfs", this.convertersFieldsFatory); return entity; }
final BigDecimal pQuantityToDraw) throws Exception { if (!pEntity.getIdDatabaseBirth() .equals(getSrvOrm().getIdDatabase())) { throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER, "can_not_make_di_entry_for_foreign_src"); die.setIdDatabaseBirth(getSrvOrm().getIdDatabase()); die.setSourceType(pSource.constTypeCode()); die.setSourceId(pSource.getItsId());