Пример #1
0
 public boolean delete(Airport airport) {
   ActionContext ctx = ActionContext.getContext();
   Integer aid = airport.getAid();
   String hql = "from Airport as airport where aid='" + aid + "'";
   List list = airportDao.findByHql(hql);
   if (list.isEmpty()) return false;
   else {
     Airport delairport = (Airport) list.get(0);
     airportDao.delete(delairport);
     return true;
   }
 }
Пример #2
0
 public boolean updateAirportByManager(Airport airport) {
   ActionContext ctx = ActionContext.getContext();
   session = (Map<String, Object>) ctx.getSession();
   Integer aid = airport.getAid();
   String hql = "from Airport as airport where aid='" + aid + "'";
   List list = airportDao.findByHql(hql);
   if (list.isEmpty()) return false;
   else {
     airport = (Airport) list.get(0);
     session.put("airport", airport);
     return true;
   }
 }
Пример #3
0
 public boolean find(Airport airport) {
   ActionContext ctx = ActionContext.getContext();
   session = (Map<String, Object>) ctx.getSession();
   String portname = airport.getPortname();
   String hql = "from Airport as airport where portname='" + portname + "'";
   List list = airportDao.findByHql(hql);
   if (list.isEmpty()) return false;
   else {
     airport = (Airport) list.get(0);
     session.put("airport", airport);
     return true;
   }
 }
Пример #4
0
 public List list() {
   String hql = "from Airport";
   List list = airportDao.findByHql(hql);
   return list;
 }
Пример #5
0
  public boolean update(Airport airport) {

    if (airportDao.update(airport)) return true;
    else return false;
  }
Пример #6
0
 public boolean add(Airport airport) {
   if (airportDao.save(airport)) return true;
   else return false;
 }
Пример #7
0
 public boolean check(String portname) {
   String hql = "from Airport as airport where portname='" + portname + "'";
   List list = airportDao.findByHql(hql);
   if (list.isEmpty()) return false;
   else return true;
 }