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.NamaPegawaiService;
import com.jasamedika.medifirst2000.util.CommonUtil;
import com.jasamedika.medifirst2000.entities.NamaPegawai;
import com.jasamedika.medifirst2000.vo.NamaPegawaiVO;
import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
import com.jasamedika.medifirst2000.dao.NamaPegawaiDao;

/**
 * Implement class for NamaPegawaiService
 * 
 * @author Generator
 * @param <T>
 */
@Service("namaPegawaiService")
public class NamaPegawaiServiceImpl extends BaseVoServiceImpl implements NamaPegawaiService 
{	
	@Autowired
	private BaseConverterImpl<NamaPegawaiVO,NamaPegawai>namaPegawaiConverter;
	
	@Autowired
	private NamaPegawaiDao namaPegawaiDao;

	
	@Override
	public Map<String, Object> saveNamaPegawai(NamaPegawaiVO vo) {
		Map<String, Object> result = new HashMap<String, Object>();
		NamaPegawai model = new NamaPegawai();
		model = namaPegawaiConverter.transferVOToModel(vo,model);
		
		NamaPegawai resultDomain = namaPegawaiDao.save(model);
		if (CommonUtil.isNotNullOrEmpty(resultDomain)) {
			result.put("noRec", resultDomain.getNoRec());
		}

		return result;
	}
}