@Transactional public OffersInfo updateOffersInfo(int companyId, int offerId, OffersInfo offersInfo) throws Exception { try { OfferInfoPrimaryKey id = Conversions.getOfferInfoPrimaryKey(companyId, offerId); OfferInfoDbType dbEntry = offersInfoDao.find(id); updateOfferInfoDbEntry(dbEntry, offersInfo); return offersInfo; } catch (Exception e) { logger.error( "error updating offers for : " + companyId + " and : " + offersInfo.getBranchId() + " : " + e.getMessage()); throw new Exception( "error updating offers for : " + companyId + " and : " + offersInfo.getBranchId() + " : " + e.getMessage()); } }
public OffersInfo getOfferOrInfo(int companyId, int offerId) throws Exception { try { OfferInfoDbType dbEntry = offersInfoDao.find(Conversions.getOfferInfoPrimaryKey(companyId, offerId)); OffersInfo out = Conversions.getOffersInfo(dbEntry); return out; } catch (Exception e) { logger.error( "error getting offer for : " + companyId + " and : offer id" + offerId + " : " + e.getMessage()); throw new Exception( "error getting offers for : " + companyId + " and : offer id" + offerId + " : " + e.getMessage()); } }