1   package org.wcb.model.dao.impl;
2   
3   import org.wcb.model.dao.IAirportDAO;
4   import org.wcb.model.vo.hibernate.AirportBO;
5   import org.wcb.exception.DAOException;
6   import org.wcb.exception.InfrastructureException;
7   
8   import java.util.List;
9   
10  /**
11   * <small>
12   * Copyright (c)  2006  wbogaardt.
13   * Permission is granted to copy, distribute and/or modify this document
14   * under the terms of the GNU Free Documentation License, Version 1.2
15   * or any later version published by the Free Software Foundation;
16   * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
17   * Texts.  A copy of the license is included in the section entitled "GNU
18   * Free Documentation License".
19   * <p/>
20   * $File:  $ <br>
21   * $Change:  $ submitted by $Author: wbogaardt $ at $DateTime: Mar 24, 2006 10:09:00 AM $ <br>
22   * </small>
23   *
24   * @author wbogaardt
25   * @version 1
26   *          Date: Mar 24, 2006
27   *          Time: 10:09:00 AM
28   */
29  
30  public class AirportDAO extends AbstractHibernateDAO implements IAirportDAO {
31  
32      public AirportBO findAirportFAA(String faacode) throws InfrastructureException {
33      	try {
34      		return (AirportBO) getObjectsBy(AirportBO.class, "faa", faacode).get(0);
35      	} catch (DAOException daoe) {
36      		throw new InfrastructureException(daoe);
37      	}
38      }
39  
40      public List<AirportBO> findAll() throws InfrastructureException {
41      	try {
42      		return super.getObjects(AirportBO.class);
43      	} catch (DAOException daoe) {
44      		throw new InfrastructureException(daoe);
45      	}
46      }
47  
48      public void deleteAirport(AirportBO oAirport) throws InfrastructureException {
49          getHibernateTemplate().delete(oAirport);
50      }
51  }