package com.ejie.t17i.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ejie.t17i.constants.T17Constants;
import com.ejie.t17i.dao.CalleDao;
import com.ejie.t17i.model.Calle;
import com.ejie.x38.dto.JQGridRequestDto;

/**
 * <p>
 * Implementaci&oacute;n de servicios de l&oacute:gica de negocio para acceder a la tabla CALLE de NORA
 * </p> 
XXXX
 * @see com.ejie.t17i.model.Calle
 */
@Service(value = "calleService")
public class CalleServiceImpl implements CalleService {

	@Autowired
	private CalleDao calleDao;

	/**
	 * {@inheritDoc}
	 */
	public Calle find(final Calle calle) {
		return (Calle) this.calleDao.find(calle);
	}

	/**
	 * {@inheritDoc}
	 */
	public List<Calle> findAll(final Calle calle,final JQGridRequestDto jqGridRequestDto) {
		calle.setEstado(T17Constants.ESTADO_DEFINITIVO);
		return (List<Calle>) this.calleDao.findAll(calle,
				jqGridRequestDto);
	}
	
	/**
	 * {@inheritDoc}
	 */
	public Long findAllCount(final Calle calle) {
		calle.setEstado(T17Constants.ESTADO_DEFINITIVO);
		return this.calleDao.findAllCount(calle);
	}

	/**
	 * {@inheritDoc}
	 */
	public List<Calle> findAllLike(final Calle calle,final JQGridRequestDto jqGridRequestDto,final Boolean startsWith) {
		calle.setEstado(T17Constants.ESTADO_DEFINITIVO);
		return (List<Calle>) this.calleDao.findAllLike(calle,jqGridRequestDto, startsWith);
	}
}
