Package banco_imobiliario.model

Examples of banco_imobiliario.model.Imovel


    }

    @Override
    public ArrayList<Imovel> getAllLogradouros() {
       
        Imovel imovel = null;
        ArrayList<Imovel> imoveis = new ArrayList<Imovel>();
       
        String sqlQuery = "SELECT id, nome, aluguel, aluguel_uma_casa, aluguel_duas_casas, " +
                          "aluguel_tres_casas, aluguel_quatro_casas, aluguel_hotel, hotel, casa, hipoteca, valor, indice " +
                          "FROM logradouro";
       
        try{
          
            conexaoBanco = DAOConection.getConnection();
            preparedStatement = conexaoBanco.prepareStatement(sqlQuery);       
            resultadoConsulta = preparedStatement.executeQuery();
           
            while(resultadoConsulta.next()){
               
                imovel = new Imovel();
               
                imovel.setId( Integer.valueOf(resultadoConsulta.getString("id")) );
                imovel.setNome( resultadoConsulta.getString("nome") );
                imovel.setAluguel( Integer.valueOf(resultadoConsulta.getString("aluguel")) );
                imovel.setAluguelUmaCasa( Integer.valueOf(resultadoConsulta.getString("aluguel_uma_casa")) );
                imovel.setAluguelDuasCasas( Integer.valueOf(resultadoConsulta.getString("aluguel_duas_casas")) );
                imovel.setAluguelTresCasas( Integer.valueOf(resultadoConsulta.getString("aluguel_tres_casas")) );
                imovel.setAluguelQuatroCasas( Integer.valueOf(resultadoConsulta.getString("aluguel_quatro_casas")) );
                imovel.setAluguelHotel( Integer.valueOf(resultadoConsulta.getString("aluguel_hotel")) );
                imovel.setPrecoConstrucaoHotel( Integer.valueOf(resultadoConsulta.getString("hotel")) );
                imovel.setPrecoConstrucaoResidencia( Integer.valueOf(resultadoConsulta.getString("casa")) );
                imovel.setHipoteca(Integer.valueOf(resultadoConsulta.getString("hipoteca")) );
                imovel.setPreco(Integer.valueOf(resultadoConsulta.getString("valor")) );
                imovel.setIndice(Integer.valueOf(resultadoConsulta.getString("indice")) );
               
                imoveis.add(imovel);
            }    
           
            preparedStatement.close();
View Full Code Here


    }

    @Override
    public Imovel buscarImovel(int id) {
        
        Imovel imovel = new Imovel();
              
        String sqlQuery = "SELECT id, nome, aluguel, aluguel_uma_casa, aluguel_duas_casas, " +
                          "aluguel_tres_casas, aluguel_quatro_casas, aluguel_hotel, hotel, casa, hipoteca, valor, indice " +
                          "FROM logradouro WHERE indice = ?";
       
        try{
          
            conexaoBanco = DAOConection.getConnection();
            preparedStatement = conexaoBanco.prepareStatement(sqlQuery);   
            preparedStatement.setInt(1, id);
            resultadoConsulta = preparedStatement.executeQuery();
           
            while(resultadoConsulta.next()){
               
              
               
                imovel.setId( Integer.valueOf(resultadoConsulta.getString("id")) );
                imovel.setNome( resultadoConsulta.getString("nome") );
                imovel.setAluguel( Integer.valueOf(resultadoConsulta.getString("aluguel")) );
                imovel.setAluguelUmaCasa( Integer.valueOf(resultadoConsulta.getString("aluguel_uma_casa")) );
                imovel.setAluguelDuasCasas( Integer.valueOf(resultadoConsulta.getString("aluguel_duas_casas")) );
                imovel.setAluguelTresCasas( Integer.valueOf(resultadoConsulta.getString("aluguel_tres_casas")) );
                imovel.setAluguelQuatroCasas( Integer.valueOf(resultadoConsulta.getString("aluguel_quatro_casas")) );
                imovel.setAluguelHotel( Integer.valueOf(resultadoConsulta.getString("aluguel_hotel")) );
                imovel.setPrecoConstrucaoHotel( Integer.valueOf(resultadoConsulta.getString("hotel")) );
                imovel.setPrecoConstrucaoResidencia( Integer.valueOf(resultadoConsulta.getString("casa")) );
                imovel.setHipoteca(Integer.valueOf(resultadoConsulta.getString("hipoteca")) );
                imovel.setPreco(Integer.valueOf(resultadoConsulta.getString("valor")) );
                imovel.setIndice(Integer.valueOf(resultadoConsulta.getString("indice")) );
               
               
            }    
           
            preparedStatement.close();
View Full Code Here

    @Override
    public CasaDePropriedade criarLogradouro(int id) {
        //Instanciando Objetos
        ImovelDAO imovelDao = new ImovelDAOImpl();       
        Imovel imovel;
       
        //Atribuindo ao objeto o retorno da empresa no banco de dados de acordo com o id passado
        imovel = imovelDao.buscarImovel(id);
              
        return imovel;
View Full Code Here

TOP

Related Classes of banco_imobiliario.model.Imovel

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.