package com.jasamedika.medifirst2000.service.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.jpa.JpaSystemException;
import org.springframework.stereotype.Service;

import com.jasamedika.medifirst2000.converter.KecamatanConverter;
import com.jasamedika.medifirst2000.dao.KecamatanDao;
import com.jasamedika.medifirst2000.entities.Kecamatan;
import com.jasamedika.medifirst2000.exception.ServiceVOException;
import com.jasamedika.medifirst2000.service.KecamatanService;
import com.jasamedika.medifirst2000.vo.KecamatanVO;


/**
 * Implement class for Kecamatan
 * 
 * @author Adik
 * @param <T>
 */


@Service("kecamatanService")
public class KecamatanServiceImpl extends BaseVoServiceImpl implements KecamatanService {

	@Autowired
	private KecamatanDao kecamatanDao;
	
	@Autowired
	private KecamatanConverter kecamatanConverter;
	
	
	@Override
	public Object add(Object vo) throws JpaSystemException, ServiceVOException {
		return null;
	}

	@Override
	public Object update(Object vo) throws JpaSystemException, ServiceVOException {
		return null;
	}

	@Override
	public Boolean delete(Object key) throws JpaSystemException {
		return null;
	}

	@Override
	public Object findById(Object key) throws JpaSystemException {
		return null;
	}

	@Override
	public List findAll() throws JpaSystemException {
		List<KecamatanVO> vos=new ArrayList<KecamatanVO>();
		List<Kecamatan> models=(List<Kecamatan>) kecamatanDao.findAll();
		kecamatanConverter.transferListOfModelToListOfVO(models, vos);
		return vos;
	}

	@Override
	public Map findAllWithPageAndLimitAndSortByAndDirectionParameter(Integer page, Integer limit, String sort,
			String dir) {
		return null;
	}

	
	public List<Kecamatan> findAllKecamatan(){
		List<Kecamatan> models=(List<Kecamatan>) kecamatanDao.findAll();
		return models;
	}


}
