@Override public Reconciliation read(String logstr, Long id) throws Exception { // TODO Auto-generated method stub logger.debug(logstr + "get reconciliation entry at id " + id); Reconciliation reconciliation = reconciliationRepository.findOne(id); if (reconciliation == null) { logger.debug(logstr + "Reconciliation record does not exist"); throw new Exception(); } logger.debug(logstr + "got reconciliation entry " + reconciliation.fetchLogDetails()); return reconciliation; }
@Override public Reconciliation update(String logstr, Reconciliation tobemerged) throws Exception { // TODO Auto-generated method stub logger.debug(logstr + "update reconciliation entry" + tobemerged.fetchLogDetails()); Reconciliation reconciliationOrig = reconciliationRepository.findOne(tobemerged.getId()); if (reconciliationOrig == null) { logger.debug(logstr + "Reconciliation record does not exist"); throw new Exception(); } Reconciliation reconciliation = reconciliationRepository.save(reconciliationOrig.mergeUpdates(tobemerged)); logger.debug(logstr + "updated reconciliation entry " + reconciliation.fetchLogDetails()); return reconciliation; }