public List<OffersInfo> getOffersInfo() throws Exception { try { List<OfferInfoDbType> listDbEntries = offersInfoDao.findAll(); List<OffersInfo> out = new ArrayList<OffersInfo>(listDbEntries.size()); for (OfferInfoDbType dbEntry : listDbEntries) { out.add(Conversions.getOffersInfo(dbEntry)); } return out; } catch (Exception e) { logger.error("error getting all offers for : " + e.getMessage()); throw new Exception("error getting all offers for : " + e.getMessage()); } }
public List<OffersInfo> getOffersInfo(int companyId) throws Exception { try { List<OfferInfoDbType> listDbEntries = offersInfoDao.getOffersAndInfo(companyId); List<OffersInfo> out = new ArrayList<OffersInfo>(listDbEntries.size()); for (OfferInfoDbType dbEntry : listDbEntries) { out.add(Conversions.getOffersInfo(dbEntry)); } return out; } catch (Exception e) { logger.error("error getting offers for : " + companyId + " and : " + " : " + e.getMessage()); throw new Exception( "error getting offers for : " + companyId + " and : " + " : " + 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()); } }