package com.ejie.m62fb.dao.registroVPP;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import javax.annotation.Resource;
import javax.sql.DataSource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.ejie.m62fb.model.M62fbr48s0s00;
import com.ejie.x38.dto.Pagination;

/**
 * M62fbr46s0s00DaoImpl generated by UDA, 17-oct-2012 15:03:38.
 * 
XXXX
 */

@Repository
@Transactional
public class M62fbr48s0s00DaoImpl implements M62fbr48s0s00Dao {
	private JdbcTemplate jdbcTemplate;
	private RowMapper<M62fbr48s0s00> rwMap = new RowMapper<M62fbr48s0s00>() {
		public M62fbr48s0s00 mapRow(ResultSet resultSet, int rowNum)
				throws SQLException {
			return new M62fbr48s0s00(resultSet.getBigDecimal("ID_M62R48T0"),
					resultSet.getBigDecimal("ID_M62R49T0"),
					resultSet.getString("CODIGO_ARTICULO"),
					resultSet.getString("CODIGO_CLIENTE"),
					resultSet.getString("NOMBRE_PROPIETARIOV"),
					resultSet.getString("PROPIETARIOV"),
					resultSet.getString("TIPO_CLIENTE"),
					resultSet.getString("FECHA_INICIO"),
					resultSet.getString("FECHAFIRMACONTRATO"),
					resultSet.getString("FECHAFINCONTRATOALQUILER"),
					resultSet.getString("FECHAINICIOCONTRATODELEGACION"),
					resultSet.getString("FECHAFINCONTRATODELEGACION"),
					resultSet.getString("VIAPUBLICA"),
					resultSet.getString("NUMERO1"),
					resultSet.getString("NUMERO2"),
					resultSet.getString("ESCALERA"),
					resultSet.getString("PISO"), resultSet.getString("PUERTA"),
					resultSet.getString("LETRA"),
					resultSet.getString("MUNICIPIOVIVIENDA"),
					resultSet.getString("CODIGOPOSTALVIVIENDA"),
					resultSet.getString("PROVINCIA"),
					resultSet.getString("NUMEROBANOS"),
					resultSet.getString("NUMEROHABITACIONES"),
					resultSet.getString("METROSUTILES"),
					resultSet.getString("NGARAJE"),
					resultSet.getString("PLANTAGARAJE"),
					resultSet.getString("METROSG"),
					resultSet.getString("NTRASTERO"),
					resultSet.getString("PLANTATRASTERO"),
					resultSet.getString("METROST"),
					resultSet.getString("NCALIFICACION"),
					resultSet.getString("MUNICIPIOPROMOCION"),
					resultSet.getString("NCODIGOETXEBIDE"),
					resultSet.getString("RAZONSOCIAL"),
					resultSet.getString("CIFDNI"),
					resultSet.getString("TITULAR2"),
					resultSet.getString("DNI2"),
					resultSet.getString("TITULAR3"),
					resultSet.getString("DNI3"),
					resultSet.getString("PRECIOV"),
					resultSet.getString("PRECIOG"),
					resultSet.getString("BASEIMPONIBLE1"),
					resultSet.getString("BASEIMPONIBLE2"),
					resultSet.getString("BASEIMPONIBLEPONDERADA"),
					resultSet.getString("NUMEROMIEMBROS"),
					resultSet.getString("NUMEROPERCEPTORES"),
					resultSet.getString("IMPORTEINICIALRENTA"),
					resultSet.getString("DESCRIPCION2ARTICULO"),
					resultSet.getString("REFERENCIACATASTRAL"),
					resultSet.getString("REFERENCIACATASTRAL_T"),
					resultSet.getString("FECHAENTREGALLAVES"));
		}
	};

	/**
	 * Method use to set the datasource.
	 * 
	 * @param dataSource
	 *            DataSource
	 * @return
	 */
	@Resource
	public void setDataSource(DataSource dataSource) {
		this.jdbcTemplate = new JdbcTemplate(dataSource);
	}

	/**
	 * Inserts a single row in the M62fbr46s0s00 table.
	 * 
	 * @param m62fbr46s0s00
	 *            Pagination
	 * @return M62fbr46s0s00
	 */
	public M62fbr48s0s00 add(M62fbr48s0s00 m62fbr48s0s00) {
		// KeyHolder keyHolder = new GeneratedKeyHolder();

		String query = "INSERT INTO M62R48T0S00 ( CODIGO_ARTICULO, CODIGO_CLIENTE, NOMBRE_PROPIETARIOV, PROPIETARIOV, TIPO_CLIENTE, FECHA_INICIO, ";
		query = query
				+ " FECHAFIRMACONTRATO, FECHAFINCONTRATOALQUILER, FECHAINICIOCONTRATODELEGACION, FECHAFINCONTRATODELEGACION, VIAPUBLICA, NUMERO1, NUMERO2, ";
		query = query
				+ " ESCALERA, PISO, PUERTA, LETRA, MUNICIPIOVIVIENDA, CODIGOPOSTALVIVIENDA, PROVINCIA, NUMEROBANOS, NUMEROHABITACIONES, METROSUTILES, NGARAJE, ";
		query = query
				+ " PLANTAGARAJE, METROSG, NTRASTERO, PLANTATRASTERO, METROST, NCALIFICACION, MUNICIPIOPROMOCION, NCODIGOETXEBIDE, RAZONSOCIAL, CIFDNI, TITULAR2, ";
		query = query
				+ " DNI2, TITULAR3, DNI3, PRECIOV, PRECIOG, BASEIMPONIBLE1, BASEIMPONIBLE2, BASEIMPONIBLEPONDERADA, NUMEROMIEMBROS, NUMEROPERCEPTORES, IMPORTEINICIALRENTA, ";
		query = query
				+ " DESCRIPCION2ARTICULO, REFERENCIACATASTRAL, REFERENCIACATASTRAL_T, FECHAENTREGALLAVES, ID_M62R49T0) VALUES (";

		if (m62fbr48s0s00 != null && m62fbr48s0s00.getCODIGO_ARTICULO() != null
				&& m62fbr48s0s00.getCODIGO_ARTICULO() != "") {
			query = query + "'" + m62fbr48s0s00.getCODIGO_ARTICULO() + "'";
		} else {
			query = query + "NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getCODIGO_CLIENTE() != null
				&& m62fbr48s0s00.getCODIGO_CLIENTE() != "") {
			query = query + ",'" + m62fbr48s0s00.getCODIGO_CLIENTE() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getNOMBRE_PROPIETARIOV() != null
				&& m62fbr48s0s00.getNOMBRE_PROPIETARIOV() != "") {
			query = query + ",'" + m62fbr48s0s00.getNOMBRE_PROPIETARIOV() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getPROPIETARIOV() != null
				&& m62fbr48s0s00.getPROPIETARIOV() != "") {
			query = query + ",'" + m62fbr48s0s00.getPROPIETARIOV() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getTIPO_CLIENTE() != null
				&& m62fbr48s0s00.getTIPO_CLIENTE() != "") {
			query = query + ",'" + m62fbr48s0s00.getTIPO_CLIENTE() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getFECHA_INICIO() != null
				&& m62fbr48s0s00.getFECHA_INICIO() != "") {
			query = query + ",TO_DATE('" + m62fbr48s0s00.getFECHA_INICIO()
					+ "','DD/MM/YYYY')";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getFECHAFIRMACONTRATO() != null
				&& m62fbr48s0s00.getFECHAFIRMACONTRATO() != "") {
			query = query + ",TO_DATE('"
					+ m62fbr48s0s00.getFECHAFIRMACONTRATO() + "','DD/MM/YYYY')";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getFECHAFINCONTRATOALQUILER() != null
				&& m62fbr48s0s00.getFECHAFINCONTRATOALQUILER() != "") {
			query = query + ",TO_DATE('"
					+ m62fbr48s0s00.getFECHAFINCONTRATOALQUILER()
					+ "','DD/MM/YYYY')";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getFECHAINICIOCONTRATODELEGACION() != null
				&& m62fbr48s0s00.getFECHAINICIOCONTRATODELEGACION() != "") {
			query = query + ",TO_DATE('"
					+ m62fbr48s0s00.getFECHAINICIOCONTRATODELEGACION()
					+ "','DD/MM/YYYY')";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getFECHAFINCONTRATODELEGACION() != null
				&& m62fbr48s0s00.getFECHAFINCONTRATODELEGACION() != "") {
			query = query + ",TO_DATE('"
					+ m62fbr48s0s00.getFECHAFINCONTRATODELEGACION()
					+ "','DD/MM/YYYY')";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getVIAPUBLICA() != null
				&& m62fbr48s0s00.getVIAPUBLICA() != "") {
			query = query + ",'" + m62fbr48s0s00.getVIAPUBLICA() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getNUMERO1() != null
				&& m62fbr48s0s00.getNUMERO1() != "") {
			query = query + ",'" + m62fbr48s0s00.getNUMERO1() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getNUMERO2() != null
				&& m62fbr48s0s00.getNUMERO2() != "") {
			query = query + ",'" + m62fbr48s0s00.getNUMERO2() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getESCALERA() != null
				&& m62fbr48s0s00.getESCALERA() != "") {
			query = query + ",'" + m62fbr48s0s00.getESCALERA() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getPISO() != null
				&& m62fbr48s0s00.getPISO() != "") {
			query = query + ",'" + m62fbr48s0s00.getPISO() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getPUERTA() != null
				&& m62fbr48s0s00.getPUERTA() != "") {
			query = query + ",'" + m62fbr48s0s00.getPUERTA() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getLETRA() != null
				&& m62fbr48s0s00.getLETRA() != "") {
			query = query + ",'" + m62fbr48s0s00.getLETRA() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getMUNICIPIOVIVIENDA() != null
				&& m62fbr48s0s00.getMUNICIPIOVIVIENDA() != "") {
			query = query + ",'" + m62fbr48s0s00.getMUNICIPIOVIVIENDA() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getCODIGOPOSTALVIVIENDA() != null
				&& m62fbr48s0s00.getCODIGOPOSTALVIVIENDA() != "") {
			query = query + ",'" + m62fbr48s0s00.getCODIGOPOSTALVIVIENDA()
					+ "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getPROVINCIA() != null
				&& m62fbr48s0s00.getPROVINCIA() != "") {
			query = query + ",'" + m62fbr48s0s00.getPROVINCIA() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getNUMEROBANOS() != null
				&& m62fbr48s0s00.getNUMEROBANOS() != "") {
			query = query + ",'" + m62fbr48s0s00.getNUMEROBANOS() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getNUMEROHABITACIONES() != null
				&& m62fbr48s0s00.getNUMEROHABITACIONES() != "") {
			query = query + ",'" + m62fbr48s0s00.getNUMEROHABITACIONES() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getMETROSUTILES() != null
				&& m62fbr48s0s00.getMETROSUTILES() != "") {
			query = query + "," + m62fbr48s0s00.getMETROSUTILES();
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getNGARAJE() != null
				&& m62fbr48s0s00.getNGARAJE() != "") {
			query = query + ",'" + m62fbr48s0s00.getNGARAJE() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getPLANTAGARAJE() != null
				&& m62fbr48s0s00.getPLANTAGARAJE() != "") {
			query = query + ",'" + m62fbr48s0s00.getPLANTAGARAJE() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getMETROSG() != null
				&& m62fbr48s0s00.getMETROSG() != "") {
			query = query + "," + m62fbr48s0s00.getMETROSG();
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getNTRASTERO() != null
				&& m62fbr48s0s00.getNTRASTERO() != "") {
			query = query + ",'" + m62fbr48s0s00.getNTRASTERO() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getPLANTATRASTERO() != null
				&& m62fbr48s0s00.getPLANTATRASTERO() != "") {
			query = query + ",'" + m62fbr48s0s00.getPLANTATRASTERO() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getMETROST() != null
				&& m62fbr48s0s00.getMETROST() != "") {
			query = query + "," + m62fbr48s0s00.getMETROST();
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getNCALIFICACION() != null
				&& m62fbr48s0s00.getNCALIFICACION() != "") {
			query = query + ",'" + m62fbr48s0s00.getNCALIFICACION() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getMUNICIPIOPROMOCION() != null
				&& m62fbr48s0s00.getMUNICIPIOPROMOCION() != "") {
			query = query + ",'" + m62fbr48s0s00.getMUNICIPIOPROMOCION() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getNCODIGOETXEBIDE() != null
				&& m62fbr48s0s00.getNCODIGOETXEBIDE() != "") {
			query = query + ",'" + m62fbr48s0s00.getNCODIGOETXEBIDE() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getRAZONSOCIAL() != null
				&& m62fbr48s0s00.getRAZONSOCIAL() != "") {
			query = query + ",'" + m62fbr48s0s00.getRAZONSOCIAL() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getCIFDNI() != null
				&& m62fbr48s0s00.getCIFDNI() != "") {
			query = query + ",'" + m62fbr48s0s00.getCIFDNI() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getTITULAR2() != null
				&& m62fbr48s0s00.getTITULAR2() != "") {
			query = query + ",'" + m62fbr48s0s00.getTITULAR2() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getDNI2() != null
				&& m62fbr48s0s00.getDNI2() != "") {
			query = query + ",'" + m62fbr48s0s00.getDNI2() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getTITULAR3() != null
				&& m62fbr48s0s00.getTITULAR3() != "") {
			query = query + ",'" + m62fbr48s0s00.getTITULAR3() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getDNI3() != null
				&& m62fbr48s0s00.getDNI3() != "") {
			query = query + ",'" + m62fbr48s0s00.getDNI3() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getPRECIOV() != null
				&& m62fbr48s0s00.getPRECIOV() != "") {
			query = query + "," + m62fbr48s0s00.getPRECIOV();
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getPRECIOG() != null
				&& m62fbr48s0s00.getPRECIOG() != "") {
			query = query + "," + m62fbr48s0s00.getPRECIOG();
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getBASEIMPONIBLE1() != null
				&& m62fbr48s0s00.getBASEIMPONIBLE1() != "") {
			query = query + "," + m62fbr48s0s00.getBASEIMPONIBLE1();
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getBASEIMPONIBLE2() != null
				&& m62fbr48s0s00.getBASEIMPONIBLE2() != "") {
			query = query + "," + m62fbr48s0s00.getBASEIMPONIBLE2();
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getBASEIMPONIBLEPONDERADA() != null
				&& m62fbr48s0s00.getBASEIMPONIBLEPONDERADA() != "") {
			query = query + "," + m62fbr48s0s00.getBASEIMPONIBLEPONDERADA();
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getNUMEROMIEMBROS() != null
				&& m62fbr48s0s00.getNUMEROMIEMBROS() != "") {
			query = query + "," + m62fbr48s0s00.getNUMEROMIEMBROS();
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getNUMEROPERCEPTORES() != null
				&& m62fbr48s0s00.getNUMEROPERCEPTORES() != "") {
			query = query + "," + m62fbr48s0s00.getNUMEROPERCEPTORES();
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getIMPORTEINICIALRENTA() != null
				&& m62fbr48s0s00.getIMPORTEINICIALRENTA() != "") {
			query = query + "," + m62fbr48s0s00.getIMPORTEINICIALRENTA();
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getDESCRIPCION2ARTICULO() != null
				&& m62fbr48s0s00.getDESCRIPCION2ARTICULO() != "") {
			query = query + ",'" + m62fbr48s0s00.getDESCRIPCION2ARTICULO()
					+ "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getREFERENCIACATASTRAL() != null
				&& m62fbr48s0s00.getREFERENCIACATASTRAL() != "") {
			query = query + ",'" + m62fbr48s0s00.getREFERENCIACATASTRAL() + "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getREFERENCIACATASTRAL_T() != null
				&& m62fbr48s0s00.getREFERENCIACATASTRAL_T() != "") {
			query = query + ",'" + m62fbr48s0s00.getREFERENCIACATASTRAL_T()
					+ "'";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null
				&& m62fbr48s0s00.getFECHAENTREGALLAVES() != null
				&& m62fbr48s0s00.getFECHAENTREGALLAVES() != "") {
			query = query + ",TO_DATE('"
					+ m62fbr48s0s00.getFECHAENTREGALLAVES() + "','DD/MM/YYYY')";
		} else {
			query = query + ",NULL";
		}
		if (m62fbr48s0s00 != null && m62fbr48s0s00.getID_M62R49T0() != null) {
			query = query + "," + m62fbr48s0s00.getID_M62R49T0();
		} else {
			query = query + ",NULL";
		}
		query = query + ")";

		this.jdbcTemplate.update(query);

		// obtener ID_EXPEDIENTE generado por el trigger
		/*
		 * m62fbr48s0s00.setID_M62R48T0(new BigDecimal(keyHolder.getKeys()
		 * .get("ID_M62R48T0").toString()));
		 */

		/*
		 * this.jdbcTemplate.update(query, m62fbr48s0s00.getCODIGO_ARTICULO(),
		 * m62fbr48s0s00.getCODIGO_CLIENTE(),
		 * m62fbr48s0s00.getNOMBRE_PROPIETARIOV(),
		 * m62fbr48s0s00.getPROPIETARIOV(), m62fbr48s0s00.getTIPO_CLIENTE(),
		 * m62fbr48s0s00.getFECHA_INICIO(),
		 * m62fbr48s0s00.getFECHAFIRMACONTRATO(),
		 * m62fbr48s0s00.getFECHAFINCONTRATOALQUILER(),
		 * m62fbr48s0s00.getFECHAINICIOCONTRATODELEGACION(),
		 * m62fbr48s0s00.getFECHAFINCONTRATODELEGACION(),
		 * m62fbr48s0s00.getVIAPUBLICA(), m62fbr48s0s00.getNUMERO1(),
		 * m62fbr48s0s00.getNUMERO2(), m62fbr48s0s00.getESCALERA(),
		 * m62fbr48s0s00.getPISO(), m62fbr48s0s00.getPUERTA(),
		 * m62fbr48s0s00.getLETRA(), m62fbr48s0s00.getMUNICIPIOVIVIENDA(),
		 * m62fbr48s0s00.getCODIGOPOSTALVIVIENDA(),
		 * m62fbr48s0s00.getPROVINCIA(), m62fbr48s0s00.getNUMEROBANOS(),
		 * m62fbr48s0s00.getNUMEROHABITACIONES(),
		 * m62fbr48s0s00.getMETROSUTILES(), m62fbr48s0s00.getNGARAJE(),
		 * m62fbr48s0s00.getPLANTAGARAJE(), m62fbr48s0s00.getMETROSG(),
		 * m62fbr48s0s00.getNTRASTERO(), m62fbr48s0s00.getPLANTATRASTERO(),
		 * m62fbr48s0s00.getMETROST(), m62fbr48s0s00.getNCALIFICACION(),
		 * m62fbr48s0s00.getMUNICIPIOPROMOCION(),
		 * m62fbr48s0s00.getNCODIGOETXEBIDE(), m62fbr48s0s00.getRAZONSOCIAL(),
		 * m62fbr48s0s00.getCIFDNI(), m62fbr48s0s00.getTITULAR2(),
		 * m62fbr48s0s00.getDNI2(), m62fbr48s0s00.getTITULAR3(),
		 * m62fbr48s0s00.getDNI3(), m62fbr48s0s00.getPRECIOV(),
		 * m62fbr48s0s00.getPRECIOG(), m62fbr48s0s00.getBASEIMPONIBLE1(),
		 * m62fbr48s0s00.getBASEIMPONIBLE2(),
		 * m62fbr48s0s00.getBASEIMPONIBLEPONDERADA(),
		 * m62fbr48s0s00.getNUMEROMIEMBROS(),
		 * m62fbr48s0s00.getNUMEROPERCEPTORES(),
		 * m62fbr48s0s00.getIMPORTEINICIALRENTA(),
		 * m62fbr48s0s00.getDESCRIPCION2ARTICULO(),
		 * m62fbr48s0s00.getREFERENCIACATASTRAL(),
		 * m62fbr48s0s00.getREFERENCIACATASTRAL_T(),
		 * m62fbr48s0s00.getFECHAENTREGALLAVES());
		 */
		return m62fbr48s0s00;
	}

	/**
	 * Updates a single row in the M62fbr46s0s00 table.
	 * 
	 * @param m62fbr46s0s00
	 *            Pagination
	 * @return M62fbr46s0s00
	 */
	public M62fbr48s0s00 update(M62fbr48s0s00 m62fbr48s0s00) {
		return m62fbr48s0s00;
	}

	/**
	 * Finds a single row in the M62fbr46s0s00 table.
	 * 
	 * @param m62fbr46s0s00
	 *            Pagination
	 * @return M62fbr46s0s00
	 */
	@Transactional(readOnly = true, timeout = 500)
	public M62fbr48s0s00 find(M62fbr48s0s00 m62fbr48s0s00) {
		/*
		 * String query =
		 * "SELECT t1.ID_M62R46T0 IDM62R46T0, t1.ID_M62R45T0 IDM62R45T0, t1.NUM_VIVIENDA NUMVIVIENDA, t1.FEH_ULT_MODIF FEHULTMODIF, t1.COD_USU_ULT_MODIF CODUSUULTMODIF, t1.IDE_REGISTRO IDEREGISTRO, t1.FEC_ALTA FECALTA FROM M62R46T0S00 t1  WHERE t1.ID_M62R46T0 = ?   AND t1.ID_M62R45T0 = ?   AND t1.NUM_VIVIENDA = ?   AND t1.FEH_ULT_MODIF = ?   AND t1.COD_USU_ULT_MODIF = ?   AND t1.IDE_REGISTRO = ?   AND t1.FEC_ALTA = ?  "
		 * ;
		 * 
		 * List<M62fbr46s0s00> m62fbr46s0s00List =
		 * this.jdbcTemplate.query(query, this.rwMap,
		 * m62fbr46s0s00.getIdM62r46t0(), m62fbr46s0s00.getIdM62r45t0(),
		 * m62fbr46s0s00.getNumVivienda(), m62fbr46s0s00.getFehUltModif(),
		 * m62fbr46s0s00.getCodUsuUltModif(), m62fbr46s0s00.getIdeRegistro(),
		 * m62fbr46s0s00.getFecAlta()); return (M62fbr46s0s00)
		 * DataAccessUtils.uniqueResult(m62fbr46s0s00List);
		 */
		return m62fbr48s0s00;
	}

	/**
	 * Removes a single row in the M62fbr46s0s00 table.
	 * 
	 * @param m62fbr46s0s00
	 *            Pagination
	 * @return
	 */
	public void remove(M62fbr48s0s00 m62fbr48s0s00) {
		/*
		 * String query =
		 * "UPDATE M62R44T0S00 SET COD_SITUACION = 'D', FEC_INI_SITUACION = TRUNC(SYSDATE),  FEC_FIN_SITUACION = NULL, FEH_ULT_MODIF = SYSDATE WHERE NUM_VIVIENDA=? "
		 * ; this.jdbcTemplate.update(query, m62fbr46s0s00.getNumVivienda());
		 * 
		 * query =
		 * "DELETE FROM M62R46T0S00 WHERE ID_M62R45T0=? AND NUM_VIVIENDA=? ";
		 * this.jdbcTemplate.update(query, m62fbr46s0s00.getIdM62r45t0(),
		 * m62fbr46s0s00.getNumVivienda());
		 */

	}

	/**
	 * Finds a List of rows in the M62fbr46s0s00 table.
	 * 
	 * @param m62fbr46s0s00
	 *            M62fbr46s0s00
	 * @param pagination
	 *            Pagination
	 * @return List
	 */
	@Transactional(readOnly = true, timeout = 500)
	public List<M62fbr48s0s00> findAll(M62fbr48s0s00 m62fbr48s0s00,
			Pagination pagination) {
		/*
		 * StringBuilder query = new StringBuilder(
		 * "SELECT  t1.ID_M62R46T0 IDM62R46T0,t1.ID_M62R45T0 IDM62R45T0,t1.NUM_VIVIENDA NUMVIVIENDA,t1.FEH_ULT_MODIF FEHULTMODIF,t1.COD_USU_ULT_MODIF CODUSUULTMODIF,t1.IDE_REGISTRO IDEREGISTRO,t1.FEC_ALTA FECALTA "
		 * ); query.append("FROM M62R46T0S00 t1 ");
		 * 
		 * // Where clause & Params Map<String, ?> mapaWhere =
		 * this.getWhereMap(m62fbr46s0s00); StringBuilder where = new
		 * StringBuilder(" WHERE 1=1 "); where.append(mapaWhere.get("query"));
		 * query.append(where);
		 * 
		 * List<?> params = (List<?>) mapaWhere.get("params");
		 * 
		 * if (pagination != null) { query =
		 * pagination.getPaginationQuery(query); }
		 * 
		 * return (List<M62fbr46s0s00>)
		 * this.jdbcTemplate.query(query.toString(), this.rwMap,
		 * params.toArray());
		 */
		return null;
	}

	/**
	 * Counts rows in the M62fbr46s0s00 table.
	 * 
	 * @param m62fbr46s0s00
	 *            M62fbr46s0s00
	 * @return Long
	 */
	@Transactional(readOnly = true, timeout = 500)
	public Long findAllCount(M62fbr48s0s00 m62fbr48s0s00) {
		/*
		 * StringBuilder query = new StringBuilder(
		 * "SELECT COUNT(1) FROM M62R46T0S00 t1 ");
		 * 
		 * // Where clause & Params Map<String, ?> mapaWhere =
		 * this.getWhereMap(m62fbr46s0s00); StringBuilder where = new
		 * StringBuilder(" WHERE 1=1 "); where.append(mapaWhere.get("query"));
		 * query.append(where);
		 * 
		 * List<?> params = (List<?>) mapaWhere.get("params");
		 * 
		 * return this.jdbcTemplate.queryForLong(query.toString(),
		 * params.toArray());
		 */
		return null;
	}

	/**
	 * Finds rows in the M62fbr46s0s00 table using like.
	 * 
	 * @param m62fbr46s0s00
	 *            M62fbr46s0s00
	 * @param pagination
	 *            Pagination
	 * @param startsWith
	 *            Boolean
	 * @return List
	 */
	@Transactional(readOnly = true, timeout = 500)
	public List<M62fbr48s0s00> findAllLike(M62fbr48s0s00 m62fbr48s0s00,
			Pagination pagination, Boolean startsWith) {
		/*
		 * StringBuilder query = new StringBuilder(
		 * "SELECT  t1.ID_M62R46T0 IDM62R46T0,t1.ID_M62R45T0 IDM62R45T0,t1.NUM_VIVIENDA NUMVIVIENDA,t1.FEH_ULT_MODIF FEHULTMODIF,t1.COD_USU_ULT_MODIF CODUSUULTMODIF,t1.IDE_REGISTRO IDEREGISTRO,t1.FEC_ALTA FECALTA "
		 * ); query.append("FROM M62R46T0S00 t1 ");
		 * 
		 * // Where clause & Params Map<String, ?> mapaWhere =
		 * this.getWhereLikeMap(m62fbr46s0s00, startsWith); StringBuilder where
		 * = new StringBuilder(" WHERE 1=1 ");
		 * where.append(mapaWhere.get("query")); query.append(where);
		 * 
		 * List<?> params = (List<?>) mapaWhere.get("params");
		 * 
		 * if (pagination != null) { query =
		 * pagination.getPaginationQuery(query); }
		 * 
		 * return (List<M62fbr46s0s00>)
		 * this.jdbcTemplate.query(query.toString(), this.rwMap,
		 * params.toArray());
		 */
		return null;
	}

	/**
	 * Counts rows in the M62fbr46s0s00 table using like.
	 * 
	 * @param m62fbr46s0s00
	 *            M62fbr46s0s00
	 * @param startsWith
	 *            Boolean
	 * @return Long
	 */
	@Transactional(readOnly = true, timeout = 500)
	public Long findAllLikeCount(M62fbr48s0s00 m62fbr48s0s00, Boolean startsWith) {
		/*
		 * StringBuilder query = new StringBuilder(
		 * "SELECT COUNT(1) FROM M62R46T0S00 t1 ");
		 * 
		 * // Where clause & Params Map<String, ?> mapaWhere =
		 * this.getWhereLikeMap(m62fbr46s0s00, startsWith); StringBuilder where
		 * = new StringBuilder(" WHERE 1=1 ");
		 * where.append(mapaWhere.get("query")); query.append(where);
		 * 
		 * List<?> params = (List<?>) mapaWhere.get("params");
		 * 
		 * return this.jdbcTemplate.queryForLong(query.toString(),
		 * params.toArray());
		 */
		return null;
	}

	/**
	 * Returns a map with the needed value to create the conditions to filter by
	 * the M62fbr46s0s00 entity
	 * 
	 * @param m62fbr46s0s00
	 *            M62fbr46s0s00 Bean with the criteria values to filter by.
	 * @return Map created with two keys key query stores the sql query syntax
	 *         key params stores the parameter values to be used in the
	 *         condition sentence.
	 */
	// CHECKSTYLE:OFF CyclomaticComplexity - Generación de código de UDA
	/*
	 * private Map<String, ?> getWhereMap(M62fbr46s0s00 m62fbr46s0s00) {
	 * 
	 * StringBuffer where = new StringBuffer(
	 * M62fbr48s0s00DaoImpl.STRING_BUILDER_INIT); List<Object> params = new
	 * ArrayList<Object>();
	 * 
	 * if (m62fbr46s0s00 != null && m62fbr46s0s00.getIdM62r46t0() != null) {
	 * where.append(" AND t1.ID_M62R46T0 = ?");
	 * params.add(m62fbr46s0s00.getIdM62r46t0()); } if (m62fbr46s0s00 != null &&
	 * m62fbr46s0s00.getIdM62r45t0() != null) {
	 * where.append(" AND t1.ID_M62R45T0 = ?");
	 * params.add(m62fbr46s0s00.getIdM62r45t0()); } if (m62fbr46s0s00 != null &&
	 * m62fbr46s0s00.getNumVivienda() != null) {
	 * where.append(" AND t1.NUM_VIVIENDA = ?");
	 * params.add(m62fbr46s0s00.getNumVivienda()); } if (m62fbr46s0s00 != null
	 * && m62fbr46s0s00.getFehUltModif() != null) {
	 * where.append(" AND t1.FEH_ULT_MODIF = ?");
	 * params.add(m62fbr46s0s00.getFehUltModif()); } if (m62fbr46s0s00 != null
	 * && m62fbr46s0s00.getCodUsuUltModif() != null) {
	 * where.append(" AND t1.COD_USU_ULT_MODIF = ?");
	 * params.add(m62fbr46s0s00.getCodUsuUltModif()); } if (m62fbr46s0s00 !=
	 * null && m62fbr46s0s00.getIdeRegistro() != null) {
	 * where.append(" AND t1.IDE_REGISTRO = ?");
	 * params.add(m62fbr46s0s00.getIdeRegistro()); } if (m62fbr46s0s00 != null
	 * && m62fbr46s0s00.getFecAlta() != null) {
	 * where.append(" AND t1.FEC_ALTA = ?");
	 * params.add(m62fbr46s0s00.getFecAlta()); }
	 * 
	 * Map<String, Object> mapWhere = new HashMap<String, Object>();
	 * mapWhere.put("query", where); mapWhere.put("params", params);
	 * 
	 * return mapWhere; }
	 */
	// CHECKSTYLE:ON CyclomaticComplexity - Generación de código de UDA

	/**
	 * Returns a map with the needed value to create the conditions to filter by
	 * the M62fbr46s0s00 entity
	 * 
	 * @param m62fbr46s0s00
	 *            M62fbr46s0s00 Bean with the criteria values to filter by.
	 * @param startsWith
	 *            Boolean
	 * @return Map created with two keys key query stores the sql query syntax
	 *         key params stores the parameter values to be used in the
	 *         condition sentence.
	 */
	/*
	 * // CHECKSTYLE:OFF CyclomaticComplexity - Generación de código de UDA
	 * private Map<String, ?> getWhereLikeMap(M62fbr46s0s00 m62fbr46s0s00,
	 * Boolean startsWith) {
	 * 
	 * StringBuffer where = new StringBuffer(
	 * M62fbr48s0s00DaoImpl.STRING_BUILDER_INIT); List<Object> params = new
	 * ArrayList<Object>();
	 * 
	 * if (m62fbr46s0s00 != null && m62fbr46s0s00.getIdM62r46t0() != null) {
	 * where.append(" AND t1.ID_M62R46T0 = ?"); } if (m62fbr46s0s00 != null &&
	 * m62fbr46s0s00.getIdM62r45t0() != null) {
	 * where.append(" AND t1.ID_M62R45T0 = ?"); } if (m62fbr46s0s00 != null &&
	 * m62fbr46s0s00.getNumVivienda() != null) {
	 * where.append(" AND t1.NUM_VIVIENDA = ?"); } if (m62fbr46s0s00 != null &&
	 * m62fbr46s0s00.getFehUltModif() != null) {
	 * where.append(" AND t1.FEH_ULT_MODIF = ?"); } if (m62fbr46s0s00 != null &&
	 * m62fbr46s0s00.getCodUsuUltModif() != null) {
	 * where.append(" AND UPPER(t1.COD_USU_ULT_MODIF) like ? ESCAPE  '\\'"); if
	 * (startsWith) { params.add(m62fbr46s0s00.getCodUsuUltModif().toUpperCase()
	 * + "%"); } else { params.add("%" +
	 * m62fbr46s0s00.getCodUsuUltModif().toUpperCase() + "%"); }
	 * where.append(" AND t1.COD_USU_ULT_MODIF IS NOT NULL"); } if
	 * (m62fbr46s0s00 != null && m62fbr46s0s00.getIdeRegistro() != null) {
	 * where.append(" AND t1.IDE_REGISTRO = ?"); } if (m62fbr46s0s00 != null &&
	 * m62fbr46s0s00.getFecAlta() != null) {
	 * where.append(" AND t1.FEC_ALTA = ?"); }
	 * 
	 * Map<String, Object> mapWhere = new HashMap<String, Object>();
	 * mapWhere.put("query", where); mapWhere.put("params", params);
	 * 
	 * return mapWhere; }
	 */

	// CHECKSTYLE:ON CyclomaticComplexity - Generación de código de UDA

	/**
	 * StringBuilder initilization value
	 */
	public static final int STRING_BUILDER_INIT = 4096;
}
