Package dao

Examples of dao.IAirportDAO


        return EVAL_BODY_INCLUDE;
    }

    @Override
    public int doEndTag() throws JspException {
        IAirportDAO factory =  DAOFactory.getDAOFactory(1).getAirportDAO();
        ArrayList<Flight> flightList = (ArrayList<Flight>) DAOFactory.getDAOFactory(1).getFlightDAO().flightList(flightCount);
        Collections.sort(flightList, new FlightComparatorTimeDesc());
        try {
            for (Flight flight: flightList) {
                flight.setDepartureAirport(factory.loadCountryName(flight.getDepartureAirport()));
                flight.setDestinationAirport(factory.loadCountryName(flight.getDestinationAirport()));
                pageContext.setAttribute("singleFlight", flight, PageContext.REQUEST_SCOPE);
                pageContext.include("../Templates/Flight.jsp");
            }
        } catch (ServletException|IOException e) {
            throw new JspException();
View Full Code Here


        return stringBuffer;
    }

    private StringBuffer getAirportList(String targetId) {
        StringBuffer stringBuffer = new StringBuffer();
        IAirportDAO factory = DAOFactory.getDAOFactory(1).getAirportDAO();
        List<Airport> allAirportList = factory.allAirportList();
        for (Airport airport: allAirportList) {
            if(airport.getName().trim().toLowerCase().startsWith(targetId)) {
                stringBuffer.append("<airport>");
                stringBuffer.append("<name>");
                stringBuffer.append(airport.getName());
                stringBuffer.append("</name>");
                stringBuffer.append("<incountry>");
                stringBuffer.append(factory.loadCountryName(airport).getInCountry().getName());
                stringBuffer.append("</incountry>");
                stringBuffer.append("</airport>");
            }
        }
        return stringBuffer;
View Full Code Here

TOP

Related Classes of dao.IAirportDAO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.