/** * <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; }
final Object pId) throws Exception { T entity = getSrvOrm() .retrieveCopyEntity(getEntityClass(), pId); @SuppressWarnings("unchecked") Map<String, String[]> parameterMap = (Map<String, String[]>) pAddParam. .retrieveEntityById(getEntityClass(), pId); Long docId = entityReversed.getItsId(); if (entityReversed.getIdBirth() != null) {
getEntityClass(), pEntity.getReversedId()); } else { //reversing foreign doc String tblNm = getEntityClass().getSimpleName().toUpperCase(); String whereStr = " where " + tblNm + ".IDBIRTH=" + pEntity .getReversedId() + " and " + tblNm + ".IDDATABASEBIRTH=" + pEntity .getReversedIdDatabaseBirth(); reversed = getSrvOrm().retrieveEntityWithConditions( getEntityClass(), whereStr); .retrieveEntityById(getEntityClass(), pEntity.getItsId()); if (oldEntity.getHasMadeAccEntries()) { throw new ExceptionWithCode(ExceptionWithCode.FORBIDDEN,