/** * <p>Retrieve copy of entity from DB by given ID.</p> * @param pAddParam additional param * @param pId ID * @return entity or null * @throws Exception - an exception **/ @Override public final MoveItemsLine retrieveCopyEntity( final Map<String, Object> pAddParam, final Object pId) throws Exception { MoveItemsLine entity = getSrvOrm().retrieveCopyEntity( MoveItemsLine.class, pId); @SuppressWarnings("unchecked") Map<String, String[]> parameterMap = (Map<String, String[]>) pAddParam. get("parameterMap"); if (parameterMap.get("actionAdd") != null && "reverse".equals(parameterMap.get("actionAdd")[0])) { throw new ExceptionWithCode(ExceptionWithCode.FORBIDDEN, "reverse_not_supported"); } entity.setItsQuantity(BigDecimal.ZERO); entity.setIsNew(true); addAccSettingsIntoAttrs(pAddParam); return entity; }
/** * <p>Create entity with its itsOwner e.g. invoice line * for invoice.</p> * @param pAddParam additional param * @param pIdEntityItsOwner entity itsOwner ID * @return entity instance * @throws Exception - an exception **/ @Override public final MoveItemsLine createEntityWithOwnerById( final Map<String, Object> pAddParam, final Object pIdEntityItsOwner) throws Exception { MoveItemsLine entity = new MoveItemsLine(); entity.setIdDatabaseBirth(getSrvOrm().getIdDatabase()); entity.setIsNew(true); MoveItems itsOwner = new MoveItems(); itsOwner.setItsId(Long.valueOf(pIdEntityItsOwner.toString())); entity.setItsOwner(itsOwner); addAccSettingsIntoAttrs(pAddParam); return entity; }
/** * <p>Create entity with its itsOwner e.g. invoice line * for invoice.</p> * @param pAddParam additional param * @param pEntityItsOwner itsOwner * @return entity instance * @throws Exception - an exception **/ @Override public final MoveItemsLine createEntityWithOwner( final Map<String, Object> pAddParam, final MoveItems pEntityItsOwner) throws Exception { MoveItemsLine entity = new MoveItemsLine(); entity.setIsNew(true); entity.setIdDatabaseBirth(getSrvOrm().getIdDatabase()); entity.setItsOwner(pEntityItsOwner); return entity; }
/** * <p>Create entity.</p> * @param pAddParam additional param * @return entity instance * @throws Exception - an exception **/ @Override public final MoveItemsLine createEntity( final Map<String, Object> pAddParam) throws Exception { MoveItemsLine entity = new MoveItemsLine(); entity.setIdDatabaseBirth(getSrvOrm().getIdDatabase()); entity.setIsNew(true); MoveItems itsOwner = new MoveItems(); entity.setItsOwner(itsOwner); addAccSettingsIntoAttrs(pAddParam); return entity; }
.retrieveEntity(pAddParam, pEntity.getItsOwner())); getSrvOrm().insertEntity(pAddParam, pEntity); pEntity.setIsNew(false); this.srvWarehouseEntry.move(pAddParam, pEntity, pEntity .getWarehouseSiteFrom(), pEntity.getWarehouseSiteTo());