package com.ejie.m62fb.service;

import com.ejie.x38.dto.Pagination;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ejie.m62fb.dao.AdjudicatarioDao;
import com.ejie.m62fb.model.Adjudicatario;

/**
 * AdjudicatarioServiceImpl generated by UDA, 24-oct-2012 16:55:00.
 * 
XXXX
 */

@Service(value = "adjudicatarioService")
public class AdjudicatarioServiceImpl implements AdjudicatarioService {

	@Autowired
	private AdjudicatarioDao adjudicatarioDao;

	/**
	 * Inserts a single row in the Adjudicatario table.
	 * 
	 * @param adjudicatario
	 *            Adjudicatario
	 * @return Adjudicatario
	 */
	@Transactional(rollbackFor = Throwable.class)
	public Adjudicatario add(Adjudicatario adjudicatario) {
		return this.adjudicatarioDao.add(adjudicatario);
	}

	/**
	 * Updates a single row in the Adjudicatario table.
	 * 
	 * @param adjudicatario
	 *            Adjudicatario
	 * @return Adjudicatario
	 */
	@Transactional(rollbackFor = Throwable.class)
	public Adjudicatario update(Adjudicatario adjudicatario) {
		return this.adjudicatarioDao.update(adjudicatario);
	}

	/**
	 * Finds a single row in the Adjudicatario table.
	 * 
	 * @param adjudicatario
	 *            Adjudicatario
	 * @return Adjudicatario
	 */
	public Adjudicatario find(Adjudicatario adjudicatario) {
		return (Adjudicatario) this.adjudicatarioDao.find(adjudicatario);
	}

	/**
	 * Finds a List of rows in the Adjudicatario table.
	 * 
	 * @param adjudicatario
	 *            Adjudicatario
	 * @param pagination
	 *            Pagination
	 * @return List
	 */
	public List<Adjudicatario> findAll(Adjudicatario adjudicatario,
			Pagination pagination) {
		return (List<Adjudicatario>) this.adjudicatarioDao.findAll(
				adjudicatario, pagination);
	}

	/**
	 * Counts rows in the Adjudicatario table.
	 * 
	 * @param adjudicatario
	 *            Adjudicatario
	 * @return Long
	 */
	public Long findAllCount(Adjudicatario adjudicatario) {
		return this.adjudicatarioDao.findAllCount(adjudicatario);
	}

	/**
	 * Finds rows in the Adjudicatario table using like.
	 * 
	 * @param adjudicatario
	 *            Adjudicatario
	 * @param pagination
	 *            Pagination
	 * @param startsWith
	 *            Boolean
	 * @return List
	 */
	public List<Adjudicatario> findAllLike(Adjudicatario adjudicatario,
			Pagination pagination, Boolean startsWith) {
		return (List<Adjudicatario>) this.adjudicatarioDao.findAllLike(
				adjudicatario, pagination, startsWith);
	}

	/**
	 * Counts rows in the Adjudicatario table using like.
	 * 
	 * @param adjudicatario
	 *            Adjudicatario
	 * @param startsWith
	 *            Boolean
	 * @return Long
	 */
	public Long findAllLikeCount(Adjudicatario adjudicatario, Boolean startsWith) {
		return this.adjudicatarioDao
				.findAllLikeCount(adjudicatario, startsWith);
	}

	/**
	 * Deletes a single row in the Adjudicatario table.
	 * 
	 * @param adjudicatario
	 *            Adjudicatario
	 * @return
	 */
	@Transactional(rollbackFor = Throwable.class)
	public void remove(Adjudicatario adjudicatario) {
		this.adjudicatarioDao.remove(adjudicatario);
	}

	/**
	 * Deletes multiple rows in the Adjudicatario table.
	 * 
	 * @param adjudicatarioList
	 *            List
	 * @return
	 */
	@Transactional(rollbackFor = Throwable.class)
	public void removeMultiple(List<Adjudicatario> adjudicatarioList) {
		for (Adjudicatario adjudicatarioAux : adjudicatarioList) {
			this.adjudicatarioDao.remove(adjudicatarioAux);
		}
	}

}
