Package model

Examples of model.ZoneType


    private ZoneTypeDAO() {
    }

    public static ZoneType getZoneType(int zone_type_id) throws SQLException {
        ZoneType zoneType = null;

        String query = "SELECT * FROM `zone_type` WHERE `zone_type_id` = ?";

        Connection connection = null;
        PreparedStatement pstmt = null;

        try {
            connection = DAO.getDataSource().getConnection();
            pstmt = connection.prepareStatement(query);
            pstmt.setInt(1, zone_type_id);
            ResultSet rs = pstmt.executeQuery();

            if (rs.next()) {
                zoneType = new ZoneType(zone_type_id, rs.getBoolean("contains_water"));
            }

            pstmt.close();
        } finally {
            if (connection != null) {
View Full Code Here


                                ParamTableDAO.createParameters(zone_id);
                                PreyPredatorRatioDAO.createParameters(world.getCreatorID(),zone_id);
                                zone.setParameters(ParamTableDAO.getByZoneID(zone_id));

                                ZoneType zoneType = ZoneTypeDAO.getZoneType(zone.getType());

                                if (zoneType.containsWater()) {
                                    WaterSource waterSource = new WaterSource(-1);
                                    waterSource.setMaxWater(100);
                                    waterSource.setWater(100);
                                    waterSource.setZoneID(zone_id);
View Full Code Here

TOP

Related Classes of model.ZoneType

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.