예제 #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;
 }