package com.jasamedika.medifirst2000.dao.custom;

import javax.persistence.Query;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.jasamedika.medifirst2000.dao.custom.base.impl.CoreDaoImpl;
import com.jasamedika.medifirst2000.entities.IpsrsPeminjamanAlat;
import com.jasamedika.medifirst2000.vo.IpsrsPeminjamanAlatVO;

@Repository
public class IpsrsPeminjamanAlatDaoCustomImpl extends 
			CoreDaoImpl<IpsrsPeminjamanAlat> implements IpsrsPeminjamanAlatDaoCustom{

	public IpsrsPeminjamanAlatDaoCustomImpl() {
		super(IpsrsPeminjamanAlat.class);
	}

	@Override
	@Transactional
	public Integer updateStatusPeminjaman(IpsrsPeminjamanAlatVO vo){
		Query query = em.createQuery("update IpsrsPeminjamanAlat model set model.status=:status where model.noRec=:noRec");
		query.setParameter("noRec", vo.getNoRec());
		query.setParameter("status", vo.getStatus());
		return query.executeUpdate();
	}
	
}
