/** * <p>Retrieve 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 T retrieveEntityById(final Map<String, Object> pAddParam, final Object pId) throws Exception { addAccSettingsIntoAttrs(pAddParam); T entity = getSrvOrm().retrieveEntityById(getEntityClass(), pId); @SuppressWarnings("unchecked") Map<String, String[]> parameterMap = (Map<String, String[]>) pAddParam. get("parameterMap"); if (parameterMap.get("actionAdd") != null && "full".equals(parameterMap.get("actionAdd")[0])) { IAttributes attributes = (IAttributes) pAddParam.get("attributes"); attributes.setAttribute("accEntries", srvAccEntry .retrieveAccEntriesFor(pAddParam, entity)); } retrieveOtherDataFor(pAddParam, entity); return entity; }
/** * <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.prcAccEntityWithSubaccRetrieve .process(pAddParam, pEntity, pRequestData); String actionAdd = pRequestData.getParameter("actionAdd"); if ("full".equals(actionAdd)) { pRequestData.setAttribute("accEntries", this.srvAccEntry .retrieveAccEntriesFor(pAddParam, entity)); pRequestData.setAttribute("classAccountingEntry", AccountingEntry.class); } return entity; }
/** * <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.prcAccEntityRetrieve .process(pAddParam, pEntity, pRequestData); String actionAdd = pRequestData.getParameter("actionAdd"); if ("full".equals(actionAdd)) { pRequestData.setAttribute("accEntries", this.srvAccEntry .retrieveAccEntriesFor(pAddParam, entity)); pRequestData.setAttribute("classAccountingEntry", AccountingEntry.class); } return entity; }