/** * This method checks to see if the BudgetSubAwardPeriodDetail has changed from the database * version. If checkDirect is true then it checks on the value of direct cost. If checkDirect is * false, it is checked based on the value of indirect cost. * * @param detail * @param checkDirect * @return */ private boolean hasBeenChanged(BudgetSubAwardPeriodDetail detail, boolean checkDirect) { boolean changed = false; if (detail != null && detail.getBudgetSubAwardDetailId() != null) { Map primaryKeys = new HashMap(); primaryKeys.put("SUBAWARD_PERIOD_DETAIL_ID", detail.getBudgetSubAwardDetailId()); BudgetSubAwardPeriodDetail dbDetail = getBusinessObjectService() .findByPrimaryKey(BudgetSubAwardPeriodDetail.class, primaryKeys); if (checkDirect) { changed = !BudgetDecimal.returnZeroIfNull(detail.getDirectCost()) .equals(BudgetDecimal.returnZeroIfNull(dbDetail.getDirectCost())); } else { changed = !BudgetDecimal.returnZeroIfNull(detail.getIndirectCost()) .equals(BudgetDecimal.returnZeroIfNull(dbDetail.getIndirectCost())); } } return changed; }