Пример #1
0
 @Override
 public int updateTravelPlan(TravelPlan travelPlan) {
   int id = m_travelPlanDao.update(travelPlan);
   if (id > 0) {
     m_travelPlans.put(travelPlan.getId(), travelPlan);
   }
   return id;
 }
Пример #2
0
 @Override
 public int insertTravelPlan(TravelPlan travelPlan) {
   int id = m_travelPlanDao.insert(travelPlan);
   if (id > 0) {
     m_travelPlans.put(travelPlan.getId(), travelPlan);
   }
   return id;
 }
Пример #3
0
 @Override
 public int deleteTravelPlan(int travelPlanId) {
   int id = m_travelPlanDao.delete(travelPlanId);
   if (id > 0) {
     m_travelPlans.remove(travelPlanId);
   }
   return id;
 }
Пример #4
0
  @SuppressWarnings("unchecked")
  @Override
  public void afterPropertiesSet() throws Exception {
    List<TravelPlan> categories = m_travelPlanDao.findAllTravelPlan();

    for (TravelPlan travelPlan : categories) {
      m_travelPlans.put(travelPlan.getId(), travelPlan);
    }
  }
Пример #5
0
 @Override
 public TravelPlan findTravelPlan(int travelPlanId) {
   TravelPlan travelPlan = m_travelPlans.get(travelPlanId);
   if (travelPlan == null) {
     TravelPlan temp = m_travelPlanDao.findById(travelPlanId);
     if (temp != null) {
       m_travelPlans.put(travelPlanId, temp);
     }
     return temp;
   }
   return travelPlan;
 }