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.TipeKoleksiService;
import com.jasamedika.medifirst2000.util.CommonUtil;
import com.jasamedika.medifirst2000.entities.TipeKoleksi;
import com.jasamedika.medifirst2000.vo.TipeKoleksiVO;
import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
import com.jasamedika.medifirst2000.dao.TipeKoleksiDao;

/**
 * Implement class for TipeKoleksiService
 * 
 * @author Generator
 * @param <T>
 */
@Service("tipeKoleksiService")
public class TipeKoleksiServiceImpl extends BaseVoServiceImpl implements TipeKoleksiService 
{	
	@Autowired
	private BaseConverterImpl<TipeKoleksiVO,TipeKoleksi>tipeKoleksiConverter;
	
	@Autowired
	private TipeKoleksiDao tipeKoleksiDao;


	@Override
	public Map<String, Object> saveTipeKoleksi(TipeKoleksiVO vo) {
		Map<String, Object> result = new HashMap<String, Object>();
		TipeKoleksi model = new TipeKoleksi();
		model = tipeKoleksiConverter.transferVOToModel(vo,model);
		
		TipeKoleksi resultDomain = tipeKoleksiDao.save(model);
		if (CommonUtil.isNotNullOrEmpty(resultDomain)) {
			result.put("noRec", resultDomain.getNoRec());
		}

		return result;
	}
}