package com.jasamedika.medifirst2000.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

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


	

import com.jasamedika.medifirst2000.exception.ServiceVOException;
import com.jasamedika.medifirst2000.service.PeriodePengajarService;
import com.jasamedika.medifirst2000.util.CommonUtil;
import com.jasamedika.medifirst2000.entities.PeriodePengajar;
import com.jasamedika.medifirst2000.vo.PeriodePengajarVO;
import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
import com.jasamedika.medifirst2000.dao.PeriodePengajarDao;

/**
 * Implement class for PeriodePengajarService
 * 
 * @author Generator
 * @param <T>
 */
@Service("periodePengajarService")
public class PeriodePengajarServiceImpl extends BaseVoServiceImpl implements PeriodePengajarService 
{	
	@Autowired
	private BaseConverterImpl<PeriodePengajarVO,PeriodePengajar>periodePengajarConverter;
	
	@Autowired
	private PeriodePengajarDao periodePengajarDao;

	
	@Override
	public Map<String, Object> savePeriodePengajar(PeriodePengajarVO vo) {
		Map<String, Object> result = new HashMap<String, Object>();
		PeriodePengajar model = new PeriodePengajar();
		model = periodePengajarConverter.transferVOToModel(vo,model);
		
		PeriodePengajar resultDomain = periodePengajarDao.save(model);
		if (CommonUtil.isNotNullOrEmpty(resultDomain)) {
			result.put("noRec", resultDomain.getNoRec());
		}

		return result;
	}
}