package com.ejie.m62fb.service;
import com.ejie.m62fb.dao.M62fbRegTenenciaDao;
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.model.M62fbRegTenencia;

/**
 * M62fbRegTenenciaServiceImpl generated by UDA, 19-nov-2012 13:36:51.
XXXX
 */

@Service(value = "m62fbRegTenenciaService")
public class M62fbRegTenenciaServiceImpl implements M62fbRegTenenciaService {

	@Autowired
	private M62fbRegTenenciaDao m62fbRegTenenciaDao;

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

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

	/**
	 * Finds a single row in the M62fbRegTenencia table.
	 *
	 * @param m62fbRegTenencia M62fbRegTenencia
	 * @return M62fbRegTenencia
	 */
	public M62fbRegTenencia find(M62fbRegTenencia m62fbRegTenencia) {
		return (M62fbRegTenencia) this.m62fbRegTenenciaDao.find(m62fbRegTenencia);
	}

	/**
	 * Finds a List of rows in the M62fbRegTenencia table.
	 *
	 * @param m62fbRegTenencia M62fbRegTenencia
	 * @param pagination Pagination
	 * @return List
	 */
	public List<M62fbRegTenencia> findAll(M62fbRegTenencia m62fbRegTenencia, Pagination pagination) {
		return (List<M62fbRegTenencia>) this.m62fbRegTenenciaDao.findAll(m62fbRegTenencia, pagination);
	}
    
	/**
	 * Counts rows in the M62fbRegTenencia table.
	 *
	 * @param m62fbRegTenencia M62fbRegTenencia
	 * @return Long
	 */
	public Long findAllCount(M62fbRegTenencia m62fbRegTenencia) {        
		return  this.m62fbRegTenenciaDao.findAllCount(m62fbRegTenencia);
	}

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

	/**
	 * Counts rows in the M62fbRegTenencia table using like.
	 *
	 * @param m62fbRegTenencia M62fbRegTenencia
	 * @param startsWith Boolean
	 * @return Long
	 */
	public Long findAllLikeCount(M62fbRegTenencia m62fbRegTenencia, Boolean startsWith) {
		return this.m62fbRegTenenciaDao.findAllLikeCount(m62fbRegTenencia, startsWith);
	}
	    
	/**
	 * Deletes a single row in the M62fbRegTenencia table.
	 *
	 * @param m62fbRegTenencia M62fbRegTenencia
	 * @return
	 */
	@Transactional(rollbackFor = Throwable.class)
	public void remove(M62fbRegTenencia m62fbRegTenencia) {
		this.m62fbRegTenenciaDao.remove(m62fbRegTenencia);
	}
	
	/**
	 * Deletes multiple rows in the M62fbRegTenencia table.
	 *
	 * @param m62fbRegTenenciaList List
	 * @return
	 */
	@Transactional(rollbackFor = Throwable.class)
	public void removeMultiple(List<M62fbRegTenencia> m62fbRegTenenciaList) {
		for (M62fbRegTenencia  m62fbRegTenenciaAux:m62fbRegTenenciaList) {
			this.m62fbRegTenenciaDao.remove(m62fbRegTenenciaAux);
		}
	}
	
}

